Device: OnePlus running android 10
I am experiencing issues with prolonged background app tracking on Android
10. It seems that after a period of time, the app is killed entirely and
the background locations stop coming in.
In build hints, I have android.xpermissions set to:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
/><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
I am starting location tracking like so:
CommonUtil.log("Starting Tracking");
LocationManager.getLocationManager().setLocationListener(new
LocationListenerImpl(), new
LocationRequest(LocationRequest.PRIORITY_MEDIUM_ACCUARCY, 1000 * 60 * 5));
LocationManager.getLocationManager().setBackgroundLocationListener(LocationListenerImpl.class);
I am also starting geofencing like so:
LocationManager.getLocationManager().addGeoFencing(GeofenceListenerImpl.class,
revisedGeofences.get(id));
Upon entering a geofence, I simply increase tracking accuracy
LocationManager.getLocationManager().setLocationListener(new
LocationListenerImpl(), new
LocationRequest(LocationRequest.PRIORITY_HIGH_ACCUARCY, 1000 * 60 * 2));
All of this works fine for the first several hours, and then it suddenly
stops until the app is manually opened. Any thoughts?
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/99b32a00-d82d-403a-bb17-60edd8e8f61f%40googlegroups.com.