Could somebody give me an instruction, how to use an external camera in android app. My app need to use front/back and external cameras but there is no official external camera API I found some issues about this, but they don't have a full answer on how to implement this functionality and especially for android API 21+ versions. As I understand, Camera2 API supports external camera and I can use this API for displaying preview from usb-camera, but most of devices can not see connected external camera. How can I fix this and how can I get this camera id when receive cameras list
String[] cameraList = manager.getCameraIdList();
About "devices can not see usb-camera" I find a few answers : USB camera can not be connected to Android in general, because Android4.0 USB host function has some problems about isochronous transfer..
http://www.infinitegra.co.jp/en/solution/AndroidUsbCam.htm
and maby camera does not getting power from usb-port
https://stackoverflow.com/a/8986688/5219832
But it is written about the old camera API and I don't know, for example, how to get power from usb-port.
Please give me an answer for correctly working with external camera
The Android platform supports the use of plug-and-play USB cameras (that is, webcams) using the standard Android Camera2 API and the camera HIDL interface.
Android 10 devices do NOT support USB camera connection. Android 10 devices do NOT support UVC(USB Video Class) devices to be connected in the apps with targetSdkVersion API Level 28 and above.
Go to Settings > Applications > Default Applications and delete all entries pertaining to your camera. That should reset the phone to ask you what camera to use for certain processes.
There's no Android-wide support for external USB cameras.
Some manufacturers have built in support for their own Android devices, but there's no guarantee that a particular Android device will support a webcam over the standard camera APIs.
If you need this feature, you'll need to find which devices support it, and how.
Some applications use the Android USB APIs to implement support for webcams, so that any device that supports USB host mode will work for those applications. But that won't make the cameras visible to other applications through the standard APIs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With