ali-akel / kraigsandroid

Automatically exported from code.google.com/p/kraigsandroid
0 stars 0 forks source link

Reboot looses alarm setting #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Reboot the device when alarm is set. This could happen when the System 
crashes over night.

What is the expected output? What do you see instead?
The alarm should be set even after reboot, but it is not. You will come late to 
work -> :-((((

Please provide any additional information below.
Solution, from Android SDK:
Registered alarms are retained while the device is asleep (and can optionally 
wake the device up if they go off during that time), but will be cleared if it 
is turned off and rebooted. 

So you have to auto start the application after reboot and re-set the alarm via 
alarmmanager class.
Please fix this issue even if it is the last you do with this app - it simply 
would make it perfect.

Original issue reported on code.google.com by stefan.j...@gmail.com on 24 Aug 2010 at 8:22

GoogleCodeExporter commented 9 years ago
Well I see that you implemented auto start after boot completed already? Sadly 
it did not work for me today... :-/

Original comment by stefan.j...@gmail.com on 24 Aug 2010 at 8:26

GoogleCodeExporter commented 9 years ago
Yes, the alarms should automatically reschedule themselves when the phone 
reboots.  Do you see this problem with the built-in alarm as well?  What kind 
of phone and which version of the android OS are you using?  If the problem 
exists in the stock alarm as well, your operating system is probably not 
sending the ACTION_REBOOT broadcast when it restarts.

If you put alarm klock into debug mode (by selecting application settings -> 
debug mode) you should see a popup during reboot that says 'rescheduling alarm 
1' etc for each alarm that is to be rescheduled after a boot.  If this dialog 
does not pop up, it means the application did not receive the ACTION_REBOOT 
broadcast.

Original comment by kraigs.a...@gmail.com on 24 Aug 2010 at 1:33

GoogleCodeExporter commented 9 years ago
I think I found the reason why it did not work: It was because the app has been 
installed on the SD card. I have patched the default installation target to SD 
card so all apps that do not specify explicitly that they should be installed 
in the phone memory get installed on the SD card.
So it was my fault.

But, you may set the install location to phone memory for froyo just to make 
sure this does not happen again. - > 
http://developer.android.com/guide/appendix/install-location.html
Thank you for your fast response.

SJ
(HTC Desire , Froyo 2.2)

Original comment by stefan.j...@gmail.com on 24 Aug 2010 at 7:07

GoogleCodeExporter commented 9 years ago
Already have an outstanding bug to do so:
http://code.google.com/p/kraigsandroid/issues/detail?id=22

It will be a bit tricky in order to maintain backward compatibility, though, 
haven't gotten around to messing with it yet... (the app currently works back 
to 1.6).

Original comment by kraigs.a...@gmail.com on 24 Aug 2010 at 7:17

GoogleCodeExporter commented 9 years ago
You should NOT allow to install on SD card I think. On boot completed you will 
not get a call of the broadcast receiver when the app is on the SD card.  Your 
app is an Alarm Service: 
http://developer.android.com/guide/appendix/install-location.html#ShouldNot

Concerning backward compatibility:
At least it says "When your application is installed on a device with an API 
Level lower than 8, the android:installLocation attribute is ignored and the 
application is installed on the internal storage."

Original comment by stefan.j...@gmail.com on 24 Aug 2010 at 7:53

GoogleCodeExporter commented 9 years ago
Oh, interesting.  Thanks for the pointer.  That certainly makes resolving that 
issue easier :-)

Original comment by kraigs.a...@gmail.com on 24 Aug 2010 at 8:00