Now since CameraDevice class has been replaced by Camera class.......can
somebody please help me to write a code to open a camera and click a picture

I tried this but does not work

Button click = new Button(this);
        click.bringToFront();
        click.setText("Click me");
        click.setOnClickListener(new View.OnClickListener(){
            public void onClick(View v)
            {
                android.hardware.Camera camera = Camera.open();
                camera.setPreviewCallback(new Camera.PreviewCallback()
                {
                    public void onPreviewFrame(byte[] imageBytes, Camera
camera)
                    {
                        System.out.println("In preview");
                    }
                });

                camera.takePicture(null, null, new Camera.PictureCallback()
                {
                    public void onPictureTaken(byte[] imageBytes,Camera
camera)
                    {

                        System.out.println("picture taken");
                        camera.release();
                    }

                });
            }


        });

thanks for the help

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to