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
5
votes
1 answer

requestLocationUpdates does not update on interval in Android

I have the problem that my service which has the LocationListener implemented, receives a GPSupdate every 500ms it seems. No matter what minTime i put in the requestLocationUpdates function. Piece of my code: public class LocationService extends…
Bander
  • 51
  • 1
  • 3
5
votes
1 answer

Android Location LocationListener always call onProviderDisabled

My device: Android 6.0.1 and here is my application setup. compileSdkVersion 24 buildToolsVersion "24.0.1" minSdkVersion 21 targetSdkVersion 24 LocationListener onLocationChanged() is never called. It always call onProviderDisabled(). Here's…
kai hello
  • 135
  • 1
  • 2
  • 13
5
votes
1 answer

Do network location provider need internet to determine location?

Do Android devices need internet when using network provider for location fetching? I see few articles saying it works without internet and few saying it needs internet. I am looking more into how Android internally does location fetching (rather…
Anil VK
  • 108
  • 1
  • 9
5
votes
3 answers

getting geolocation after 20 seconds

i am making an android app using geo-location in android. i am using the location manager for getting the geo-location coordinates. locationManager.requestLocationUpdates(provider, 0, 0, this); Location location =…
Sourbh Gupta
  • 808
  • 7
  • 16
5
votes
2 answers

Geocoder returns empty list on real device

I'm trying to get the country name using NETWORK_PROVIDER, i wrote a method private int getCurrentLocation(Location location) throws IOException { Geocoder geocoder = new Geocoder(this, getResources().getConfiguration().locale); …
user3731910
5
votes
1 answer

Location Manager ProxmityAlert always says entering

I want to alert the user when he is near a particular location. For this I have included a ProxmityAlert and a corresponding service in my app. But no matter what coordinates I give, it always shows me "Thank you for visiting my Area!! entering" Am…
Sparkplug
  • 485
  • 7
  • 21
5
votes
2 answers

How to use Android LocationManager and Listener

I'm not having any luck receiving any data from the GPS using the code below, and i'm not sure what I'm doing wrong, it seems like my code matches everything i see online. i'd like to eventually add this to a background service to log gps…
Need-4-Steve
  • 77
  • 1
  • 1
  • 6
5
votes
3 answers

LocationManager.requestLocationUpdates add or update?

I am looking at LocationManager to get best location for periodical reporting location. I am curious about LocationManager.requestLocationUpdates method. What would it happen if I invoke this method several times with different minTime and…
sunghun
  • 1,424
  • 4
  • 25
  • 49
5
votes
2 answers

LocationManager: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

Normally an error while doing something on the UI thread from another thread I thought, but I don't get what I'm doing wrong. The error seems only to appear when the phone is travelling, so with a changing GPS location. I want the most recent…
Diego
  • 4,011
  • 10
  • 50
  • 76
5
votes
1 answer

Android: Send location data in background periodically (every 30 seconds) and ask server for new data

Scenario: Post to server to get any new data in background every 30 seconds for long period i.e. 12 hours. Location data needs to be sent along with this. Current Implementation; Service Class; Location listener with interval of 30 seconds which…
5
votes
3 answers

android GPS calibration

When moving a big distance, like to another city, with the GPS off, it takes very much time for it, when turned on, to get the first correct point. So if by example I register to the gps provider, it could take up to 10 min until the first…
5
votes
1 answer

How do I stop the user waiting for a long time to get a location fix?

I am building a GPS Android application which gets the nearest places based on the user's current location. This is what my application does: Check if GPS or Network is available If neither is available then don't do anything. Else, we first check…
Johnathan Au
  • 5,244
  • 18
  • 70
  • 128
5
votes
2 answers

Pass Coordinates from locationManager in appDelegate to viewController

I am trying to get the user's coordinates when a viewController appears. I need the location in several viewControllers, so I put the locationManager in the appDelegate. My problem is that on the very first viewDidAppear, the coordinates have not…
Brandon
  • 2,163
  • 6
  • 40
  • 64
5
votes
2 answers

android didUpdateHeading (loacation manager)?

Is there an Android equivalent of didUpdateHeading (from iOS) ? Any sample code to rotate the mapview using it? Searched a lot, but couldn't get a helpful hint. Thanks in advance. Edit: Let me expalain my question: In IOS, when the device changes…
zolio
  • 2,439
  • 4
  • 22
  • 34
4
votes
1 answer

More than one location provider at same time

I have some problems with location systems. I have a service that implements locationlistener. I want to get the best location using network when possible, gps if network is not enough accurate (accuracy greater than 300mt). The problem is this. I…
Rabarama
  • 73
  • 1
  • 5