How to use the same Usb accessory for two applications at the same time?

I have an application that uses

<uses-feature
        android:name="android.hardware.usb.accessory"
        android:required="true" />

I want this USB interface to communicate with App1 running in the foreground and App2 running in the background. App2 is running in the background in mine. App1 works in the foreground of third-party developers. I will not have access to App1.
When I tried to do this, whenever one application gets access, another loses connection. Is there a way to make both applications talk to USB at the same time,

+6
source share
1 answer

Try it,

my_accessory_filter.xml res/xml/directory .

  <resources>

<usb-accessory model="CoolAccessory" manufacturer="My App Company" version="1.0"/>

</resources>

, , Android . , , , , .

my_accessory_filter.xml :

<meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
                android:resource="@xml/my_accessory_filter" />

, !

+2

All Articles