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

Improve work with PeriodicUpdates #114

Open
menion opened this issue Jun 7, 2019 · 0 comments
Open

Improve work with PeriodicUpdates #114

menion opened this issue Jun 7, 2019 · 0 comments

Comments

@menion
Copy link

menion commented Jun 7, 2019

Currently, add-on has registered a receiver for UpdateContainers
https://github.com/arcao/Geocaching4Locus/blob/master/app/src/main/AndroidManifest.xml#L49

This receiver is enabled by default so Locus Map keeps service that sends containers alive and periodically sends data to add-on even if they are not needed (so in the notification bar is still visible "Connect with add-ons" notification).

Consider ser receiver disabled by default (like in API sample: https://github.com/asamm/locus-api/blob/master/locus-api-android-sample/src/main/AndroidManifest.xml#L99 ) and enable it only when needed because of the active live map. To do it, use ActionTools.enablePeriodicUpdatesReceiver API method and similar to disable it use ActionTools.disablePeriodicUpdatesReceiver.


You may also consider skip "PeriodicUpdates" system completely (it is also deprecated in recent API version) and obtain UpdateContainers manually in own defined interval.

For this exists method ActionBasics.getUpdateContainer(). Keep in mind that updated container does not generate more often then once per 500ms, so higher request frequency has no effect.

Advantage: higher control of frequency, no need to run service in Locus Map and no need to enable "Connect with add-ons" in Locus Map settings!

Thanks for consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants