Hello,

I need to set a bunch of alarm times inside an application
which uses an SQLite database to store them. When the
user changes data in the application the data is written to
the SQLite database and the RTC timer is set via AlarmManager
to the earliest of all those alarm times. When each timer expires
I need to display a popup window with a message from the database
and reset the timer to the next alarm time. However I have the following
problem: I've read that when the user powers off the device all programmed
timers are lost. So I need to set them up at boot time. If any were missed
then
I need to display a popup window immediately. For this I have found the
following
code snippet which seems appropriate for my case:

http://www.androidsnippets.com/autostart-an-application-at-bootup

My problems are the following:

1. How do I reboot the emulator? I have tried adb reboot but after
unmounting some
stuff from the filesystem the emulator freezes and I have to click the X in
the upper
right hand corner in the titlebar to close and then launch the emulator
again from
the AVD Manager. I have tried the power button on the emulator but the
device
just goes back to locked mode. Is the device rebooted when I press the power
button on the emulator? Why is adb reboot freezing it? What am I doing
wrong?

2. When I follow the code snippet, as soon as I unlock the device I get the
ususal
error message that my application has stopped unexpectedly, but then when I
start it from the launcher I can run it no problem. So if launching a window
as
opposed to starting a service at boot time is bound to produce this problem
(unless there is a way to fix it) then how can I display the alarms that
expired
when the user had the phone powered off when the application boots?

Thanks,

John Goche

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to