Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify what happens to the Dart VM #17

Open
Timmmm opened this issue Feb 13, 2021 · 0 comments
Open

Clarify what happens to the Dart VM #17

Timmmm opened this issue Feb 13, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@Timmmm
Copy link
Contributor

Timmmm commented Feb 13, 2021

Great project. Was very easy to integrate into my app. The only think I'm unsure about is exactly how it affects app behaviour. As I understand it, without doing anything on Android your app can just be killed at any point, including when the phone is idle, when it's low on memory, or when the user swipes the app away.

If I enable background execution what exactly happens? It seems like you don't get any additional processes / isolates. I guess it just signals Android not to kill the app in more circumstances (but not all?).

Basically I'd really like a comment like this:

By default, Android will kill all apps in response to certain events:

  1. The system is low on memory and the app is not in the foreground.
  2. When the user swipes it away.
  3. ???

It will also suspend the entire system and therefore pause execution of apps under these circumstances:

  1. ???

When you enable background execution using this library it affects Android's killing/suspend behaviour in the following ways:

  1. It acquires a wakelock (does it?), so the system never sleeps. This affects battery life which is why a permission dialog is shown to disable battery optimisations.
  2. It creates a "foreground service" (which requires a notification to be shown). This prevents Android from killing the app when the system is low on memory, but it will still be killed if the user swipes it away.

(I have no idea how much of that is true, hence why it would be great to document it thoroughly!)

Thanks for the project anyway - it's very easy to use!

@JulianAssmann JulianAssmann added the documentation Improvements or additions to documentation label Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants