Re: [OpenCV4Android] OpenCV Tutorial 1 - Add OpenCV on API 8

156 views
Skip to first unread message

Alexander Smorkalov

unread,
Sep 25, 2012, 6:58:23 AM9/25/12
to android...@googlegroups.com
Minimum SDK version for Tutorial 1 is 8. It works on devices with API level 8 even it was built with SDK API 11. It uses else branch on such devices.

    public void setPreview() throws IOException {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            mSf = new SurfaceTexture(10);
            mCamera.setPreviewTexture( mSf );
        }
        else
            mCamera.setPreviewDisplay(null);
    }


Droidkie

unread,
Sep 25, 2012, 10:31:50 AM9/25/12
to android...@googlegroups.com
but it has an error on the SurfaceTexture line because that object didn't exist on API 8 yet. i want to compile Tutorial 1 using API 8, and not API 11 by default.

it also has an error here:
                if (FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
                {
                params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);

Andrey Pavlenko

unread,
Sep 27, 2012, 9:01:31 AM9/27/12
to android...@googlegroups.com
As Alexander stated above, you should build the sample for API 11 target, but if it has MinSdkVersion = 8 in AndroidManifest.xml - it will run on Android 2.2 OK.
Reply all
Reply to author
Forward
0 new messages