Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android devices doesn't recognize attached hardware with FTDI chip

I've made an Android application that communicates with custom made hardware over FTDI 230X chip. The application works fine and communicate with attached device. But on some phones/tablets it doesn't work in sense that Android device does not recognize attached device over OTG even phone/tablet have support for OTG. The application is tested on at least 12 different devices with Android version 4.0 to newer. Maybe on half of them application works fine and recognize attached hardware and other half doesn't see attached device.

I'm not able to understand what cause this problem because applicaton is using USB host API. Also I made test with rooted and unrooted devices so it doesn't depend about that.

Does anybody have idea what else I should try or check? Or this problem is something that depends about android device manufacturer in a way that they didn't include driver support for FTDI chips while building OS?

like image 562
Josef Avatar asked May 30 '14 18:05

Josef


1 Answers

Does the application verify that USB Host is supported or not on the phone/tablet? This verification is to be added even after manifesto declaration. The way to verify is through using package manager:

PackageManager pm = getActivity().getPackageManager();
boolean isUSBhost = pm.hasSystemFeature(PackageManager.FEATURE_USB_HOST);

The isUSBhost will be TRUE if the host functionality is supported by the phone/tablet else FALSE. This code can be placed at application startup (i.e activity) and the result can be used to direct the subsequent flow.

like image 108
SunGa Avatar answered Sep 27 '22 18:09

SunGa