Jetpack Compose New Photo Picker
What is Coil?
Coil is an open-source image-loading library for Android apps. It simplifies the process of loading images from the internet or local storage into your Android app and provides features such as caching, transformations, and error handling.
Setup
Add the dependency in :app/build.gradle
.
What is a URI?
As its name suggests, URI (Uniform resource identifier) is used to identify resources (whether it be a page of text, a video or sound clip, a still or image, or a program). In order to get the image URI we need to use the rememberLauncherForActivityResult()
, which allows you to get a result from an activity in your composable. In our example, we’re using it to open the photo picker.
What is the PickVisualMediaRequest?
PickVisualMediaRequest
is used to launch a system activity for picking visual media such as images or videos.