#Can I use camerakit-sample-simple with usb camera?
9 messages · Page 1 of 1 (latest)
Hey Mandya! Yes you can use an external camera, is this attached to your mobile device?
Yes on running Camera Kit on an Android box, but you may have varying performance depending on hardware.
Hi @Dipo ,
I tried external camera for android simulator like bluestack ,Nox and android studio emulator, I get this error:
com.snap.camerakit.support.widget.CameraLayout$Failure$DeviceNotSupported: CameraKit is not supported on this device
In camerakit-sample-simple project I update the manifest file add some permissions But I get same error in device as well.
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.INFO" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
</intent-filter>
Can brief me regarding this?
For Android box can I need changes in existing sample project for detecting camera? Or it will detect a camera that attached to android box?
@noble kite
Camera Kit is not officially supported on the 3rd party emulators, but should work within Android Studio.
What OS are you using for development?
Also Whats the Android box you're considering? Some cameras may be auto seleteced, but you may have to make a minor change to select the external camera via the CameraFilter in the ImageProcessorSource
@Dipo
I used windows for development.
In android studio camera not detected in camera feed only some pixelated greenish patch visible.
While run on android emulator I get error :
1.E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
2.E/Catalyst: No OpenCL library found. Error code -12001
D/CameraStateRegistry: Recalculating open cameras:
Camera State
-------------------------------------------------------------------
Camera@c7801fa[id=1] OPEN
Camera@c6b7add[id=10] UNKNOWN
-------------------------------------------------------------------
Open count: 1 (Max allowed: 1)
D/CameraStateMachine: New public camera state CameraState{type=OPEN, error=null} from OPEN and null
How can fixed this ?
@noble kite If you want to use a webcam/external, You can change the camera settings for the Device emulator and set it to webcam0
Open Device Manager:
Add/Edit Device (3 dots):
Click Advanced Settings in the bottom of the screen:
Set your camera of choice as the front/back cameras to webcam0 <-------
Your crash is most likely due to using an emulator that is not supported by camera kit. Which one are you using?
@glacial dock
Yes, my emulator front/back camera set for webcam0 , still I get the same error.
I used android studio emulator Pixel 6 API 35