31.12.2010 16:35, asinha пишет:
I am trying to write a service which runs as background process and
invoke my task (in application) at 9am everyday.

My service is:

[snip]

Is this the right way to write my service? How would I verify my
service?

This is error-prone, since a service can get kicked out of memory at any time, and all threads (including the thread used by Java timers) will terminate.

Set an Alarm with AlarmManager, it avoids the issues caused by interference from process lifecycles:

http://developer.android.com/reference/android/app/AlarmManager.html

--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
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