Android Question Staying alive - or trying to

3fazeac

Member
Licensed User
Longtime User
It sure is a battle to keep apps alive.

I put PartialLock code in the Activity_Resume of Main. I release the PartialLock in Main.Pause - but only if UserClosed is true.

With the PartialLock set, the phone keeps the app running even over night with no interaction. However, every now and again the OS (android, I assume) removes this PartialLock feature from the app and that allows it to kill the app whenever it feels like it. The only way round this is to reinstall the app.

I know when the PartialLock is being maintained because under setting/battery I see my app marked with "May keep system from sleeping". This is what I want. However after a few weeks or so, that message is gone, the app gets killed and the only way to recover is to re-install from the apk file.

Does anyone have any solutions to this problem?
 

3fazeac

Member
Licensed User
Longtime User
This app control feature seems particular to android (may iOS too). A phone or tablet is just a computer and it's annoying that the OS does what it wants. A company computer manager would be horrified if they turned up to work only to find that their UNIX system had decided to shut down the corporate database just because it had been running for a while. I don't know if you have any direct contact with google with all your experience and expertise but it would be nice if we could at least have the option of full control over apps we write ourselves.

In my case, the app is stopped every morning, so I'm not trying to run it continuously. It seems that the OS notices that it *could* run continuously and then strips the lock permission from the app so that when I start it up again, the PartialLock has no effect at all. The only way around this is to reinstall the app from the apk file.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…