Open waqarv712 opened 4 years ago
The tracked is based on the android.location.LocationManager
class. So there is no reference on any service of any kind in the library.
I'm not familiar with the WorkManager yet, but if there a chance of the tracked being destroyed after the dowork call ?
in doWork() function you can make BroadcastReceiver.
Intent intent = new Intent(context, LocationBroadcastReceiver.class); context.sendBroadcast(intent);
and call the library functions in BroadcastReceiver
hope it will work .. i have not tried but i have seen in some examples
WorkManager is used for battery-friendly background tasks, and it is the normal and only clean way to run background processes.
If you want to "track" your location, it mainly makes sense to do so in the background. So support for this should be very high priority.
I am using this code:
in the doWrok() function of WorkManager. But this code works in the Service.