tags:

views:

30

answers:

2

Hi All,

I have a requirement to Capture the image without showing the Preview.. And i want to do it in the Background as a Service.

Is it possible to do that??

A: 

No, this is not possible. You must show the preview.

CommonsWare
Thanks for the information.. May i know the reason why is it not possible?? Actually the camera preview and capture are independent tasks right???
uday
@uday: "May i know the reason why is it not possible?" -- because Google said so. "Actually the camera preview and capture are independent tasks right?" -- no, they are not. You must show the preview in order to perform an image capture, which means these tasks are not independent.
CommonsWare
Thanks Mark.. I have written one camera application. When i run my application the preview is not showing correctly. It is rotating the Preview. Could u please tell me where im doing wrong..
uday
@uday: Here is a sample camera preview project: http://github.com/commonsguy/cw-advandroid/tree/master/Camera/Preview/
CommonsWare
A: 

Hi Mark, im getting problem when running the camera application in the above page. The Error is :

08-31 19:37:55.081: ERROR/AndroidRuntime(4040): FATAL EXCEPTION: main 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): java.lang.RuntimeException: setParameters failed 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.hardware.Camera.native_setParameters(Native Method) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.hardware.Camera.setParameters(Camera.java:655) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at com.camerapackage.CameraPackage$1.surfaceChanged(CameraPackage.java:74) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.SurfaceView.updateWindow(SurfaceView.java:546) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.View.draw(View.java:6742) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.widget.FrameLayout.draw(FrameLayout.java:352) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.ViewGroup.drawChild(ViewGroup.java:1648) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.View.draw(View.java:6742) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.widget.FrameLayout.draw(FrameLayout.java:352) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1872) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.ViewRoot.draw(ViewRoot.java:1422) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.ViewRoot.performTraversals(ViewRoot.java:1167) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.view.ViewRoot.handleMessage(ViewRoot.java:1744) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.os.Handler.dispatchMessage(Handler.java:99) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.os.Looper.loop(Looper.java:144) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at android.app.ActivityThread.main(ActivityThread.java:4937) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at java.lang.reflect.Method.invokeNative(Native Method) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at java.lang.reflect.Method.invoke(Method.java:521) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 08-31 19:37:55.081: ERROR/AndroidRuntime(4040): at dalvik.system.NativeStart.main(Native Method)

I think the problem is while doing setParamaerts() method..

uday