Then on the next boot explain that you detected this, and guide the user to OP's page? Or is it way more complicated than so?
Then on the next boot explain that you detected this, and guide the user to OP's page? Or is it way more complicated than so?
> This app kills apps in the most brutal way we have seen so far among Android vendors.
You can't detect that your application was kill -9'd. I don't think you can detect that "PowerSavingAppG3" is running either (I'd guess it's running as root and you're not), so you can't even infer from its existence that your application will be traumatically killed in short order.
Both would show a last good status and no good exit.
1. Create an empty file when the application launches
2. When the application terminates, write the reason for termination into the file.
3. When the app launches again, read the file. If it was empty, then you were SIGKILL'd, or you crashed.
"Might have been killed, might have crashed" is not helpful, and the inability to know is the very issue at hand here. You can't know whether your application crashed, the user forcefully killed it or you fell afoul a background killer. What now, do you start spamming the user anyway?
You might be able to write the word "bad" in a file, and then clear the file if your app closes nicely. If you start and find the word "bad" in the file, then you know you were killed. A slight variation of what you suggested.
Details outlined here : hackernoon.com/notifications-in-android-are-horribly-broken-b8dbec63f48a
onCreate - check "running" flag, then set to true
onDestroy - set flag to "ended"
If onCreate saw the flag was already "running" before it was set, then you have a crash to recover from or a kill to notify the user about.
The point is that this is entirely Google's fault and yet it's the devs who have to clear up the mess and take the blame, or alternatively we bombard the users with technical fixes and explanations. Quite clearly neither of these options is where we should be with a mature OS on a mass consumer device.
Now I'm getting all angry again just thinking about it. Time to up my meds.
The third party controlling your user's experience is forcibly killing your application while it's in use as intended. This somehow means you are misunderstanding UX?
People are suggesting ways to detect it and teach the user how to stop it, because they have no automated solution to this problem.
What misunderstanding would that be exactly? App developer has to find a way to help customers work around an issue they cannot resolve themselves. Seems reasonable to me.