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

1,171 views
Skip to first unread message

JellyFish_

unread,
Dec 9, 2016, 2:41:01 PM12/9/16
to mitappinv...@googlegroups.com
Hey everyone,

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?

Thanks!

"The application Camera process (com.android.camera) has stopped unexpectedly. Please try again"

Italo

unread,
Dec 9, 2016, 2:54:57 PM12/9/16
to MIT App Inventor Forum
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.

JellyFish_

unread,
Dec 9, 2016, 3:30:08 PM12/9/16
to MIT App Inventor Forum
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.

JellyFish_

unread,
Dec 9, 2016, 3:32:14 PM12/9/16
to MIT App Inventor Forum
Thanks for the help. What's companion?

Italo

unread,
Dec 9, 2016, 3:40:09 PM12/9/16
to MIT App Inventor Forum

JellyFish_

unread,
Dec 9, 2016, 3:48:34 PM12/9/16
to MIT App Inventor Forum
Oh,

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

Italo

unread,
Dec 9, 2016, 3:56:36 PM12/9/16
to MIT App Inventor Forum
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.

JellyFish_

unread,
Dec 9, 2016, 4:37:31 PM12/9/16
to MIT App Inventor Forum
oh thanks! Genymotion isn't free but I'll definitely try bluestacks
Reply all
Reply to author
Forward
0 new messages