As I understand it, if your Service (or Activity, for that matter), dies due to the system reclaiming resources or a crash, the OS will restart it for you automatically. That means if you were to configure it to start upon boot (using android.permission.RECEIVE_BOOT_COMPLETED and implementing a receiver that handles android.intent.action.BOOT_COMPLETED), you could be pretty certain that your service is always running...once the user restarts the phone after installation. Or if you have some kind of user interface for the product (can't see how you wouldn't!), it could start the service if it isn't already running. Then there wouldn't be a restart needed.
Todd Sjolander On Apr 29, 8:44 am, "M.Manjunatha" <[email protected]> wrote: > Hi Folks, > > How do I restart my service automatically when my service gets killed > or crashes, until and unless I myself deregister the service. > > public class Myservice extends Service { > > public void Myservice(){ > > } > public void onStart(Intent intent, int startId) { > > } > > } > > Regards, > Manjunatha --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

