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
9
votes
3 answers

how to change the location mode to "high accuracy/battery saving" form it default mode(device only)

I'm trying to implement a google map for getting current location using this tutorial android google map tutorial The problem is ,It is not getting my current location untill I have started my device's google map and grant permission to access…
user7462841
8
votes
2 answers

Getting sub locality null for some lat long?

Below is my code, I am getting null subLocality always .... Geocoder geocoder = new Geocoder(this, Locale.getDefault()); List
addresses = geocoder.getFromLocation(latitude,longitude, 1); String suburb =…
Vishal Vaishnav
  • 3,346
  • 3
  • 26
  • 57
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

onStatusChanged situations

I have some doubts regarding onStatusChanged from LocationListener class. It know it can present three states: AVAILABLE, TEMPORARILY_UNAVAILABLE and OUT_OF_SERVICE Does AVAILABLE gets triggered only when coming out of TEMPORARILY_UNAVAILABLE? Or…
AndroidDev
  • 831
  • 5
  • 17
  • 36
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
7
votes
1 answer

java.lang.IllegalStateException: Fragment no longer exists for key f0: unique id

I am a beginner in android and I am not able to understand why I am getting error. When I am clicking on the home button(Bottom Navigation bar) then I am getting this error. I am using shared preference for saving my value when but when this value…
7
votes
2 answers

GnssStatus.CallBack onSatelliteStatusChanged() not working

I am developing an application that I want to learn about the count of gps satellites. I am using the "onSatelliteStatusChanged" method for this, but it does not work. The piece of code that I use below that you see. Code if (Build.VERSION.SDK_INT…
7
votes
1 answer

How to retrieve the current geolocation synchronously?

Due to the way our app works, I need to synchronously get the users current location. Our current implementation uses the com.google.android.gms.location.LocationListener to receive location updates. Problem is, I need to update the location…
7
votes
0 answers

Context has changed, operation is not possible

My app is using two separate Process. I am having all the Services in one Process and all other component in another Process. When I am trying to get the lastKnownLocation from the LocationManger when an Intent with action is received in public int…
Sanjeet A
  • 5,171
  • 3
  • 23
  • 40
6
votes
3 answers

How to detect if user turned off Location in Settings?

I want to detect if the user turned off the location at runtime. I can check if he turns it on or if the location was turned off by user before the app was started but I can't check if he turned it off after. Code Sample: MapEntity extends…
martin1337
  • 2,384
  • 6
  • 38
  • 85
6
votes
5 answers

Cannot resolve symbol 'LocationRequest' Android project

I'm new on Android programming, I try to use the new Location Service for getting the user position, to do this i follow the official android developer guide but I don't understand why I'm not able to import LocationRequest in my fragment class.…
6
votes
3 answers

Android GPS get current location

I developed a simple Android application and in this simple application I want to get GPS Latitued and Longitued data, it works correctly in my emulator but when I installed on real Android device it does not work. Please help me to solve this…
Gulmuhammad Akbari
  • 1,986
  • 2
  • 13
  • 28
5
votes
2 answers

How to calculate angle beetween current direction and GPS point

I have 2 points (Android Location objects): current location and target location. Also I have a direction (in degrees) of my device. I wanna calculate an angle between target location and direction. How to do it properly? I receiving location from…
Vladislav
  • 142
  • 1
  • 8
5
votes
1 answer

Foreground service for GPS tracking stops working after time

Background: We have an app that does time registration for a group of people. In this example we use a Zebra TC26 (model: TC26BK-11A222-A6) and we clock in multiple people by scanning. Next the app tracks the GPS position of the phone to locate in…
Boeykes
  • 137
  • 2
  • 9
1
2
3
48 49