Setting up the camera and an image picker 

In the .CameraActivity, we will use the camera module from the CameraKit library found at the following link: https://github.com/CameraKit/camerakit-android.

To start capturing the image, we will start by initializing the CameraView object:

myCamera = findViewById(R.id.camera);myCamera.setPermissions(CameraKit.Constants.PERMISSIONS_PICTURE);myCamera.setMethod(CameraKit.Constants.METHOD_STILL);myCamera.setJpegQuality(70);myCamera.setCropOutput(true);

When you snap the picture using the camera, the callback method will initiate the style transition:

findViewById(R.id.picture).setOnClickListener(new View.OnClickListener() {    @Override    public void onClick(View v) {        captureStartTime = System.currentTimeMillis ...

Get Machine Learning Projects for Mobile Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.