Questions tagged [android-location]

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

References

1355 questions
-1
votes
2 answers

My Android App Does Not Exist When Pressing Back Button

I have an application where I check if User has GPS and Wireless Location enabled on device or not.If it's not enable then I startActivity to enable them .My code for this is: if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) …
Ansh
  • 2,366
  • 3
  • 31
  • 51
-1
votes
1 answer

User setup activity of android app

I want to create a simple app to upload my location .I have two activities and in first activity the user can input parameters url for upload with editbox , a checkbox if user wish upload location save preferences button and start button for go to…
-2
votes
1 answer

java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLongitude()' on a null object reference

I don't understand why the app closes: java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLongitude()' on a null object reference private void getWeatherInformation() { …
-2
votes
1 answer

requestLocationUpdates 2nd paramater is in km or m

locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, time, distance, locationListener); here time is in milliseconds or second? distance is in km or m?
Midhilaj
  • 4,905
  • 9
  • 45
  • 88
-2
votes
1 answer

Detecting WHEN the Location Setting becomes available (ex: to log it's use time, etc)?

Android-Oreo has essentially broken my App and left me dead in the water.. My Objective: Run in the background, and react when the "Location" setting gets turned ON. I do not need to actually use the Location - I simply need to detect when it…
-2
votes
1 answer

LoactionManager Api19 NullPointerException

maybe somebody can tell my why below code works on Api above 25, but on Api 19 which a right now i'm testing i have null after that i try to get longitude and latitude? I had read official docs but but each method which i used (target Api 25) is…
Armin Orlik
  • 195
  • 2
  • 14
-2
votes
1 answer

Nearst 50 Users from My Location out of thousands of users with location from my app server

My application server having thousands of users with their location(LatLng). I want nearest 50 users from any user's location to be displayed in app? How i can fast filter to get the nearest 50 users(LatLng) from server database? I tried with Sort…
SudP
  • 88
  • 1
  • 7
-2
votes
1 answer

Unable to use the google map map eventhough i got the API key

I have got the API key but still I am unable to open the google map in my project. my requirement is I have to get the current location and nearby hospital details in my app using google map and I want the list of hospitals near to that place in…
Jayasree
  • 21
  • 4
-2
votes
1 answer

Android Getting Current Location NULL with two different code snippets

I am stuck with location with GPS/Network Providers. I know it is a basic question for all androiders but i am having this problem since long time. Actually I am taking current location and inserting in database by following method on click of…
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
-2
votes
1 answer

Sharing location on google Maps

I'm new to android Location API and Maps. I was thinking about making an application which can be used to share location of friends and locate them on Google Maps. There are many kinds of apps which exists in the market like Find My Friends by Apple…
Sid18
  • 23
  • 1
  • 4
-2
votes
1 answer

getSpeed() of Location is not working on WiFi

I want to calculate the speed of user on WiFi. I am getting location updates via. onLocationChanged() but every time hasSpeed() returning false and getSpeed() returning 0.0. Is there any API available to get speed on WiFi or I need to calculate…
abhishek kumar gupta
  • 2,189
  • 6
  • 35
  • 56
-2
votes
1 answer

turn on gps and using it

I have a class for get the user location. If the GPS is off I turned it on and show the location, but it doesnt work. this is the class: public class UseGPS implements Runnable{ Activity activity; Context context; private ProgressDialog…
-2
votes
1 answer

Issue Converting Over To GMaps v2 for Android

I'm trying to convert an old version of this code from GMaps v1.1 to GMaps v2. I am having issues converting the following MapController code: private MapController mMapController; public void setController(Object controller) { /*if( controller…
user268397
  • 1,917
  • 7
  • 38
  • 56
-2
votes
1 answer

Trouble getting GPS position

I am trying to access the GPS position of the users device and seem to be getting nowhere. In my class I have the following code, it checks to see if the GPS Provider is enabled and then attempts to get the users last known location. It recognizes…
matt.
  • 2,355
  • 5
  • 32
  • 43
-3
votes
1 answer

System.currentTimeMillis() gets disturbed when user manually changes time

I am building application which is time sensitive i.e. some tasks need to be completed within certain time. There are multiple ways to get the time i.e. System.currentTimeMillis() and gpsLocation.getTime(). I don't want to use…
Mustansar Saeed
  • 2,730
  • 2
  • 22
  • 46
1 2 3
90
91