Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get GPS data from Android phone?

Tags:

android

gps

gpsd

Is there a method to tether (USB wired) the GPS data from and Android phone to PC? I am using a GPSTether app currently that is based on the gpsd project.

I am loooking for alternatives that give more control and is less buggy than that app. Also, is there another method of doing this without using any third party apps?

I am working on a location aware software project and want to read the GPS data periodically. The GPSTether app does exactly that on a TCP port over telnet.

like image 808
r3st0r3 Avatar asked Mar 31 '11 14:03

r3st0r3


People also ask

Can you get GPS data from a phone?

Use Google Maps to Track Your Location Your Android smartphone has its own Locations settings (go to your Settings app and search for “Location” to access these settings) and Google Maps relies on your phone's settings to know where you are, so you may need to change your settings for Google Maps to work properly.

Can I turn on my location from another device?

You can't remotely enable location services using Google's Find My Device. Location services are there to help deliver the most relevant information to you, like helping your weather apps pinpoint your location so you can get forecasts for your area.


2 Answers

The ideal situation here would be to have a serial port over USB connection between your Android phone and your PC, and to stream NMEA across it from the phone. Unfortunately Android doesn't support USB in such a way natively.

GPSTether is a "hack" using the adb forwarding debug bridge in order to create the link between phone and PC, and then reads the NMEA from the location manager and sends it over the TCP/IP link created by adb forwarding.

If you are finding GPSTether too buggy, you really only have two choices either a) implement a version of GPSTether yourself, or b) come up with a different method for doing this. Both will involve quite a bit of coding.

For b), you might want to consider - writing NMEA to a file on the phone while it is connected to the PC as a USB Mass Storage device, and reading updates to the file from the PC regularly.

Or perhaps you could get a bluetooth dongle for your PC and "tether" the phone to the PC over bluetooth, by creating a bluetooth COM port connection for the GPS using something like the Android app BlueNMEA.

Or you could copy an FTP client program, and write the file to an FTP server on your PC over a WiFi connection (which would allow you to have the phone on the other side of the world from the PC).

like image 128
Keir Finlow-Bates Avatar answered Sep 22 '22 15:09

Keir Finlow-Bates


This can be done using ShareGPS App available in Google Play Market and Franson GPSgate Client. You will have to redirect the android GPS NMEA signal to COM ports using these tools. In addition you will require to download AndroidSDK manager.

For detailed instruction see link below.:

http://sharedroid.jillybunch.com/user.html

like image 23
Murali Muthyalu Avatar answered Sep 24 '22 15:09

Murali Muthyalu