Questions tagged [android-location]

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

References

1355 questions
-1
votes
1 answer

Android - How do I get location updates in the background in a service

I need to access location in the background when my app is running. I successfully received location updates when my main activity implemented android.location.LocationListener if (ActivityCompat.checkSelfPermission(this,…
David Callanan
  • 5,601
  • 7
  • 63
  • 105
-1
votes
1 answer

Server Switching In Android

"I need to switch Base URL based on a user's Location and change other UI components". I tried throughout the Build Config but I didn't find anything that seems to work.
-1
votes
1 answer

Foreground service for location update in Oreo+ not working

My app requires users to be tracked at regular intervals. this is my location service class intended to provide location updates in the set interval. this code works fine until Nougat but doesn't work from Oreo. this code was working fine a few days…
-1
votes
1 answer

Set a timer for Fused Location provider onLocationChanged

I am using FusedLocationClient for the location. I have noticed that some times it takes too much time for onLocationChanged() to get called because of whatever issues. Is there any good way that i can put a timer on that, for example if i don't get…
-1
votes
2 answers

how geofencing can be more accurate than checking location at regular intervals?

I don't understand how geofencing can be more accurate than checking location at regular intervals (https://codelabs.developers.google.com/codelabs/background-location-updates-android-o/index.html?index=..%2F..%2Findex#6) ? Because let say I m at…
zeus
  • 12,173
  • 9
  • 63
  • 184
-1
votes
3 answers

Can't access location

I'm trying to access the location and display the latitude and longitude in textviews onClick of a button. Here's my code: import android.Manifest; import android.app.Activity; import android.content.Context; import…
Muktadir Khan
  • 148
  • 3
  • 17
-1
votes
1 answer

Continuously send values from Started Service to Activity

I have a Started service called LocationService, which retrieves the location of the device every 3 seconds. I would like these values to be displayed on the UI of the application. To do so I would need to pass values back to the Main Activity. The…
-1
votes
1 answer

How to save location object in firebase without Geofire?

I have no idea how to save location in Firebase without using Geofire. One possible method may be to save only the co-ordinates to Firebase but looking at the location object (of Android), it has so many properties along with the coordinates. How to…
-1
votes
1 answer

How to save polyline path drawn by google map?

Hey friends i am showing the path as user(smartphone) moves from one location to another in my app. I want to store that path till user explicitly clears it . when I close the application the drawn path gets removed from the map. I want to save that…
AkashK
  • 201
  • 1
  • 4
  • 13
-1
votes
2 answers

Toast message shows 0 for both latitude and longitude

I am trying to build an app from here, where the user clicks on a button and get the current latitude and longitude but the problem is that I am getting 0.0 for both latitude and longitude. I have one activity and one service in my application. The…
Pritom Mazumdar
  • 325
  • 5
  • 20
-1
votes
2 answers

how I can turn on gps

I want turn on gps automaticly when my application starts, like another applications. I have the below code: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Taha Sami
  • 1,565
  • 1
  • 16
  • 43
-1
votes
1 answer

How to solve duplicate data items in recyclerview

I get duplicate data items in the recyclerview after the location data has been updated I have tried some such like way NotifyDataSetChanged () and setHasStableIds (true) But still has not succeeded public class FragmentPetaniTerdekat extends…
-1
votes
3 answers

Dynamic url not generated currently for lat and Long android

I have generated Current location value and i am passing it to the URL dynamically. I am getting value of Latitude and 'Longitude' in my Logcat. but dynamic URl for LatLongUrl is not generated…
alka vaghela
  • 805
  • 4
  • 13
  • 33
-1
votes
2 answers

How to find the distance between two location on map i

How to find the distance between two locations on android ecillipse project &php .the project is based on online good transport system .The fare of the carrier needed to be found out so there is a need of finding distance between source &…
-1
votes
1 answer

Why GPS tracker extends Service

For using the android location based services we use the GPS tracker class which extends Service and implements LocationListener interface. What is the use of Service class here ? Is it only for getting the location updates in the background or…
nishith kumar
  • 981
  • 7
  • 20