How to prevent apps from sleeping on Android 2022

Due to the “save battery” mode that most android phones have, some apps are labeled as “low priority” and put to sleep while your phone is locked. And while this is good for your battery as some apps serve no function by running in the background, there are some exceptions when you might want an app to run and do its job while your phone is locked. Home Stash is a good example of this. The app copies the media files from your phone to a storage device connected to your router. And every time you take a new photo or video, Home Stash automatically makes a copy and sends it to your external HDD. And if you do not open the app frequently, this process is running in the background and if Android kills the app after a few minutes of “inactivity”, it might not have had time to sync everything before being disabled by the OS. 

And that is why Android has a “Never sleep” function that you can enable for individual apps. Here is how to do it

Samsung

  1. Go to settings
  2. Battery and device care
  3. Tap on “Battery
  4. Background usage limits
  5. Never sleeping apps
  6. Tap the “+” button and select Home Stash

Google and some other manufacturers

If your phone has Android Oreo (Android 8.0) or better, these steps should work. But be advised that some OEMs implement their own battery optimization functions.

  1. Find the app you want
  2. Tap and hold it until the long-press menu pops up. Tap the  “info” button.
  3. In the menu that just opened, locate and tap the “Battery” button.
  4. And select “Unrestricted”. This will allow Home Stash to run in the background without restrictions. 

Xiaomi

On Xiaomi, you have to follow the exact same steps as on the Pixel, but if you want Home Stash to work uninterrupted, there is one more thing you need to do.

  1. Follow the step presented above on the Google phones
  2. Open Home Stash and enter the multitasking overview/app switcher 
  3. Tap and hold the app preview and select the Lock option in the menu

And that’s it! From now on Android will not put Home Stash to sleep so the app can run in the background and archive all the new media files from your phone to your storage device.