Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can’t access USB Camera in Android 10

I wrote an application to access USB camera and it works fine in Android 9, but it failed in Android 10. I know that start from Android 9, application needs to grant permission from user on accessing camera as well as USB device in order to access USB camera. I found that in Android 10, application can grant permission in accessing camera, but when try to ask permission to access USB camera by UsbManager.requestPermission(), application received “deny” immediately without any prompt to ask user. Is there any other permissions I needed to ask in Android 10?

like image 663
CM Yau Avatar asked Oct 17 '25 05:10

CM Yau


1 Answers

You can try to change the targetversion to 27, but this is not a good solution. Targetversion will be judged before checking permissions,

like image 93
Xeon Avatar answered Oct 19 '25 22:10

Xeon