Search code examples
androidpermissionsusbhost

Android USB Host. How do I get permission to use USB devices without displaying a dialog?


I have an Android device without a screen. When connecting the USB device automatically appears the system dialog to permit the use of USB. It is necessary to obtain a permit without using the device's screen.

It is assumed that the device application will be installed in advance, and when the USB device is connected automatically.

How exactly can this be done?


Solution

  • I made by analogy in the topic. Classes for the correct version of SDK took away. I create the necessary packages and copied to the specified and missing classes. The application should be copied into the folder system/priv-app and all earned.