-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Thriving in Android Development Using Kotlin
By :

Now that we know more about CameraX, let’s start integrating it into our app. First, we will need to deal with the camera permissions, providing a way for the user to accept them. Then, we will set up our camera preview and add the camera capture functionality to our code.
There are several ways to check if the camera permissions have been granted, and if not, to request them: we could do this manually or use a library. In this case, we will use the Accompanist library, as we introduced at the beginning of this chapter.
Before requesting any permission at runtime, it’s fundamental to declare the same permissions in the app’s AndroidManifest.xml
file. This declaration informs the Android operating system of the app’s intentions. For the camera permission, you need to add the following line within the <
manifest>
tag:
<uses-permission android...