How to write a app to connect an Android device to a host USB GPS device
I have a standalone GPS enabled data recorder in my car that can function as either a USB host or device. (Its a class 0x00h USB device). I currently开发者_开发知识库 connect to it via a WM 6.5 app running on my Palm Treo 750.
I would like to port my WM 6.5 app to an Android phone. (I don't have a specific Android phone in mind, I would like it to be as generic as possible).
Replicating the GUI is not that difficult, but I am having trouble getting started on the USB communication.
I'd appreciate it if someone could point me towards an example, or the appropriate tutorial.
Thanks
You probably cannot do this without modifying the android installation on the phone or modifying the GPS.
Three methods come to mind:
a) modify the GPS so that in host mode it can talk the android ADB protocol and do something like driver the adb shell or simulate an adb port forward to talk to the appliction on the phone
b) modify the android installation to support an additional usb target capability already supported by the gps, such as emulating a usb-serial converter or emultaing your wm phone.
c) modify the android installation to function as a usb host, and compile in a usb driver for the gps previously tested on a desktop linux
a requires in depth development for the gps, b & c require rooting the phone
oh, one more:
d) Get a usb-target microcontroller board with bluetooth. Plug into the GPS and implement a target interface that the GPS host can talk to. Use serial over bluetooth to talk to the phone.
精彩评论