开发者

Android - Camera functionality howto

开发者 https://www.devze.com 2022-12-25 12:49 出处:网络
I\'m using the example from the SDK (CameraPreview) and also the example from this site http://marakana.com/forums/android/android_examples/39.html

I'm using the example from the SDK (CameraPreview) and also the example from this site http://marakana.com/forums/android/android_examples/39.html

When I run it, both gives this e开发者_JAVA技巧rror "The application AppName(appname) has stopped unexpectedly. Please try again".

I can't run the debugger either because it's always "Waiting for debugger. Force close". (I have debuggable=true in the manifest file)

The phone I have is a Nexus One.

Running on the emulator gives me the black and white squares with a moving square. (So I assume it works on the emulator?). Even on the emulator it gives me the "stopped unexpectedly" error 50% of the time.

Does anyone know what caused it?

Thanks,

Tee


Ok, my debugger decided to work again now.

Traced it down to this line. camera.setParameters(parameters);
That piece of code somehow killed the app.

Looks like you need to check it by getSupportedPictureSizes first before setting the parameter.(I have yet to try this part tho).


To see what the actual Exception is (plus it's path trace) you need to execute adb logcat.

To run the debugger, you simply wait 'till the "Waiting for debugger. Force close" dialog disappears.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号