Skip to content

Improve work with PeriodicUpdates #114

@menion

Description

@menion

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.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions