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
-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

Distance calculation error by using GPS even though phone is on high accuracy

I am having issues in calculation of distance in KM for one of my app P-Cab. For driver application, I put pickup location and then driver starts driving the car. And based on the "KM" travelled, user is charged taxi fare. For best results I am…
Sandip Singh
  • 17
  • 11
-1
votes
1 answer

Implement GPS Navigation in Android Application while moving user

Actually, I want to Add GPS navigation Which shows the direction while User will move with locations in android application, but no source found and I am new to this topic, Please Give me some suggestion or hint for this task, how to use in the…
mittal3795
  • 35
  • 1
  • 1
  • 12
-1
votes
1 answer

Simple code to get GPS coordinates in android marshmallow

i am developing an android app that targets marshmallow. i did enough searching but could not get a simple code to get GPS coordinates. i wanted a code that could give me GPS coordinates over some intervals. like for eg. every 10 mins i need to…
-1
votes
2 answers

Getting error on button click to fetch location

The error I get is as follows Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference Please tell me where I'm going wrong Activity onCreate function protected…
Dhruv Paul
  • 37
  • 10
-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
-1
votes
1 answer

Mark multi location in database and compare distance them using GoogleMap?

I have hybrid app (Ionic 1) and contains some locations in my database , i want to check some locations near this my positons now ( GPS ) radius < 10km .help me solution to solve it ? using Google Map ?
-1
votes
1 answer

Get Location updates from GPS only, not from Network

I need accurate location updates. When using FusedLocationServices from GooglePlayServices, even if I set HighAccuracy, it will get locations from Wi-Fi and cellular when GPS is not available. How do I request locations ONLY from GPS, and with no…
f.khantsis
  • 3,256
  • 5
  • 50
  • 67
-1
votes
1 answer

Android onLocationChanged does not called

I am trying to implement a background GPS location service in android using Service and LocationListener. The service is started (-> the onCreate and onStartCommand methods are called), but the onLocationChanged method never called. Here is the code…
-1
votes
1 answer

ANDROID - Google Maps - Cannot "Return Location;" after If Statment

when my location is null my application force closes. I'm certain it's because the location returns null. I tried using the code with Mock GPS and the code works when it passes through the "if (myLocation != null)". I just can't "return myLocation;"…
-1
votes
1 answer

Get the current location as google maps url when the button is pressed

This the code I used to send the link to others in same chat application when the button is pressed. How can I get the current location as google maps url in same chat app when the button is pressed? TextView link = (TextView)…
-1
votes
2 answers

Is it possible to use anonymous locations data from the maps app?

After much researching, I have not found an answer to my question. Which is, is it possible to use anonymous geolocation data from google or google maps to determine a users location who don't have my app installed. My end goal is to determine…
Moussa Harajli
  • 1,486
  • 5
  • 22
  • 36
-1
votes
2 answers

LocationManager returns null

I'm using GPS to get my location in an android app. But when I create a LocationManager it returns null pointer exception. Even though the permissions are set on the androidMainFest.xml and also for the app, still it returns the following exception.…
-1
votes
2 answers

How can I get accurate latitude/longitude of current GPS location?

I am using GPS Tracker class and I want to get an accurate current location. But every time, I am getting a different location (20-meter accuracy). GPS Tracker Class: http://eclatsol.net/GPSTracker.java Code : gpsTracker = new…
Pratik Bhalodiya
  • 736
  • 7
  • 14