Alex Rivera | Logout

Android Camera Surface View

Asked 2012-05-07T12:26:11.040
12

I am trying to create a surface view for a camera so it renders on the surface whenever is in the view of the camera. At the moment all I can see on my camera view is a black screen view. I have tried to look on Google and here but so far I haven't found what I am looking for. Anyone can suggest me some idea.

Edit
Report

1 Answer

0

Make shure you added the permission :

<uses-permission android:name="android.permission.CAMERA"/>

Also these window properties:

getWindow().setFormat(PixelFormat.TRANSLUCENT);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
                 WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

Post some code if that doesn't work in order to help you

answered 2012-05-07T12:34:03.007

Your Answer