On Mar 2, 9:42 am, Mariano Kamp <mariano.k...@gmail.com> wrote:
> So how does that work?

Here's how nanoTweeter works (slightly abbreviated):

The alarm BroadcastReceiver's onReceive() acquires a WakeLock and
stores it in a static field so that the Service can access it later.
It then starts a Service using Context.startService().

The Service's onStart() creates a Handler for the main thread and then
creates and runs a new Thread. That Thread does the important work
then releases the WakeLock and calls Service.stopSelf() on the main
thread via the Handler that was set up earlier.


I pretty much copied the model that the built-in Alarm app uses:
http://android.git.kernel.org/?p=platform/packages/apps/AlarmClock.git;a=tree;h=refs/heads/release-1.0;hb=release-1.0

--
Jon

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

Reply via email to