alarmmanager

Warning message: The value of the field CancelAnAlarmActivity.mDetailsButton is not used

一笑奈何 提交于 2019-12-13 02:20:01
问题 The program is running on my emulator and phone but I don't understand why i'm getting this on ADT. Is there something wrong with my codes? please check. i need help. If I remove this lines my app might not work properly according to how i wanted it to work. here's one of my java codes: import java.util.List; import android.app.AlarmManager; import android.app.AlertDialog; import android.app.ListActivity; import android.app.PendingIntent; import android.content.DialogInterface; import android

android alarm manager sound after reboot

馋奶兔 提交于 2019-12-13 02:17:38
问题 I'm working on a service-like application using android's AlarmManager. The app basically connects to a server and calls a remote procedure. If the value returned is True, it plays a sound: MediaPlayer mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_RING); try { mediaPlayer.setDataSource(getApplicationContext(), Uri.parse("file:///system/media/audio/ringtones/Rolling_tone.ogg")); } ... mediaPlayer.start(); This works all and well when the application is

Android AlarmManager.set(…): notification never received when battery low

久未见 提交于 2019-12-13 02:17:06
问题 I'm attempting to use AlarmManager to schedule a delayed check in my app. (Specifically, N minutes after a user approaches a location, I want to check whether they're still there, and if so send them a notification.) I've implemented this by checking to see whether they've entered the region in my location update receiver and, if they have, scheduling like so: Intent geofenceIntent = new Intent(context, GeofenceReceiver.class) // ...intent contents not important... PendingIntent pi =

Doze Mode, Battery Optimization whitelist, AlarmManager more frequent than 9 mins

可紊 提交于 2019-12-12 20:19:52
问题 I'm creating an app to connect with BT device to collect heath data (i.e.: body temperature). The sensor sleeps for periodic time and wakes up only for limited window of time to connect. I've tried to create AlarmManager which fires Foreground Service with setExactAndAllowWhileIdle() and it is working as expected for periods higher than 9 minutes, but below 9 minutes it goes to doze mode and do not fire AlarmManager BroadcastReceiver. From documentation I do not understand if adding app to

onNewIntent not called on restart

天大地大妈咪最大 提交于 2019-12-12 18:09:46
问题 I have an alarm clock app, that is using Alarm Manager and a Broadcast Receiver. The app is one single activity and 4 fragments. When an alarm goes off the onReceive method sends an intent to the main activity, the main activity receives this intent in the method onNewIntent and then moves to the correct fragment. Everything works fine, except when an alarm goes off after the app has been closed. Once I destroy the app, the alarm still goes off and the intent from the broadcast receiver fires

Passing values using intent extras in Alarm Manager in android

ぐ巨炮叔叔 提交于 2019-12-12 15:30:56
问题 I want to know if this code will work(I cannot try it out right now. Moreover, I have a few doubts that have to be cleared). Intent intent = new Intent(context, AlarmReceiver.class); intent.putExtra("user",global.getUsername()); intent.puExtra("password",global.getPassword); PendingIntent sender = PendingIntent.getBroadcast(context, 192837, intent, PendingIntent.FLAG_UPDATE_CURRENT); // Get the AlarmManager service Log.v("inside log_run", "new service started"); AlarmManager am =

IntentService and AlarmManager communication

自古美人都是妖i 提交于 2019-12-12 15:16:06
问题 Should alarm manager send PendingIntent to IntentService or is it better to send it to a broadcast receiver which then issues startService() targeting the pending intent? 回答1: That depends a bit on whether this is a _WAKEUP alarm or not. If not, feel free to use a getService() PendingIntent . If, however, it is a _WAKEUP alarm, not only do you need to use a BroadcastReceiver intermediary, but that BroadcastReceiver must also acquire a WakeLock which the IntentService later releases. The

How to repeat alarm in android 6.0

你。 提交于 2019-12-12 13:23:57
问题 I am using the setExactAndAllowWhileIdle() to set the alarm. But it works for only one time. How will I set the repeating alarm with interval 1 day? Before the API Level 23 setInexactRepeating method working fine. 回答1: Recharge your alarm when you broadcast receiver event is executing. I mean, public class CustomBroadcast extends WakefulBroadcastReceiver { public static final String somekey = "somekey.somekey.somekey"; @Override public void onReceive(Context ctx, Intent intent) { // TODO Auto

Can't stop a service started with alarmManager

你离开我真会死。 提交于 2019-12-12 13:18:57
问题 I'm having problems to cancel an alarm and a service started with it. I set the alarm in a activity: public class AlarmStarter extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent locationPollerIntent = new Intent(this, LocationPoller.class); PendingIntent pendingIntent = PendingIntent.getBroadcast (getApplicationContext(), REQUEST_CODE, locationPollerIntent, 0); alarmManager = (AlarmManager) getSystemService(ALARM

How to launch a notification in conjunction with AlarmManager?

╄→гoц情女王★ 提交于 2019-12-12 12:26:41
问题 I am trying to figure out how I should launch a notification. Creating the notification is not what I am asking, but rather a way to launch it in the background so its unobtrusive and the user can do whatever they were doing. Its for a calendar, a reminder to be exact. It is also important to note I am using AlarmManager . What method should I use to run it in the background. BroadCastReciever , Service , etc. Research I have found also presents a problem with AlarmManager . When the app is