2016년 12월 10일 토요일

In android emulator, whenever I call camera.TakePicture , the camera app crashes


I'm trying to make a basic app that uses the camera to take a picture and then display the picture taken. However, I am unable to test my app because in the Android emulator, the camera app crashes whenever I have code that calls camera.TakePicture

How do I fix this?

-- 
The android emulator doesn't have a camera to open, so it's not going to work, I guess. Use the companion or package your app and try it on your phone.

-- 
I also cannot find any code to handle this error of the camera crashing and not returning an image like it should. (Don't know how to detect the crash)

Screen.ErrorOccurred and Screen.OtherScreenClosed do not get triggered.

-- 
Thanks for the help. What's companion? 

-- 
I don't own an android phone. What should I do?

--
There's an emulator named Genymotion, which I think let's you configure a webcam as the device camera. Try it.
Also I know BlueStacks let's you use your webcam as the device camera, but you can't test it in real time like an emulator. You will have to create the apk and install it everytime you need to try it.

-- 
Genymotion isn't free but I'll definitely try bluestacks

-- 

댓글 없음:

댓글 쓰기