alarm

Troubles play sound in silent mode on Android

非 Y 不嫁゛ 提交于 2019-12-21 19:49:30
问题 I am writing an android application to simply play an alarm no mater what mode the phone even if it is in silent mode. I found this question and used the code from the answer to override the current volume state. My code looks like this: Uri alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM); if (alert == null){ // alert is null, using backup alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); if (alert == null){ // alert backup is null, using 2nd backup

UILocalNotification fires after reinstalling the app

一世执手 提交于 2019-12-21 12:49:10
问题 My app has an alarm function using UILocalNotification, and it works great. However, if the user uninstalls the app, then later REINSTALLS it, he would receive all the "in between" notifications at once. I have tried to call: [[UIApplication sharedApplication] cancelAllLocalNotifications]; if it's the first time the app is launched, but it doesn't help, because the notification is received even before application:didFinishLaunchingWithOptions: is called. This was worse in 4.0 when the alarm

Problem acquiring wake lock from broadcast receiver

孤街浪徒 提交于 2019-12-21 04:39:24
问题 I have a problem. I am trying to make a broadcast receiver acquire a wake lock so my alarm will wake the phone from sleep mode. In the broadcast receiver below, the program crashes with "source not found" on line "sCpuWakeLock.acquire(); when the class "AlarmAlertWakeLock" is called by AlarmReceiver. Any idea what's going on? Is there a better way to do what I'm trying to do? In one file: import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent;

Is it possible to change/set the alarm clock from a different application on the iPhone

痞子三分冷 提交于 2019-12-19 04:40:10
问题 Is it possible to access information like the alarm clock time and change it from a different application on the iPhone. And if its possible to do it, can it be approved by the app store to sell it? 回答1: You can certainly do it—the CFPreferences API would probably be the right approach—but you definitely wouldn't get allowed into the App Store. If you're looking to make an alarm-clock application, check out the Scheduling Local Notifications docs. 来源: https://stackoverflow.com/questions

Call Notification from BroadcastReceiver

戏子无情 提交于 2019-12-19 03:14:18
问题 I have the code : public void AlarmStart() { Calendar cal = Calendar.getInstance(); cal.add(Calendar.MINUTE, 5); Intent intent = new Intent(MainNote.this, AlarmReceiver.class); intent.putExtra("alarm_message", "MESS"); PendingIntent sender = PendingIntent.getBroadcast(MainNote.this, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender); } It calls AlarmReceiver class on

How I can open native alarm clock in iphone by using code?

喜你入骨 提交于 2019-12-19 03:04:21
问题 I have to crate a sample app in which when I clicked a button that should open the native alarm clock so that user can use it for setting alarm? 回答1: If the Clock app supported a URL scheme, like the Phone app’s tel:// or the Mail app’s mail:// , you could open it with the standard [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"..."]] approach. Unfortunately, to my knowledge, it doesn’t, so all you can really do is prompt the user to open that app themselves to set up the

How I can open native alarm clock in iphone by using code?

瘦欲@ 提交于 2019-12-19 03:04:08
问题 I have to crate a sample app in which when I clicked a button that should open the native alarm clock so that user can use it for setting alarm? 回答1: If the Clock app supported a URL scheme, like the Phone app’s tel:// or the Mail app’s mail:// , you could open it with the standard [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"..."]] approach. Unfortunately, to my knowledge, it doesn’t, so all you can really do is prompt the user to open that app themselves to set up the

Android - Alarm lost after app update

≡放荡痞女 提交于 2019-12-18 16:58:11
问题 I have an app running on Android that creates an alarm that is fired every 24 hours. This alarm is working as expected. However, when I update my app through Google Play this alarm is lost because the end user does not open the app right after the app was updated. My opinion is that Android is deleting the alarms my app created when the app was updated. Does anyone already got this situation? Is there any way to persist the alarms when the app is updated? 回答1: Your solution is as simple as

Android - Alarm lost after app update

99封情书 提交于 2019-12-18 16:58:02
问题 I have an app running on Android that creates an alarm that is fired every 24 hours. This alarm is working as expected. However, when I update my app through Google Play this alarm is lost because the end user does not open the app right after the app was updated. My opinion is that Android is deleting the alarms my app created when the app was updated. Does anyone already got this situation? Is there any way to persist the alarms when the app is updated? 回答1: Your solution is as simple as

How to set an Alarm in iOS?

徘徊边缘 提交于 2019-12-17 16:22:44
问题 I know this question has asked many times on StackOverflow but i couldn't able to set alarm in my app because i am very new to iOS? I am following this tutorial to set an alarm: Setting a reminder using UILocalNotification in iOS. However, it doesn't seems to be working for me. I am in need to set alarm daily lets say 5.00 PM daily. I can't use date picker for choosing the time. 回答1: First on your xib , (or code) set the date picker mode: Time (Default is date & time) The system assumes that