Android: USB Communication Android <-> External Device

后端 未结 3 1545
醉梦人生
醉梦人生 2021-02-10 02:55

I found several threads speacking about this subject, but after read them I don\'t have a clear idea about my problem.

We have a external device (something like a tomtom

3条回答
  •  臣服心动
    2021-02-10 03:51

    I'm basically doing the same you are describing. I'm still at the early stages but I've managed such communication under some constraints:

    1. You need a device supporting the USB Host API. The API itself has been around since Android 3.2 or so, but not every device seems to support it. It looks like most of the devices running >4.0 should work, but still is a per device check you should do. I'm currently using an Acer Iconia Tab A510, which so far seems to work but has some glitches: for instance, you cannot charge the device while using the USB port as it is shared with the charger but not compatible with USB.
    2. As Neil says the USB API is low level, so I think you will need a driver for your USB chipset (the one at your side, i.e. in your device). I've been quite lucky here as there's an open source project working on FTDI chipsets that happen to be the ones I've chosen. If that's your case too, you should check the projects:
      • FTDriver: https://github.com/ksksue/FTDriver
      • Android USB Serial Monitor Lite: https://github.com/ksksue/Android-USB-Serial-Monitor-Lite This one has even an app in Google Play, so you can install it and start "playing" ;-)

    I hope this helps. As I've said, I'm starting to work in this ecosystem and I still have to find my way around many "places".

    Cheers, Asier.

提交回复
热议问题