How do I get my app to launch automatically when my usb accessory (AOA) is plugged in?
Thus far I added these activity text lines to the manifest.xml
< intent-filter>
< action android:name="android.intent.action.MAIN"/>
< category android:name="android.intent.category.LAUNCHER"/>
< /intent-filter>
< 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/accessory_filter"/>
< /activity>
I also added the proper "accessory_filter.xml" file to the res/xml directory
Now I am not sure of where to go from here.
I imagine I need some code in main activity to tell the app to open when the accessory notification is raised.
Thus far I added these activity text lines to the manifest.xml
< intent-filter>
< action android:name="android.intent.action.MAIN"/>
< category android:name="android.intent.category.LAUNCHER"/>
< /intent-filter>
< 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/accessory_filter"/>
< /activity>
I also added the proper "accessory_filter.xml" file to the res/xml directory
Now I am not sure of where to go from here.
I imagine I need some code in main activity to tell the app to open when the accessory notification is raised.