In this article, we are going to see how we can implement a PDF picker in android studio and get the Uri and Path of the pdf. In this application, we will take permission from the user to Read External Storage and then show the Uri and path of the selected PDF to the user showing that we have successfully picked the PDF. Here is a sample video of what we are going to build in this application. Note that we are going to implement this application using Java language.
Step 1: Create a New Project
If you don’t know how to create a new project in Android Studio then you can refer to How to Create/Start a New Project in Android Studio?
Step 2: Adding storage permission
Follow the path app > manifests > AndroidManifest.xml and paste the following piece of code in it.
Step 3: Working on XML files
Navigate to the app > res > layout > activity_main.xml and add the below code to that file. Below is the code for the activity_main.xml file.