I have a service for my application that runs fine, but when a user is not using there phone for while like 20 minutes the service just doesnt work any more. is there something i suppose to be doing like saving a state or something, i am lost at this point. I dont see why the service doest keep running, I look in the application>running services on my phone and it still says its running. Any suggestions?
I faced the same problem few time back. Then I started to use Android Alarm Service. That solved my problem. Here is a reference link http://android-er.blogspot.com/2010/10/simple-example-of-alarm-service-using.html
If you want to keep running in the background (e.g. downloading something), you need to grab a wakelock (http://developer.android.com/reference/android/os/PowerManager.html)
Also, look at the following if you happen to do downloads in the background: http://developer.android.com/reference/android/net/ConnectivityManager.html#getBackgroundDataSetting()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With