Xamarin Android Player : Camera error Cant connect to Camera

不羁的心 提交于 2019-12-13 01:24:56

问题


I am trying to use the camera capability in my xamarin android app using the below code.

Intent intent = new Intent(MediaStore.ActionImageCapture);
StartActivityForResult(intent, 0);

I have enabled camera in the Android Manifest and followed all that is mentioned in this tutorial.

However on running the code I get this error Camera Error : Cant connect to the Camera.

Also I get the same error when opening the standard camera app in the emulator

I tried out enabling camera using this link & variations of it, but no luck

Finally I noticed this on www.xamarin.com/android-player,

"Use your computer’s webcam to simulate a back and front-facing camera on your device. (Coming soon)"

So my question is does xamarin android player support using camera, if yes how do I fix this issue to see emulated camera if not my pc webcam ?

AVD - android 4.4.2 - API 19


回答1:


I use Xamarin and just faced the same problem, when I was following this same tutorial.

I fixed it by going to Tools > Google Emulator Manager, then selected the device I was emulating and then clicked "Edit...".

In the new window Edit Android Virtual Device (AVD) I went to hardware section at the bottom and changed 'Configures Camera facing front' option to "Emulated".

It worked for me so I thought I should post here in case that helps.



来源:https://stackoverflow.com/questions/36810278/xamarin-android-player-camera-error-cant-connect-to-camera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!