sdphil wrote: > if I want the service to be running after the app has been closed > (like a media player app), then I need to have it in a separate > process and then the localservice api demo model, won't work, right?
No, a service can run in your main application's process without any activities running. Step #1: Put the service in your main application with your activities. Step #2: Call startService() to start the service. Step #3: Call stopService() to stop the service when you are done with it. Now, it is not a good idea to keep services running any more than you have to. The media player is a rather unusual case. I wrote up a post about this just a couple of hours ago: http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not/ -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Training: http://commonsware.com/training.html --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

