Questions tagged [android-location]

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

References

1355 questions
6
votes
1 answer

Android Fused Location Won't Deliver Periodic Updates

I want to get a hard location fix every certain minutes & a soft location fix every certain minutes and if user has moved more then certain meters. I been testing the logic with following piece of code walking (tried it with larger parameters as…
6
votes
1 answer

Samsung Note 2 can't reach onLocationChanged()

It works on most devices except Galaxy Note 2. It connects to Google Client, but can't reach onLocationChanged() that implements LocationListener. Anyone has any idea what it causes and why only on this device? @Override public void…
jean d'arme
  • 4,033
  • 6
  • 35
  • 70
6
votes
2 answers

Get location (coordinates) periodically without dramatically increase battery consumption

I'm developing an Android application; this App needs to send periodically (every 10 minutes) the current position (coordenates) to a web service. But ... I'm a little confused about the more correct way (and friendlier to the device battery) to do…
6
votes
4 answers

Calculating Speed for a navigation app without getSpeed() method

I am developing an app which is more of a time-shift racing between your friends. I need to calculate speed of a moving vehicle, and I don't want to use Location.getSpeed() method. (Explained in detail in the bottom why I don't want to use it) I am…
Aman Alam
  • 11,231
  • 7
  • 46
  • 81
6
votes
1 answer

How to get Location with Wifi in Android?

I Want get location with Wifi and work in Google map, and it's not work for me but Gps is okay and not problem. my code: locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); if (locationManager != null) { boolean gpsIsEnabled…
sr.farzad
  • 665
  • 3
  • 8
  • 23
6
votes
4 answers

Need android activity to wait until GPS location obtained

Sorry for my english. I'm trying to get a single location from GPS to put on global variables latitude, longitude. GPS turns on, but the activity goes on before data is retrieved from GPS. My needs in other words... method getCurrentLocation() must…
user2619546
  • 61
  • 1
  • 1
  • 2
6
votes
3 answers

Android show progress dialog while waiting for location

I'm developing location based app using this example: http://www.androidhive.info/2012/07/android-gps-location-manager-tutorial/ But when I turn on phone, the location isn't available right on that moment. So I would like to show progress dialog…
Karlis
  • 1,501
  • 4
  • 19
  • 31
6
votes
1 answer

Can I run Android GeoFencing entirely within a background service?

I have an app which needs almost no user interaction, but requires Geofences. Can I run this entirely within a background service? There will be an Activity when the service is first run. This Activity will start a service and register a…
Richard Russell
  • 1,105
  • 1
  • 10
  • 19
6
votes
2 answers

How to get current exact location in android without internet connection?

I want to get current exact location coordinates in android. I am able to get the location if mobile is connected to Wifi internet connection and but in other case when I go some where else and no internet connection available then it not giving the…
user1996510
6
votes
2 answers

onLocationChanged only called once, not refreshing

I made a little gps app for some reason onLocationChanged not refreshing, it only run once, on app start. Here is my code: public BackgroundLocationService() { super("myintentservice"); locManager = (LocationManager)…
Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
6
votes
7 answers

Is there is any way to clear the location details which is already captured from android device manually?

I'm developing an android application which deals with location co-ordinates capturing with gps. I'm also getting the location details which is last known(via "locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER"); It works…
SIVAKUMAR.J
  • 4,258
  • 9
  • 45
  • 80
5
votes
2 answers

locationListener doesn't work after 30 seconds on foreground service

I have created a service which finds and then stores the user's coordinates in an SQLite database. public class GPS_Service extends Service { DatabaseHelper myDb; private LocationListener locationListener; private LocationManager…
5
votes
2 answers

SettingsClient.checkSettings always fails with status LocationSettingsStatusCodes.RESOLUTION_REQUIRED

I am using LocationServices in my application. Before using location services I am trying to verify if Location with required settings is ON but the problem I am facing is that SettingsClient.checkSettings always failing. Please see my…
Mustansar Saeed
  • 2,730
  • 2
  • 22
  • 46
5
votes
1 answer

What are the background location limits in Android 8 (Oreo)?

https://developer.android.com/about/versions/oreo/background-location-limits In an effort to reduce power consumption, Android 8.0 (API level 26) limits how frequently background apps can retrieve the user's current location. Apps can receive…
PrashanD
  • 2,643
  • 4
  • 28
  • 58
5
votes
3 answers

How to get location instantly after gps location enable

I am implementing a module which required user latitude and longitude to punch attendance offline. I have implemented GPSTracker class followed this example on the LINK But after enabling GPS location I am punching attendance then this class returns…
Nivrutti Pawar
  • 514
  • 3
  • 17