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
8
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
  • 417
  • 1
  • 6
  • 16
7
votes
2 answers

Runtime Error--java.lang.IllegalArgumentException: provider=gps

I got this error from the user logs on an android app I created. I have been unable to replicate the error thus far. Any help would be extremely appreciated. The error is: java.lang.IllegalArgumentException: provider=gps at…
Tommy Devoy
  • 13,279
  • 3
  • 46
  • 75
7
votes
3 answers

Issues with "Allow always" location in iOS 13

I've an app which depends on the user's location. Until iOS 13 the app worked correctly but now it doesn' send the user's location. I've tried to choose the option "While using app" and wait to the next prompt in order to choose "Allow always" but…
Juanjo
  • 859
  • 1
  • 13
  • 27
7
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…
7
votes
3 answers

Problem requesting location updates by network

I've created a Service and grabs location data about the user so I can show my users nearby places. I want this Service to track by network in addition to GPS for 2 reasons: 1) GPS may not be enabled. 2) GPS takes quite a bit of time to lock on…
Andrew
  • 19,726
  • 30
  • 93
  • 171
7
votes
5 answers

How does getAltitude() of Android GPS Location Works

HI I tried to implement a simple GPS tracker. Therefore is used lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, this); Then i used the public void…
RoflcoptrException
  • 49,973
  • 34
  • 147
  • 199
7
votes
1 answer

Is there an alternative to Location Client (Google Play API)?

I work on an app that uses location data, and it needs to work in China. Android devices sold here largely don't have Google Play API installed at all and the only way is to root the phone to install it. So I'm stuck with LocationManager which works…
7
votes
3 answers

Unsubscribing a LocationListener from the LocationManager

How do I unsubscribe a LocationListener from recieving updates from the LocationManager? Here is how I'm setting it up mLocationManager = (LocationManager)this.getSystemService(LOCATION_SERVICE); mListener = new LocationListener() { public void…
Greg B
  • 13,819
  • 18
  • 78
  • 132
7
votes
3 answers

Android LocationManager Criteria

I need to receive location changes both from Network and GPS providers. If GPS provider not avaliable or has not location (bad sattelite visibility) I would receive location from Network provider else from GPS provider. Is it possible to select…
Nik
  • 6,525
  • 7
  • 48
  • 73
7
votes
3 answers

GPS icon is still blinking after locationManager.removeUpdates() and by setting locationManager to null

I am developing the Location Tracking application. But i am stopping getting the location update by doing 2 things... locationManager.removeUpdates(this); and setting locationManager reference to null. This will stop getting location co-ordinates…
NullPointerException
  • 3,842
  • 4
  • 29
  • 52
6
votes
1 answer

Starting LocationManager as Service Android

What I'm attempting to do is when receiving a c2dm message, start a service that asks for location for 'x' amount of time and then hands that location off to our server. The c2dm message starts the service correctly, and the GPS location turns on,…
RyanInBinary
  • 1,505
  • 3
  • 19
  • 46
6
votes
1 answer

Why is locationmanager returning old location fixes with new gettime-timestamp?

We have an app that upon user action tries to get a location fix. It listens both on GPS and network and has a time/accuracy based decision matrix to determine when to stop listening and what fix to return. We have noticed, on occasion, a very…
Mathias
  • 3,215
  • 4
  • 28
  • 43
6
votes
1 answer

Assistance data injection into GPS

I am trying to develop an application which uses GPS and I would like to inject XTRA data and time reference to the GPS in order to get a faster fix. My code is the following one: Bundle bundle = new Bundle(); boolean…
dep
  • 61
  • 1
  • 2
6
votes
1 answer

What's location provider "passive"? Seen on HTC Desire with Android 2.2

Before I go into location based mode I check for existence of any location providers by calling List android.location.LocationManager.getProviders(boolean enabledOnly) //enabledOnly = true and checking the size of the resulting list. Now I…
OneWorld
  • 16,782
  • 18
  • 79
  • 130
6
votes
1 answer

Android - Fused Location Provider API issues with satellite information (count, signal, etc)

I am working on a project where we are trying to track the position of a device and keep the data for later use. Before I talk about the issue I would like to provide some background. By searching around StackExchange and Google and everywhere else,…
1 2
3
69 70