Android device as USB Accessory -


i want connect android device host device. android device work accessory host power bus. application code android looks like:

android manifest

<intent-filter>     <action android:name="android.hardware.usb.action.usb_accessory_attached" /> </intent-filter>   <meta-data android:name="android.hardware.usb.action.usb_accessory_attached"          android:resource="@xml/usb_xml" /> 

the usb xml looks like: usb_xml

 <resources>        <usb-accessory model="google inc" manufacturer="0x2d01" version="2.12.1.0"/>     </resources> 

is mandatory have usb.xml ??

so when trying connected usbdevice details, usb device list null :

usbmanager manager = (usbmanager) getsystemservice(context.usb_service); map<string,usbdevice> devicelist = manager.getdevicelist(); 

again, tried accessory list, usb accessorylist null

usbaccessory[] accessorylist = manager.getaccessorylist(); 

i don't know problem. having hp laptop connected samsung mobile (gellybean(17) > 12 api)., hp laptop host , samsung mobile accesosory

some 1 please me stuck long time.

the iprules of device protecting communication happen. when configured rules properly, communication happening properly.


Comments