How to get GPS data from Android phone?

折月煮酒 提交于 2019-12-20 20:00:08

问题


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.


回答1:


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




回答2:


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




回答3:


Use Blue-NMEA http://max.kellermann.name/projects/blue-nmea/ on your android to send GPS NMEA data on bluetooth or on a local tcp server which can be accessed on PC by usb tethering or on WI-FI connection. use VSPE (virtual serial port emulator) by eterlogic http://www.eterlogic.com/Products.VSPE.html (look for ur version of windows) and redirect data from tcp port to a com port of your choice and u r done with the settings. now configure 'google earth' ,'see you', 'GPSdata logger' or any other soft to listen to this com port which oftenly they will do by themselves.




回答4:


http://max.kellermann.name/projects/blue-nmea/

sends nmea via bt com port or on a tcp port. make sure you read the readme to avoid common obstacles.




回答5:


This is really late, but I have an old LG-P350 and on device manager it shows an NMEA interface. I don't really know how to use it though.



来源:https://stackoverflow.com/questions/5501719/how-to-get-gps-data-from-android-phone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!