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
2
votes
0 answers

Broadcast gives multiple fires on using PROVIDERS_CHANGED_ACTION - SOLUTION

Hello guys I am using Broadcast Receiver in my project that gives me multiple outputs at one time while enabling and disabling GPS. How to solve that?? Here is a log that will give multiple outputs like this MyBroadcastReceivers﹕ IsGPS =…
Manish
  • 170
  • 9
2
votes
0 answers

Independent/standalone GPS App on Samsung Galaxy Watch 4 still requires phone connection

I need my Wear OS sailing App to provide GPS updates when no phone is connected. Unfortunately despite specifying the App as standalone the GPS updates stop as soon as the Bluetooth link to the phone is lost. The documentation indicates independent…
2
votes
1 answer

How to simulate the driver's movement to check for live tracking

Imagine I am building an app, let's say a pizza delivery app. User Story: As a user, I want to track the movement of the delivery person against the map so that I can be ready to meet them when they are nearby Let's say this app is already built,…
2
votes
0 answers

Android - launch event on wifi detected or "location changed"

To my knowledge android (studio) currently only supports wifi detection and GPS detection with a timer that runs, for example, once a minute and checks the location and currently available wifi signals. I was wondering of there are any more…
Nuubles
  • 165
  • 1
  • 13
2
votes
1 answer

Background service when app is not open or closed

I have a location service that add/updates data in firestore. It is working fine when the app is open, but if I force close the app or switch to another app, the service is no longer working. Im testing this on Realme 3 pro device. Run service even…
2
votes
0 answers

`GPGGA` and `GPRMC` sentences are not received in onNmeaMessage

The Problem I am working on the application which is listening for NMEA messages, to do so I am adding NMEA listener like this locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, TimeUnit.SECONDS.toMillis(1L), 0.0f, …
Viktor Apoyan
  • 10,655
  • 22
  • 85
  • 147
2
votes
1 answer

Which is a better method to check if user's location(android app) is inside a polygon

I am building an android app(Geofencing) wherein I need to check if the user's location is within a given polygon. The application can tolerate some delays in detection but has to be battery efficient. What I am currently doing is as follows - Set…
2
votes
0 answers

Android location only refreshes after opening google maps on Android Emulator

When I open the app it reports the coordinates of the device. Then I change the coordinates using the emulator's menu, close and reopen the app, and the old coordinates still show. After opening Google Maps, for a while the location icon is grey and…
Lucas
  • 668
  • 1
  • 5
  • 17
2
votes
1 answer

Android - How to Calculate Distance Traveled

I am using the FusedLocationProviderClient to get locationUpdates after setting up LocationRequest properties. To calculate 'distance traveled' I thought I would do the following: Location lastLocation; // initialized to start location with…
JJJones_3860
  • 1,382
  • 2
  • 15
  • 35
2
votes
1 answer

How to have inbuilt GPS locker like "GPS Connected" in app?

I would like to have highest precision on my app when I acquire GPS position with Location.getLatitude() Location.getLongitude() and I have found out the GPS has to be running in the background to have highest precision. If anyone knows them, the…
Frederik
  • 33
  • 9
2
votes
0 answers

ANR Input dispatching timed out when get location & address (GPS)

I am trying to get last location and convert it to address using JobIntentService then send the result to UI using ResultReceiver. All working normally except for some specific devices which resulted in ANR. Here is the log from Android…
Selmeny
  • 220
  • 3
  • 11
2
votes
1 answer

GPS Status receiver stopped working 2 weeks ago

I've used this BroadcastReceiver as GPS status receiver to monitor when user turns on/off his Location in top navigation menu. It suddenly stopped working (whole receiver onReceive() method is not called) 2 weeks ago (probably has something to do…
2
votes
0 answers

How can I avoid android.app.RemoteServiceException - Context.startForegroundService() did not then call Service.startForeground()

I am continuing to see a lot of crashes in the wild for this, despite the fact that I am in fact calling startForeground. For reference, my code is below: In my app's main activity onCreate, the very last thing I do is: Intent i = new Intent(c,…
2
votes
5 answers

How can I get my current location in Android using GPS?

I want to get my current location in the form of an address by GPS. I am using the android studio. It is saying that my application stops working. What is the error in it? Can someone help me to get out of this, please? My Code in…
SudeepaNoble
  • 21
  • 1
  • 1
  • 5
2
votes
2 answers

Android: FusedLocationProvider, get location every few seconds

I'm making an app that tracks the user's location and ultimatly uploads it to a Firebase server. I have created a simple app that displays the location when I press a button on screen. The problem is that it doesnt change the location when I press…
Mozy
  • 23
  • 4