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.

1056 questions
14
votes
4 answers

How to? Listen for Location Setting being turned ON (Android App)

So I've spent the past few weeks working on my Android App and looking into the best way of implementing what I need to do, but still can't quite get it right.. Any/all help is greatly appreciated, as I am still getting the hang of…
Ender87
  • 181
  • 1
  • 2
  • 8
14
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
  • 689
  • 1
  • 5
  • 17
13
votes
6 answers

Get current location name of user without using gps or internet but by using Network_Provider in android

This question is directly related to the same prevailing stackoverflow question at "Android: get current location of user without using gps or internet" where the accepted answer is actually not answering the question. I should be able to get the…
Samitha Chathuranga
  • 1,689
  • 5
  • 30
  • 57
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
12
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); } …
12
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
  • 14,809
  • 40
  • 129
  • 218
11
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
  • 549
  • 1
  • 9
  • 16
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
  • 6,576
  • 9
  • 50
  • 101
10
votes
3 answers

Getting location updates when in doze mode

I'm trying to get location updates in my android app when in doze mode, this used to work up to android 5.x. With android 6 and the advent of doze, no matter what I do, the updates stop at some point. After reading a few articles and stackoverflow…
10
votes
1 answer

Android Location getBearing() always returns 0

I've been trying to implement a feature for my Android app that gets the speed and direction of travel of the device, no matter where the device is pointed at. For example: If my Android device is pointed in the North direction and if I'm moving…
user3171597
  • 447
  • 1
  • 6
  • 17
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
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,245
  • 8
  • 40
  • 58
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,405
  • 3
  • 22
  • 37
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
  • 23,812
  • 38
  • 150
  • 226
1
2
3
70 71