Questions tagged [android-location]

android-location refers to the location API provided by the Android framework.

References

1355 questions
8
votes
1 answer

Getting location offline

I want to get the value of Longitude and Latitude of my current locatoin when offline and save the current location to its database. Is it possible to get the longitude and latitude of the device when mobile data and wifi are off but the GPS is ON?
user8787542
8
votes
3 answers

Fetch accurate intermediate Location points in background and calculate Distance of Starting and ending locations in Android

There may be similar questions regarding this topic,But I need your thoughts and suggestions on some specific requirement. Here is my need - We are developing one app which tracks User's trip. The app will start collecting the location of that user…
8
votes
1 answer

Android onLocationChanged location.getTime() returns wrong time

I have a Samsung Galaxy Tab A. I have implemented android.location.LocationListener and onLocationChanged(Location location) gets called and it gives me kinda right longitude and latitude but, The problem is: location.getTime() gives me wrong time,…
M D P
  • 4,525
  • 2
  • 23
  • 35
8
votes
4 answers

Is Fused Location Provider good choice?

I am developing an application where I want to use Fused Location Provider. But I have some doubts, and couple of questions. When GPS is off and I set priority to HIGH, does that mean that the GPS will be automatically turned on, or not? Can I set…
user6450105
8
votes
3 answers

Android Google Places API - PlaceAutocompleteFragment clear button listener

I am using Google Places API for Android - PlaceAutocompleteFragment API in my project to search locations, when user selects a location then get the records using location lat-long and display it to ListView. Now the problem is whenever user…
8
votes
4 answers

Location Manager remove updates permission

I am using android studio and compileSdkVersion is 23 in that i am using below code if(locationManager != null){ locationManager.removeUpdates(GPSListener.this); } to stop gps update where GPS Listener is a class which…
Madhukar Hebbar
  • 3,113
  • 5
  • 41
  • 69
8
votes
2 answers

Google Location Services Vs Android Location Services

As we know we have two alternates for making our applicaiton location aware Either we use Google’s Location Services API (part of Google Play services) or we use Androids Location API . The problem I have here is that using the Google's services ,…
Muhammad Ahmed AbuTalib
  • 4,080
  • 4
  • 36
  • 59
8
votes
1 answer

getLastKnownLocation() always return the same location

I'm tring to get the location from the gps/netwrok by best provider but always it's return the same location, also i can see that on google map there is a sign to my right location. please anyone can tell me what i'm doing wrong? My activity is: …
elik_sr
  • 105
  • 2
  • 6
7
votes
5 answers

Location Updates using google play services and FusedLocationProviderClient

I want to get location updates on a "background service" using latest fused location provider client.I don't want to use the location listeners and Google API Client that all are using. I also need to use location settings Api provided by google…
7
votes
2 answers

Geocoder returns an address with zero length

Geocoder was working fine until today. It started to return String with 0 length. Note: This is not a duplicate of Geocoder threads, i used intent service and AsyncTask to get it before starting the thread(and AsyncTask approach was working fine…
Thracian
  • 43,021
  • 16
  • 133
  • 222
7
votes
1 answer

Location Alarm for Android?

When starting my app, several POI coordinates shall be added to the Android System. Some hours later, my app is closed and the user walks close to one of the POI he shall get notified e.g. through a status message. Is this the right approach for my…
7
votes
1 answer

Detect if "Bluetooth scanning" for location is turned on

Since Android M it is possible to scan for Bluetooth devices in the background even if the global location is turned off if you have enabled the Bluetooth scanning option in location settings (see screenshot). In order to scan for BLE devices, the…
7
votes
3 answers

java.lang.IllegalArgumentException: provider doesn't exist: gps

Am using GPS to get the Users Location, In Samsung Galaxy S5(klte) with Android 5.0 shows error like java.lang.IllegalArgumentException: provider doesn't exist: gps but the device have GPS. Can tell Whats the error Exactly denotes like no GPS or Not…
Yugesh
  • 4,030
  • 9
  • 57
  • 97
7
votes
1 answer

GeoFence Not Triggered w/Mock Location

I am trying to test GeoFences for a location aware application. I have gotten as many as 11 consecutive successes, but that is typically followed by dozens of failures. Rebooting the device does not help. Uninstalling/reinstalling does not help. …
Bill Mote
  • 12,644
  • 7
  • 58
  • 82
7
votes
1 answer

CursorAdapter dynamic sorting

I currently use a CursorAdapter with a Loader. The data loaded by the Loader contains a location. I want to order my items from the nearest to the farthest. I already compute the distance to display it, I now need to find a way to dynamicaly sort…