Questions tagged [android-location]

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

References

1355 questions
13
votes
3 answers

Route simulation using GPX on Android

I've asked this question before but still no resolution. Here is what I'm looking for. I am working on a GPS Navigation application on Android. For that I would like to be able to simulate driving on a map. I read that I can achieve it using a GPX…
vkinra
  • 943
  • 1
  • 9
  • 16
13
votes
3 answers

share location with share intent Activity

I need to share location from my app using the share intent activity, I have gone through some examples and know how to implement share intent. However I am stuck at setType. I need my application to share location details as well the users location…
13
votes
1 answer

isProviderEnabled(LocationManager.NETWORK_PROVIDER) return false

I am using NETWORK_PROVIDER to get latitude and longitude of the place. I'v already check the setting in the "location & security" and enable "use wireless networks". But "isProviderEnabled(LocationManager.NETWORK_PROVIDER)" always return false.…
shell
  • 131
  • 1
  • 1
  • 3
12
votes
1 answer

Best Practice to report user location continuously

I'm designing an application where application in server side need to be continuously aware of user location. I'm thinking to create an Android service that run in the background and continuously query user location and send the result to an…
user836026
  • 10,608
  • 15
  • 73
  • 129
12
votes
2 answers

Using GoogleApiClient + LocationServices not updating

I'm just trying to do a simple 'tutorial' app to get my phone's location (to learn how to use it later in some other app) but I'm just not getting anywhere. What I've done Android Developer's tutorial : First of, I followed the tutorial in the…
12
votes
1 answer

PRIORITY_LOW_POWER vs PRIORITY_BALANCED_POWER_ACCURACY for google play service v2

I'm wondering for the fused location, does any of the above use a combination of gps + wifi network together? what is the difference in terms of provider (does any of it uses the gps)? from what i see in the documentation the difference is only…
ericlee
  • 2,703
  • 11
  • 43
  • 68
11
votes
5 answers

Android - How to get estimated drive time from one place to another?

I need to find the estimate drive time from one place to another. I've got latitudes and longitudes for both places but I have no idea how to do that. Is there is any API for that. help thanks.
ZeeShaN AbbAs
  • 1,365
  • 2
  • 15
  • 31
11
votes
1 answer

Unable to start service - Requires ACCESS_MOCK_LOCATION secure setting

I got an exception java.lang.RuntimeException: Unable to start service ... java.lang.SecurityException: Requires ACCESS_MOCK_LOCATION secure setting However I have in Manifest file:
hsz
  • 148,279
  • 62
  • 259
  • 315
11
votes
1 answer

Settings.Secure - LOCATION_MODE deprecated - alternative for writing

According to this the flag Settings.Secure.LOCATION_MODE has been depreacted in API 28. Is there an alternative way to write this setting? (I'm not interested in reading this value, which can be done via LocationManager) The following works on my…
prom85
  • 16,896
  • 17
  • 122
  • 242
11
votes
1 answer

Can DataBinding interfere with localizing an Activity?

TL;DR I have an app that supports a number of languages. One activity isn't being translated despite using all the usual localization methods. It is the only Activity in the app that fully utilizes DataBinding. Full explanation I have an Activity…
11
votes
1 answer

Determine Android phone's proximity to known point while conserving power

I am trying to determine if an Android user has had a close proximity to a list of predetermined locations. I'd like to do this with the least amount of drain on the phone's battery. The two mechanisms I see for accomplishing this are proximity…
ahsteele
  • 26,243
  • 28
  • 134
  • 248
11
votes
1 answer

requestLocationUpdates() in separate Thread

I need requestLocationUpdates() to be in a separate Thread, in order to not have it blocking the rest of my application (it will run most of the time). What is the best way to do it?
idkNothing
  • 111
  • 1
  • 3
11
votes
2 answers

Android Geofencing

I've gone through the tutorial for Geofencing and I have question in mind. Does geofencing require you to continuously monitor the user's location ? Or will the LocationClient to which you add the Geofence automatically trigger when a transition…
Traxex1909
  • 2,650
  • 4
  • 20
  • 25
11
votes
2 answers

distanceBetween() returns inaccurate result?

I use distanceBetween() of Location class to calculate the distance between two points as follows: private float getDistanceInMiles(GeoPoint p1, GeoPoint p2) { double lat1 = ((double)p1.getLatitudeE6()) / 1e6; double lng1 =…
Marcin S.
  • 11,161
  • 6
  • 50
  • 63
10
votes
3 answers

Can localization resources be downloaded in runtime?

I have application with internet access and don't want to store many string.xml files for different languages. What I want: Application contains only one string.xml with english strings. When user launches it - I see user's phone locale, and ask my…
Jin35
  • 8,602
  • 3
  • 32
  • 52