What happens to android application and activities and services that belongs to application when the phone/AP goes to sleep mode?Will the framework destroy Activities and Services and OS kills the process?
Android's “Bedtime” mode, previously known as “Wind Down,” uses Do Not Disturb to silence calls, texts and notifications, while grayscale fades the colors on your phone to black and white, to reduce the draw to your screen.
Setting your apps to sleep will prevent them from running in the background so you can focus on the apps you use most often. You can always switch the settings later if you change your mind and need to start using a few apps again.
Annoyingly, the root cause of this is frequently Android itself, trying to manage your phone's battery life by forcing "low" priority apps to go to sleep, with the end result being those delayed notifications.
In case of device sleep, activity's `onPause()' will be called. Read activity lifecycle to understand this.
OS only kills the process when memory/resources are low. Activities are killed first, services are only killed as last resort.
But there is no guarantee they will not be killed. This is why you should rely on system services to call you when you need some work done: use AlarmManager to do call your code periodically or use listeners to notify you of system changes (gps, network, etc..)
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