I have an application which contain an activity and a service. The activity runs the service. When I start something big like a game (for example AngryBirds), I get a message “Low memory: no more services” in the LogCat and my service shutdown. But if I run music on background it works well and continue working…
So I have 2 questions:
- I guess the android killing my process, because it is contain my
activity. Am I right? - How can I implement immortal service like the player service?
Thanks
You should only do this when the user knows that the service is running all the time and has profit of this. If so, check the startForeground method on the following link:
http://developer.android.com/reference/android/app/Service.html
If not, you should improve your architecture. Most service don’t need to run all the time and it might be useful to persist the data of your service.