You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// use FusedGPSUpdatesProvider for location updatesIGPSUpdatesProvidergpsUpdatesProvider = newFusedGPSUpdatesProvider(context, looper);
// create GPSUpdatesManager with 500 points capacityGPSUpdatesManagergpsUpdatesManager = newGPSUpdatesManager(gpsUpdatesProvider, 500);
// subscribe to filtered GPS updates gpsUpdatesManager.getLast().addListener(gpsUpdate -> {...});
// start GPS updates gpsUpdatesManager.start();
To init and start GPS background service
// this makes service to stop itself if updates has been stoppedGPSUpdatesForegroundService.setUpdatesManager(gpsUpdatesManager);
// Optional notification settingsGPSUpdatesForegroundService.setNotificationChannelId("gps_updates");
GPSUpdatesForegroundService.setNotificationChannelName("GPS Updates");
GPSUpdatesForegroundService.setNotificationId(23);
GPSUpdatesForegroundService.setNotificationContentTitle("Stop tracking");
// start service// due the service is terminating on gpsUpdatesManager stop// it should be started manualy every time gpsUpdatesManager startsGPSUpdatesForegroundService.start(context);