I have an app using the GPS data, I am using
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
is there a best practice for using this services. Say if some app already have invoked this I can use the same GPS data instead of invoking the service again.
How can I do this ?
Happy coding
Your question doesn’t make any sense as the
NotificationManagerhas nothing to do with GPS and/or GPS data.Two answer the second part: You can’t reuse the GPS data of another app, you can only ask for the last known location and hope that this will not be null. If it is null, you should get the position by yourself by using the
LocationManagerand not theNotificationManager.