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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.