Android, like many systems, enables the programmer to specify GUI layouts in XML files. Our Java code can load an entire view, or pieces of it, from these XML files.
Goldgesture has a simple layout that contains only a camera preview, on which we draw some additional graphics using OpenCV. The camera preview is represented by an OpenCV class called JavaCameraView. Let's edit app/src/main/res/layout/activity_camera.xml to fill the layout with a JavaCameraView, using the front-facing camera, as follows:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:opencv="http://schemas.android.com/apk/res-auto"
xmlns:tools...