3

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.

  • What kind of phone, please? Nexus 6P? 5X? Pixel? – owlswipe Apr 7 '17 at 15:35
  • @owlswipe Nexus5X. Sorry, forgot to add. – Nate D Apr 7 '17 at 17:02
  • Do you have any sort of battery saver apps such as Greenify or Clean Master installed? – famdekk Apr 7 '17 at 17:49
  • So the goal is to keep these apps running in the background right? – xavier_fakerat Apr 7 '17 at 19:07
  • 1
    Make sure to exempt them from Battery Optimizations. – owlswipe Apr 8 '17 at 0:32
1

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

https://play.google.com/store/apps/details?id=com.atasoglou.autostartandstay&rdid=com.atasoglou.autostartandstay

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.

0

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:

b

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

OR

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.

    and

    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.

Credits:

  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 Apr 9 '17 at 18:23
0
+100

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 Apr 9 '17 at 18:23
  • @NathanielDSouza Not natively in Android, but there could be some 3rd-party apps that attempt to do this. – Chahk Apr 10 '17 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.