Using the phone camera in the Android app to capture images
When we build an Android app, we need to decide what aspects of the phone hardware and software our app needs access to. Before starting to write any app code, we first need to fill in these access requirements inside the AndroidManifest.xml
file, which is located inside the src/main/
subfolder within the app
folder. Our manifest file [8] looks like the following:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.pytorch.mastering_pytorch_v2_mnist">
...
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
</manifest>
In the initial lines, we specify the name and version of the Android app, and toward...