Questions tagged [android-location]

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

References

1355 questions
25
votes
1 answer

LocationSettingsRequest returns 0 to onActivityResult even if ok is clicked

I am using following code to show popup to turn on location LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder() .addLocationRequest(mLocationRequest); SettingsClient client =…
24
votes
2 answers

ACCESS_COARSE_LOCATION permission gives a cell tower precision on Android

I am making some tests with the requestLocationUpdates() function from the FusedLocationApi. I am using the PRIORITY_BALANCED_POWER_ACCURACY. A city block precision is fine for me. When I request the ACCESS_FINE_LOCATION permission, I get around a…
poiuytrez
  • 21,330
  • 35
  • 113
  • 172
24
votes
2 answers

LocationManager's getBestProvider returning null

I have a bunch of people reporting an error that I cannot reproduce. When trying to open a MapView it's reporting that the getBestProvider is returning null and I know that means that that no provider is found that fulfills my criteria which is…
tyczj
  • 71,600
  • 54
  • 194
  • 296
23
votes
3 answers

Getting GPS co-ordinates quicker programmatically without internet, but using network provider and mobile GPS

I have referred many questions on this topic, but it seems some of my requirements are missing: I want to get the GPS location at ~0.0001 accuracy Don't want to use internet; Though GSM/CDMA network is ok Should be obtained programmatically when…
iammilind
  • 68,093
  • 33
  • 169
  • 336
21
votes
7 answers

"Allow all the time" location prompt not coming in Android SDK 29

I can't get the "Allow all the time" prompt for location in SDK 29. I already set these permissions in the manifest:
Shailendra Madda
  • 20,649
  • 15
  • 100
  • 138
21
votes
3 answers

Enabling Location mode High Accuracy or Battery saving, programmatically, without user needing to visit Settings

Why i ask this:(also the reason for trying it in an app) It happens when we use Google Maps in Lollipop. Even if the Location is disabled, it is turned on, in high accuracy mode after user's input from the Maps app, without having to visit…
21
votes
3 answers

Comparing two locations using their Longitude and Latitude

Hi i need to cal an event at onchangelocation(), by comparing current latitude and longitude with some saved latitude and longitude but i m getting an error. eclipse is not recognizing key word distance, and for correction error it is giving hint…
user2590541
  • 522
  • 3
  • 7
  • 19
21
votes
1 answer

Set a time-out for android requestSingleUpdate

I am using the routine requestSingleUpdate() reoutine of the android LocationManager library with a LocationListener. The functionality I am trying to implement is that the user can press a button and the app will get their current location and…
AnjoMan
  • 4,838
  • 4
  • 20
  • 28
20
votes
2 answers

Google place picker is not launching on Android Mi phones

I am facing a problem with Google Place Picker in Android Redmi Phones version 5.1.1. I am using the following code for launching the Google Place Picker. try { PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder(); …
19
votes
5 answers

Android: Check if Location Services Enabled using Fused Location Provider

According to the Android documentation: The Google Location Services API, part of Google Play Services, provides a more powerful, high-level framework that automatically handles location providers, user movement, and location accuracy than …
19
votes
2 answers

Google Places API Picker display Only Certain Types of Places

I am making certain android app that requires user to choose a place. I am planning to user google places API.Link: https://developers.google.com/places/android/ This API gives gives nice way to do so through through Place Picker.…
18
votes
2 answers

Dramatic shift in location accuracy distribution starting February 15

I am trying to make sense of an inexplicable situation — starting February 15, a remarkably high percentage of the location readings we captured in our app are reporting exactly 10.0m accuracy, which seems strongly correlated with those arriving…
18
votes
7 answers

How to set the location manually in Android Studio emulator

I have a project in which I need to get the location as India. But in my emulator I am not getting the location. I need to get the location as India when I take the google maps from my emulator, it is showing the current location in middle of the…
17
votes
2 answers

BroadcastReceiver for location

I know BroadcastReceiver watches for text, phone events, etc... but can you run LocationServices as a service and event based on Location? For example, you are near a certain GPS point and the phone notifies you.
ProNeticas
  • 986
  • 3
  • 10
  • 17
17
votes
1 answer

Android LocationRequest: get a callback when request expires

im wonder how to catch event or what ever when my LocationReqest expired, heres code then i call it mLocationRequest = LocationRequest.create(); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); …
Mariusz
  • 1,352
  • 1
  • 16
  • 31
1
2
3
90 91