There are some cases in which it is necessary to load the camera outside of the lib. We will explain here the main steps that you need to follow to achieve it.
Open or create an XML file to prepare for. In this case, main.xml.
It is necessary to add a SurfaceView object:
- Double-click the xml file.
- Open the Graphical Layout.
- Select Advanced.
- Drag and drop the SurfaceView (colored icon) into the view.
- Press over the view and assign its id. surfaceView , for instance.