• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Set Alarm From Timepicker

Hello my friends,

I want to set alarm from timepicker. But I could'nt do it in anyway. My codes are below. What is my problem ?

MainActivity.java

package com.info.alarmtetiklemebildirim2018;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.support.v4.app.NotificationCompat;
import android.view.View;
import android.widget.Button;
import android.widget.TimePicker;

import java.util.Calendar;

public class MainActivity extends Activity {

private Calendar calendar;
private Button buttonBildirimGonder;
private TimePickerDialog timePickerDialog;

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());

timePickerDialog = new TimePickerDialog(MainActivity.this, new TimePickerDialog.OnTimeSetListener() {
@override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {

calendar.set(Calendar.HOUR_OF_DAY,hourOfDay);
calendar.set(Calendar.MINUTE,minute);


}
}, Calendar.HOUR_OF_DAY, Calendar.MINUTE, true);

buttonBildirimGonder = (Button) findViewById(R.id.buttonBildirimGonder);


buttonBildirimGonder.setOnClickListener(new View.OnClickListener() {
@override
public void onClick(View v) {

zamanliliBildirimGonder();
}
});


}


private void zamanliliBildirimGonder() {

NotificationCompat.Builder builder;

NotificationManager bildirimYoneticisi =
(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);

Intent ıntent = new Intent(this,MainActivity.class);

PendingIntent gidilecekIntent = PendingIntent.getActivity(this,1,ıntent,PendingIntent.FLAG_UPDATE_CURRENT);


if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

String kanalId = "kanalId";
String kanalAd = "kanalAd";
String kanalTanım = "kanalTanım";
int kanalOnceligi = NotificationManager.IMPORTANCE_HIGH;

NotificationChannel kanal = bildirimYoneticisi.getNotificationChannel(kanalId);

if (kanal == null) {
kanal = new NotificationChannel(kanalId, kanalAd, kanalOnceligi);
kanal.setDescription(kanalTanım);
bildirimYoneticisi.createNotificationChannel(kanal);
}

builder = new NotificationCompat.Builder(this, kanalId);

builder.setContentTitle("Başlık")
.setContentText("İçerik")
.setSmallIcon(R.drawable.resim)
.setAutoCancel(true)
.setContentIntent(gidilecekIntent);

} else {

builder = new NotificationCompat.Builder(this);

builder.setContentTitle("Başlık")
.setContentText("İçerik")
.setSmallIcon(R.drawable.resim)
.setContentIntent(gidilecekIntent)
.setAutoCancel(true)
.setPriority(Notification.PRIORITY_HIGH);
}


Intent broadcastIntent =
new Intent(MainActivity.this,BildirimYayinlayici.class);

broadcastIntent.putExtra("bildirimNesnesi",builder.build());

PendingIntent gidilecekBroadcast = PendingIntent.getBroadcast(this
,0
,broadcastIntent
,PendingIntent.FLAG_UPDATE_CURRENT);

AlarmManager alarmManager =
(AlarmManager) getSystemService(Context.ALARM_SERVICE);

alarmManager.set(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),gidilecekBroadcast);



}



}

and broadcast receiver codes.

package com.info.alarmtetiklemebildirim2018;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class BildirimYayinlayici extends BroadcastReceiver {

public void onReceive(Context context, Intent intent) {

NotificationManager bildirimYoneticisi = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);

Notification bildirim = intent.getParcelableExtra("bildirimNesnesi");

bildirimYoneticisi.notify(1, bildirim);

}
}

Non-Android smartwatches that can show Android notifications?

Why choose a watch without an Android system when you have an Android operating system on your phone?
Because you prefer something else? Because you don't need all of the functionality of Wear OS (as Google now calls it), and would rather have longer battery life?

Non-android smart watches cover a wide range of devices. Samsung's Galaxy Watches are full-blown smartwatches but run the Tizen OS (and I wonder how many owners don't even realise?). Companies like Fitbit and Garmin also make non-Wear smartwatches, which depending on your needs may suit you better than a Wear OS watch. Or there are hybrid smartwatches with conventional analogue faces but able to display notifications (e.g. from Garmin or Withings), which is what the original poster (in 2017) wanted. There are some that don't display notifications, just alert you when one has been received. Then there are fitness bands which are less obtrusive than a watch but still able to display notifications, dismiss them or even send limited pre-determined acknowledgements. And for each of these there is someone who will say it suits them better than a Wear OS watch. One size does not fit all.

Personally I do have a use for wearable notifications, but opted for a fitness band on the other wrist to my conventional watch. Why didn't I just replace both with a smartwatch? There are two reasons: firstly, I simply prefer a real watch. I like having a nicely-designed dial, analogue hands ticking or sweeping around it, seeing some craft there as well as an instantly readable time display. To me a Wear OS watch remains a piece of consumer electronics: it's functional, but it's a different class of object. The second reason is that I expect any watch I buy to last for decades, and a good one to outlast me, while smartwatches are intended to be "disposable", to be replaced after a few years, and replacing the first with the second did not sit well with me.

I'm not saying your choice is wrong, but you asked why anyone would not make the same choice as you so there is my answer.

Is there an easier way of showing bluetooth earbuds battery?

I don't know these particular wireless earbuds, but check if the manufacturer provides a supporting/info app for them.

May look something like this, which is the app for my Huawei FreeBuds 3. Which shows the charging status of the earbuds as well as the case. The supporting app is used to apply firmware updates to them as well.
Screenshot_20200519_135821.jpg


20% power, that's not bad after 4 hours of playing.

Thing with these completely wireless earbuds, there's actually three batteries involved. One in each earbud, and a larger one in the charging case. And they're all communicating with the phone via Bluetooth. It could be the phone is getting confused as to which Bluetooth device battery is it's supposed to be gauging? That's why manufacturers might provide their own proprietary apps for this. Huawei does, and I know Bose does as well.

AFAIK original spec was for BT wireless headphones that only had one battery, and that's what the phone usually shows in the notification area.

Help Downloading embedded vimeo videos in apps.

Welcome to Android Forums, Doc_G! :)

Don't they give you an option to download the lectures? Seems like a no-brainer to me! Have you checked if the app includes an archive/library of lectures?

Indeed it is the first thing I looked for. However, they have disabled the download option.

Welcome to Android Forums, Doc_G! :)
That depends. If you're able to get their Vimeo URLs, you can try KeepDownloading.com.

How can I fetch urls from an embedded video within an app. one can do it on webpages ( by looking for it in the source code) but I dont know where to look for it in an app.

Welcome to Android Forums, Doc_G! :)
Mods: I'm offering this with the understanding that the user is entitled to save the videos, which, being lectures, I can't see why they wouldn't be. If this sounds like pirating, please delete.
Help is required for fully legal and educational purposes.

My phone rings too long

Hi @silasp, you could try the following MMI code. It used to work in most carriers, as did the facility to alter the number of rings in 'voicemail'-'call forwarding'-'unanswered' in 'settings' but for some reason most carriers have blocked the facilities.

I'm with three carriers only one of which allows me to change the number of rings using either method, so I guess it's bit of a long shot, but worth a try.

"Open your dialer, key in *61*[voicemail number]*11*xx#, where xx is your required delay in seconds - 05,10,15,20,25 or 30, and hit Call/Send.

(in my case it would be :-
*61*+447781233123*11*30#)
Which is the generic voicemail number for UK Carrier '3'.

Then key in *#61# to confirm the new setting"

I have just doubled checked my two other carriers and one of them, 'ee', does still allow changing the number of rings by either method. My other carrier is BT which does not allow any changes by either method, although they may respond to a request if I asked them, but I'm happy with it as it is. To be honest I don't know what the delay is set to, if I hear the ring I answer it, if I don't answer it's because I haven't got the phone with me so it goes to voicemail and the number of rings is of no consequence.


:)

LG X Power - Make SD Card part of internal storage.

for my LG, X power 3, I have successfully followed all the steps outlined by Lorien79 above except for the "Migrate data" step. Every time I attempt to select <settings><Storage><SD card> <...> <Migrate Data> I get "Unfortunately, Settings has stopped."

I have attempted to clear cache in "Settings" App.
I have sent everything back to factory reset and re-applied the steps to make the SD Card internal.

Any other options.

Thank you.

Help DMX7706S works with old version of Android Auto, not new

Back in October, I had a Kenwood DMX7706S receiver installed in my wife's car. My wife is a an iOS user so it has worked great for her. On my phone (Google Pixel 2XL) it connects via Bluetooth, but says it has connection problems when I try to hook up the cable. I am running the latest version of Android Auto. Oddly the DMX7706S definitely connects to my company phone, a Samsung Galaxy S9 that is still running the older version of Android Auto. I checked, and there are not any firmware updates for the DMX7706S. Any thoughts on how to get my phone to work with it.

Meanwhile, my Google Pixel 2XL connects great to my car, which has Android Auto built in. So the only issue is connecting my personal phone to my wife's car.

SD card issues

A 128GB micro SD is the SDXC type. And it sounds like your box can only use the older SDHC type micro SD, which are only upto 32GB.

Your 2TB hard drive is connected via USB, which is different to micro SD cards, and doesn't have any capacity limits.

You could try an external SDXC capable micro SD reader connected via USB, that would probably work.

Did that but the phone buggered the card if I had format from the box probably would be ok.

Calendar - storage location

Go into your Settings >> Apps menu, find the Samsung Calendar app entry and open that. Tap the Force stop button and then the Disable button. It's a pre-installed, system-level app (by Samsung) so you can't just uninstall it like an app that you install and want to remove. But if you at least Disable it, at that point it won't be running needlessly in the background.

Need a list of apps that are safe to disable.

Yes, but none of those are irreplaceable. There are non-Google alternatives to anything that I actually want to use, and I already use alternatives, usually open source, more than I use the Google stuff. Banking is probably the one exception, but even there I really only use one app to verify a login, and that's just a convenience as there are other methods available. Hence removing Google completely is an option for me.

So for me Android is the platform. Google are an optional convenience that comes with serious creepiness, and are always under review.

Print from android app

I am newer to android and java.

i have application written in c# and running inside Android using Webview

now i need to print PDF to Thermal printer Epson M30, when i download PDF file from the application i need to print it using this printer.

i downloaded ePOS_SDK_Android_v2.14.0

and i have added the below:

Store ePOS2.jar and ePOSEasySelect.jar in the following location. C:\Users[account name]\AndroidStudioProjects[project name]\app\libs

Create the following folder structure. C:\Users[account name]\AndroidStudioProjects[project name]\app\src\main\jniLibs

Depending on your CPU, store the following folders bundled with this package in the jniLibs folder: armeabi arm64-v8a x86_64

Permission added:

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>

<uses-permission android:name="android.permission.INTERNET"/>
Now there is code to be add :

printer = new Printer(Printer.TM_M30, Printer.MODEL_ANK, this)
1- first i don't know where to add, because i need printer to be add to android mobile once webview started to give user ability to select this printer while they select the pdf to print

how to do it?

Help I can't install any roms now.(ERROR 7)(Solved)

I just had the same problem With the Nubia NX591J and the MK90.0 rom. First of all I discovered I had too old of a version of TWRP loaded 3.1.1. After loading that, what a hassle, The rom loaded ok but then I ran into the Unauthorized. I need that fixed to be able to load the Gapps package on the phone. My mistake, I should have loaded that before. Well to fix that I just boot the NK90 turned on debugging and that seems to fix that. Went back and loaded the Open Gapps ARM64 9.0 Pico and Magisk 20.4 and we are rooted and cooking loading all the apps back on. Thanks for the Forum, this post may lighten the load for someone who got stuck with a Nubia 591 and 7.1.1 with a security level of jun 2017.

Filter

Back
Top Bottom