Reputation: 305
I have one process running in android device the problem is process is going to pause state when i lock the screen and resumes from the same point when I unlock the screen, I want that process to run continuously even if device screen is locked(i.e when screen is off)... Please suggest me the best possible solution..
Thanks in advance..
Upvotes: 0
Views: 4079
Reputation: 12367
Your solution is caleld service ( some piece of code running independet of UI ) . When screen is locked, whatever activity is in focus receives onPause() callback and is stopped.
You will have consider battery consumption issue. Just answer yourself questions
Consider to implement it as broadcast receiver weacked up by periodic alarms
Upvotes: 0
Reputation: 22146
What you need is http://developer.android.com/reference/android/os/PowerManager.html#PARTIAL_WAKE_LOCK
Upvotes: 2