OnLocationChanged callback is never called

It looks like you setup should work, since it doesn’t, I would make your example as simple as possible in order to troubleshoot. I would make your request look like requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener); This way you get ALL the updates possible. And comment out the part about getting the last … Read more

Android check permission for LocationManager

With Android API level (23), we are required to check for permissions. https://developer.android.com/training/permissions/requesting.html I had your same problem, but the following worked for me and I am able to retrieve Location data successfully: (1) Ensure you have your permissions listed in the Manifest: <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” /> <uses-permission android:name=”android.permission.ACCESS_COARSE_LOCATION”/> (2) Ensure you request permissions from the … Read more

Getting user location every n minutes after app goes to background

To anyone else having a nightmare of a time trying to figure this one out, I have a simple solution. Study the example from raywenderlich.com. The sample code works perfectly, but unfortunately there’s no timer during background location. This will run indefinitely. Add timer by using this code snippet: -(void)applicationDidEnterBackground { [self.locationManager stopUpdatingLocation]; UIApplication* app … Read more

LocationListener of NETWORK_PROVIDER is enabled but , onLocationChanged is never called

i have experienced similar issues with Network provider and only solution was force device restart. Though google map was showing always correct location, because it uses other sensors information also apart from Network location provider. But here is good news, not Long time back Google introduced Fused Location Provider api’s via its Google Play Service … Read more