So I have two apps that utilise Geofence. Nest (Auto-Away) and August (Auto-Unlock). Both made by very different companies, doing very different things.

I have noticed that if the app is NOT open, neither of these functions will work. It is only when I open the app that something happens.

For example, August send me a notification when it senses I leave the house. I left the house, and on the way back pulled out my phones, opened the August app, and THEN the notification appeared.

I have tried selecting the apps as "Do Not Optimise" under Battery Optimisation settings but that didn't change anything.

I have a nasty habit of closing all apps in the recent bar, but I am trying to see if leaving it open will fix, but I would really like a solution where I would not have to do that.

I am running Android 7.1.1 on a Nexus5X. What can I do?

EDIT: Noticed that IFTTT's Geofence works.

  • Do you have any sort of battery saver apps such as Greenify or Clean Master installed?
    – famdekk
    Commented Apr 7, 2017 at 17:49
  • So the goal is to keep these apps running in the background right? Commented Apr 7, 2017 at 19:07
  • @xavier_fakerat pretty much
    – Nate D
    Commented Apr 8, 2017 at 2:39
  • @famdekk none whatsoever. Just stock android.
    – Nate D
    Commented Apr 8, 2017 at 2:39
  • My bad about that one. Do the apps show up in Running Services (part of Developer Settings) right after you open them? What about after you clear them out of the recents bar?
    – owlswipe
    Commented Apr 8, 2017 at 3:17

3 Answers 3


I know I am answering my own question, but the best solution I found was this app:


Basically it reopened August every time I tried to close it. Not very elegant, but it got the job done.

@Chahk inspired this answer, once I knew that it just needed to be forced to run in the foreground, a simple Google search gave me the thing I needed.


For you to keep the apps running in the ground the apps require a running service program. You can do this by:

  • Giving the apps a higher memory priority (so that they will not be killed when system memory is low)
  • Whitelisting the applications in phone's power saving features, task killers or hibernation programs
  • Enabling a persistent notification to keep the program's services running in the background. (Settings >> Notification Manager >> Always allow) See screenshot:

ADM persistent notification

Screenshot (click image for larger variant)

Also keep it running in background through phone manager:


Screenshot (click image for larger variant)

(I apologise to hide some apps names due to other reasons but I trust it wont affect the quality of the answer)

Alternatively when rooted use this code on terminal at every launch of the app:

echo "-17" > /proc/`pidof com.package.name`/oom_adj


Some apps for rooted devices include:

RAM Manager/ Memory boost

What this app affects:

  • OOM_ADJ (Out of memory)

    Every process has value which gives the kernel a hint, which process it can kill in an OOM (out of memory) situation.

  • LMK (Low memory killer)

    Works with your applications in memory. It affects your multitasking and free memory. But Android works with memory differently than you may be accustomed. Android needs to have running applications in foreground because of fast switching between your applications. It means that it's not good if you have too much more free memory. Your system gives you so much memory as you need.


    Memory Locker

    Memory Locker controls file in /data directory and also controls system files in root for setting oom_adj for all running processes. All locked applications are automatically locked after each reboot, so you do not need to lock your applications again after each reboot.


  1. Android -Keep app alive
  2. RAM Manager

I had a similar issue with other apps automatically closing but this solved may problems. Hope it helps.

  • I don't see any settings menus like this in my phone (Stock Android)
    – Nate D
    Commented Apr 9, 2017 at 18:23

For missing notifications, it sounds like both apps are not using Google Cloud Messaging (a.k.a. GCM) or its successor, Firebase Cloud Messaging.

The only way for an app to keep running when you swipe it away from Recents menu, is if it's set to run in foreground. This also prevents the OS from destroying the app's service when the system is low on resources. Android requires any app that's running in foreground to place a permanent notification (the one that cannot be swiped away) in the status bar. This feature is perfect for continuous monitoring, such as geofencing. Once again, this is not something you as an end-user have control over, and a developer must implement this feature.

I would send feedback to the developers of these apps asking to implement these features.

  • Is there any way to FORCE an app to run in the foreground?
    – Nate D
    Commented Apr 9, 2017 at 18:23
  • @NathanielDSouza Not natively in Android, but there could be some 3rd-party apps that attempt to do this.
    – Chahk
    Commented Apr 10, 2017 at 0:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .