Questions tagged [locationmanager]

The LocationManager class in Android provides access to the system location services. These services allow applications to obtain periodic updates of the device's geographical location, or to fire an application-specified Intent when the device enters the proximity of a given geographical location.

The LocationManager class in Android SDK provides access to the system location services. These services allow applications to obtain periodic updates of the device's geographical location, or to fire an application-specified Intent when the device enters the proximity of a given geographical location.

1041 questions
13
votes
4 answers

Android GPS Location Speed Unreliable

Writing a GPS logging application~ I'm finding the values returned by the getSpeed() method on Locations reported by LocationManager are massively unreliable. I'm using LocationManager.GPS_PROVIDER, filtering the Locations provided through…
Dan Wray
  • 679
  • 1
  • 5
  • 17
13
votes
1 answer

isProviderEnabled(LocationManager.NETWORK_PROVIDER) return false

I am using NETWORK_PROVIDER to get latitude and longitude of the place. I'v already check the setting in the "location & security" and enable "use wireless networks". But "isProviderEnabled(LocationManager.NETWORK_PROVIDER)" always return false.…
shell
  • 131
  • 1
  • 1
  • 3
11
votes
1 answer

onLocationChanged is not called automatically

I have a problem with onLocationChanged event in Android. Here's the triggering: case R.id.start: { Points.add(overlay.getMyLocation()); // Points' type is ArrayList mgr.requestLocationUpdates(best, 0, 3, locationListener); } …
11
votes
1 answer

Check if user has enabled GPS after prompted

Plain and simple. I start an Activity and check if the phone has the GPS module enabled or not. If it isn't enabled, I prompt the user with a dialog and ask if he wants to manually enable it. On Yes I activate the Settings for Location. Now the user…
Alin
  • 13,513
  • 36
  • 111
  • 198
11
votes
2 answers

kotlin coroutine throws java.lang.IllegalStateException: Already resumed, but got value Location

I'm quite new to Kotlin coroutine and Android development in general. While playing around to understand how it worked, I faced an error I can't seem to solve. From a basic activity i try to connect to the googleApiClient. The permissions are ok. I…
Shinmen
  • 111
  • 1
  • 4
11
votes
2 answers

Android LocationManager.isProviderEnabled() always returns false

I have an application that uses a Network provider for its location. Every time the apps starts it checks to see whether the Network provider is enabled using isProviderEnabled() method in LocationManager. If it returns false I present an alert to…
naqi
  • 111
  • 1
  • 4
10
votes
2 answers

What is the meaning of android.location.LocationManager.PASSIVE_PROVIDER?

I understand the meaning of GPS_PROVIDER (locations come from GPS signals) and NETWORK_PROVIDER (locations are determined from cell towers and wireless access points), but I don't understand the meaning of PASSIVE_PROVIDER, despite the definition in…
Ellen Spertus
  • 5,875
  • 9
  • 47
  • 82
10
votes
4 answers

java.lang.SecurityException: invalid package name: com.google.android.gms

I've got this weird stack trace while testing the app on Samsung Galaxy S2 (GT-i9100), Android version 4.3. If it helps, Bugsense reports also "log data" = {u'ms_from_start': u'19915', u'rooted': u'true'} , so I'm not quite sure if this device is…
marko.petrovic
  • 154
  • 2
  • 8
10
votes
2 answers

Should I use android LocationManager.getBestProvider every time I ask for location updates?

I'm using Google APIs and the MapActivity, MapView etc.. When I need to get my current location I use this code the FIRST TIME : myLocationManager =(LocationManager)getSystemService(Context.LOCATION_SERVICE); // Sets the criteria for a fine and low…
Or Kazaz
  • 501
  • 1
  • 9
  • 15
9
votes
3 answers

Android location manager permissions to be used

I have the following code in my android project: locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); Criteria criteria = new Criteria(); bestProvider = locationManager.getBestProvider(criteria, false); Location currentLocation =…
Brahadeesh
  • 2,207
  • 8
  • 37
  • 57
9
votes
4 answers

LocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER) is not reliable, why?

One user of my app reported that app tells network for location is off even he did turn it on. He sent me few screen shots and they made me think; LocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER) is not working properly. His…
Tomcat
  • 1,375
  • 3
  • 20
  • 35
9
votes
3 answers

onLocationChanged always returns I old location

I have registered my LocationManager for location updates, every 10 seconds mgr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 10 * 1000, 50, this); But the onLocationChanged callback returns a location every 10 secs, which(the location)…
Archie.bpgc
  • 22,633
  • 38
  • 142
  • 219
9
votes
4 answers

Get current location during app launch

Good Day! I am working on an android app which monitors user location. I am using LocationManager to get users location, using the following method public void onLocationChanged(Location theLocation) {} Through the above method, whenever there was…
user915303
8
votes
2 answers

Why isn't Android's onProviderEnabled() method being called?

My Android app has two location listeners, one for fine and one for coarse listening. I want to be able to detect when the user turns their location services off and on. Whenever I turn my phones GPS or network location services OFF the…
Mel
  • 5,778
  • 9
  • 47
  • 68
8
votes
2 answers

iOS periodic background location updates which depends not only on significant location change

I have an app which must report user location even if it backgrounded or even killed (terminated). The issue is that the app should report the location not rare than 1 hour interval. I'm using significant location change (SLC) to track all…
Alexey Strakh
  • 10,508
  • 17
  • 76
  • 146
1
2
3
69 70