I have a service running in which I implement "Location Listener", basically i create my LocationManager like this:
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER,1000*2,0, this);
and i try to make a string on my onLocationChanged(Location location)
like this:
route = String.valueOf(location.getLatitude()) + "," + String.valueOf(location.getLongitude());
The problem is that unless i wait a lot of time my Listener won't get the location updates, because gps_provider takes its time to get ready.
I have all the permissions in the manifest for this feature, and i ask for gps to be enabled before starting this service.
Is there any option for making my app wait until the gps is ready?
I want my app to wait until the GPS is ready to give locations, just to tell the user that he/she must wait until that moment to start.