Skip to content

This is android floating camera view service application.

Notifications You must be signed in to change notification settings

panda919/AndroidCamviewApp

Repository files navigation

#AndroidCamviewApp This is android floating camera view service application.

Camera surface view is showing on Android Home screen as service.

- [Features](#features)

Features

-Camera Service (FloatingCamera_Back,FloatingCamera_Front)
-Camera SurfaceView(SurfaceView,PreviewSelfie)

Getting started

You need to start  **FloatingCamera_Back**Service.
    Intent s = new Intent(MainActivity.this, FloatingCamera_Back.class);
        s.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startService(s);

Important

-FloatingCamera_Back,FloatingCamera_Front as camera service
    Camera mCamera;
    Preview mPreview;
    mCamera = getCameraInstance();
    mPreview = new Preview(this, mCamera);
    FrameLayout preview = (FrameLayout) vG.findViewById(R.id.previewFrame);
    preview.addView(mPreview);
-Preview,PreviewSelfie as Camera SurfaceView
	 private static int getCameraDisplayOrientation(int displayRotation, int cameraId) {
        Log.d(TAG, "getCameraDisplayOrientation");
        CameraInfo info = new Camera.CameraInfo();
        Camera.getCameraInfo(cameraId, info);

        int result;
        if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
            result = (info.orientation + displayRotation) % 360;
            result = (360 - result) % 360;  // compensate the mirror
        } else {  // back-facing
            result = (info.orientation - displayRotation + 360) % 360;
        }
        return result;
    }

Dependencies

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'

About

This is android floating camera view service application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages