Android ICS emulator camera

2020-07-02 11:28发布

问题:

I am trying to get a look at the Gallery application in ICS, using the emulator.

So, I launch an AVD and snap a couple of pictures with the Camera then launch the Gallery. When I click any collection in the Gallery, I get an error, "Unfortunately, the camera has stopped". The Gallery application quits.

I've tried this on Mac and Windows. Same thing. Anyone know how to make this work?

回答1:

You need to make sure that your AVD has the camera enabled prior to starting the application. In Eclipse you browse to Window->AVD Manager and just add the camera hardware. While you're in here make sure you add some space to your SD card section as you'll need this to take photos.

Restart your app and you should be away.



回答2:

I had a similar problem; launching the Camera app always ends up with "Unfortunately, the camera has stopped". I was able to fix it by Home -> Menu -> Manage apps -> Camera -> Clear data. I think the camera wanted to start the front-facing camera, but my laptop has only 1 camera, so perhaps that was the issue. But Gallery always crashes, and clearing Camera data doesn't seem to help. __ sol



回答3:

I was having the same problem and solved it by decreasing Abstracted LCD Density in emulator edit options. In the hardware subsection Abstracted LCD Density must be having a higher value(in my case it was 240).So I decreased it to 160 and then the camera starts up with the emulator.

I was using WVGA800 which had a higher value for LCD Density so one can try changing the skin as well to get the desired result.



回答4:

If you don't care what's in the picture you're taking (e.g. you just need ANY picture), a workaround is to disable the camera on your computer (on Windows, you can do this in Device Manager). This way, instead of getting the actual picture from the camera, you will get some "simulation" of it - a green box moving on a checkered background. But, at least you can take a picture of THAT and test your application.

But, if you need to capture a specific thing with the camera (for example, for some image processing), this trick isn't going to help you.