Questions tagged [android-gps]

Android's GPS device and related API features.

Android provides a Location and Sensors API for programmatical access to its GPS device.

733 questions
5
votes
0 answers

android.location.PROVIDERS_CHANGED is triggered more than once on GPS/Location being manually switched on device

I have gone trough several resources which deal with this problem, but none with a satisfactory explanation or solution. Some of the content I have gone through are: Broadcast receiver called 2 times when turning off GPS? My BroadcastReceiver is…
mang4521
  • 742
  • 6
  • 22
5
votes
3 answers

Wrong date returned from Location.getTime after 6 April 2019 (week number rollover)

I have a rooted phone Samsung N7100 (kitkat 4.4.2). After 6 April 2019 I started getting locations with date of 1999 year. Sometimes locations come with a date of 2019, but after that the device stops receiving any locations. Only the adb comand…
Gallyamov
  • 162
  • 2
  • 9
5
votes
1 answer

RoboScript not able click Enable Location OK button in Firebase Testlab

I am trying to test an Google Map based Android app using RoboScript on Firebase TestLab. By default location is disabled on TestLab devices. To enable them we need to simulate a click on OK button on the system prompt. But this click never happens.…
5
votes
2 answers

How to display current location blue point without setMyLocationEnabled true?

I am using google map V2 and i need to display custom image button click to get current location with blue point and no display to setMyLocationEnabled button. And already false this method but current location is display but blue point is not…
Najib.Nj
  • 3,706
  • 1
  • 25
  • 39
5
votes
1 answer

Getting Location Updates based on time interval or Displacement

I am using Fused Location Api to get location updates. When I set x seconds as time interval then I got onLocationChanged() called after every x seconds. And when I set 10 meter as minimumDisplacement then onLocationChanged() is not called until…
Karan Nagpal
  • 521
  • 1
  • 8
  • 19
5
votes
1 answer

GPS locations tracking in background on android 7

I have app for android that needs to send on regular intervals (let's say every 10 s) an location update to the server. So far nothing special. However this is done completely in the background as an service. This app uses LocationManager to…
Kristian
  • 61
  • 1
  • 8
5
votes
1 answer

Android, get the location when the screen is off

I use a started service with the fused api, and implement the location listener directly on it. The Location keeps updating even when the screen is locked, But it stops if the screen goes off. So, is there any way to make sure that the location will…
a fair player
  • 11,530
  • 9
  • 46
  • 48
5
votes
1 answer

How can I extrapolate farther along a road?

Given realtime location data of a moving device over a short period of time, how can I get a lat/long pair further along this road, say, 2 miles, or even better, 5 minutes worth of driving? I see that I can use Google's Roads API to snap to a road…
4
votes
0 answers

Why is WatchPositionAsync running only once?

When I apply the code below, watchPositionAsync works only once on both the real device and the emulator (ios simulator runs according to timeInterval, but real ios device runs it once.). How can I make the timeInterval obey and run every 1000ms?…
OyeeRatio
  • 205
  • 3
  • 13
4
votes
1 answer

How does FusedLocationProviderClient.getCurrentLocation work? CancellationToken

I'm trying to request the current location, and if the task goes wrong, call if location is on. private void getCurrentLocation() { fusedClient.getCurrentLocation(LocationRequest.PRIORITY_HIGH_ACCURACY, new CancellationToken() { …
4
votes
1 answer

Android get Location in app widget - locationManager seems to stop working after a while

TL:DR; Short Story An App Widget, in the home screen, fails to get a GPS position from an IntentService that uses LocationManager::getLastKnownLocation because after a while that the App is in the background or loses focus, the Location returned is…
4
votes
0 answers

Android Studio emulator first transfers to Googleplex (Mountain View) location in Google Maps

I have an application where I set current location (using Google Maps). Every time I open Google Maps inside the application in Android Studio emulator, it sets location to Googleplex, Mountain View (latitude = 37.4220186, longitude = -122.0839727).…
CoolMind
  • 26,736
  • 15
  • 188
  • 224
4
votes
0 answers

Android 10 GPS Pings in Background

With existing mobile tracking implementation we were getting logistic user's location (co-ordinates,speed etc.) using Android locationManager background service. This implementation was working fine till Android OS 9(Pie). But with OS 10(Q) upgrade,…
4
votes
0 answers

android Gps Alert status

I am checking in GPS status (is it active or passive) on My application,When Gps is closed, Alert Prompt Dialog opens and it asked "for a better experience turn on device location which uses google's location service" and When I click No Thanks or…
Diego
  • 937
  • 8
  • 24
4
votes
3 answers

Android Geolocation working in emulator but not working in phone

I made a simple app with geolocation that displays current location of the user in text views, like latitude, longitude and with Geocoder cityname countryname postal-code, etc. Everything works perfectly in the emulator but for some reason the…
Shantanu Bedajna
  • 559
  • 10
  • 34
1 2
3
48 49