As in the Android to emulate a USB device when connected to PC?

I want to write an Android app that when the phone is connected to PC, it was defined as an external GPS receiver.
The HTC phones have the opportunity to work in a mode 3G modem. If after connecting via USB to select "Internet Modem", then the computer will identify it as a network card and use that for Internet access. I want to know is it possible for GPS. I want the information from the GPS module to transfer via USB to PC.
In the documentation there is a story about how in Android you can work with external USB devices or accessories. But that's not what I need.
The forums suggest to use the "Share GPS" or "GPS Over BT". But it is very inconvenient. In the case of the first program it is necessary to connect the phone via USB, start the app on the PC via ADB to do port forwarding (that is required to use the Android SDK), and then through the application Franson GPS Gate to create a virtual com port, which will be transferred to the GPS. It is somehow not very convenient.
Is it possible what I want in Java or using the NDK, or rustovannye phones!
October 3rd 19 at 03:03
2 answers
October 3rd 19 at 03:05
Not being an Android programmer I can advise more simple, in my opinion, the solution: a combination of software for the virtual com port (e.g. www.advancedvirtualcomport.com ), and applications for Android, which will transmit NMEA data over TCP...

You can use any hardware-based solution: a pair of ftdi adapters to link rx to tx on the Android appear com port on the PC too. And to work with com-port in host mode on Android is easy, even Ruth is not needed.
October 3rd 19 at 03:07
Real GPS receiver deals with the fact that text data opredelnie format reports via com-port.

The idea, which was proposed DiverUA fully realizes your objectives. You only need to write Android service, acting as TCP server with virtual com-port to provide data for any programs on your PC.

Find more questions by tags AndroidJavaSatellite navigation