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
9
votes
3 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
  • 6,214
  • 10
  • 54
  • 71
8
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
  • 929
  • 1
  • 15
  • 29
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…
Mando
  • 11,414
  • 17
  • 86
  • 167
8
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
  • 7,114
  • 8
  • 51
  • 75
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,441
  • 3
  • 48
  • 75
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
  • 20,756
  • 32
  • 99
  • 177
7
votes
1 answer

Location Settings Dialog shown twice OR how to detect that dialog is shown\closed

I want to show Location Settings Dialog every time when activity in foreground and Location turned off, in onResume(). The issue: every time will be created new Settings Dialog without destroying previous one and I have stack from dialogues. By back…
Oleksandr B
  • 3,400
  • 1
  • 25
  • 28
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
  • 51,941
  • 35
  • 152
  • 200
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
  • 14,597
  • 18
  • 87
  • 141
7
votes
4 answers

Retrieving # of satellites used in gps fix from Android

I am trying to retrieve the # of satellites used in the GPS fix. I have implemented two different methods, as shown below: package ti.utils; import android.app.Activity; import android.content.Context; import android.location.GpsSatellite; import…
Justin
  • 17,670
  • 38
  • 132
  • 201
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,978
  • 4
  • 34
  • 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,533
  • 3
  • 19
  • 47
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,879
  • 5
  • 36
  • 48
1 2
3
70 71