How to use camera.takepicture in android java app?

Activity Forums Android mobile app How to use camera.takepicture in android java app?

  • This topic is empty.
  • Creator
    Topic
  • #123
    adcocitclass
    Keymaster

    camera.takepicture is used to take picture using android mobile camera

    Following is sample code

    private AutoFocusCallback _pfnAutoFocusCallback = new AutoFocusCallback() {

    @Override
    public void onAutoFocus(boolean success, Camera camera) {
    //camera.autoFocus(null);
    camera.takePicture(_pfnShutterCallback, _pfnRawPictureCallback, mPicture);
    }
    };

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #135
    adcocitclass
    Keymaster

    Error occuring in camera.takepicture anybody has some suggestions for this?

    java.lang.RuntimeException: takePicture failed
    at android.hardware.Camera.native_takePicture(Native Method)
    at android.hardware.Camera.takePicture(Camera.java:1828)
    at android.hardware.Camera.takePicture(Camera.java:1773)
    at com.example.CameraTest$2.onAutoFocus(CameraTest.java:1835)
    at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1273)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5576)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:956)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:751)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.