File Chooser
It’s a Java source code that can be easy integrated into your Android project. How to Integrate 1. Copy all files from app/src/main/res/drawable/ folder and all next files into your project: /app/src/main/java/com/filechooser/app/FileChooser.java /app/src/main/res/values/file_chooser_strings.xml /app/src/main/res/layout/file_chooser.xml /app/src/main/res/layout/file_chooser_item.xml /app/src/main/res/xml/file_provider.xml 2. Add permission into AndroidManifest.xml: <uses-per…
All source code listed on this site is collected from the internet. If any listing infringes your rights, please contact us and we will remove it immediately.
Description
It’s a Java source code that can be easy integrated into your Android project.
How to Integrate
1. Copy all files from app/src/main/res/drawable/ folder and all next files into your project:/app/src/main/java/com/filechooser/app/FileChooser.java /app/src/main/res/values/file_chooser_strings.xml /app/src/main/res/layout/file_chooser.xml /app/src/main/res/layout/file_chooser_item.xml /app/src/main/res/xml/file_provider.xml 2. Add permission into AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 3. Add chooser activity into AndroidManifest.xml:
<activity android:name=".FileChooser" .../> 4. Add provider into AndroidManifest.xml:
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.FileProvider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_provider"/> </provider> 5. Add code to open chooser activity into browse button listener:
Intent intent = new Intent(this, FileChooser.class); intent.putExtra("path", "/storage"); // path to opened folder intent.putExtra("showFiles", true); // show or hide files (true/false) intent.putExtra("returnFile", true); // return file or folder path (true/false) startActivityForResult(intent, CHOOSER_REQUEST_CODE); 6. Add code to get result from chooser activity:
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK && requestCode == CHOOSER_REQUEST_CODE) { String path = data.getStringExtra("path"); // returned path } }
Related products
More digital goods in the same category or with similar tags.
Mobile / Android
Voice typing Speech to text
Mobile / Android
Clean baby care unity source code arcade 3d game
Mobile / Android
Blood Bank Mobile Android Mobile App UI Template
Mobile / Android
MeetMe - Meeting, Webinar, Online Training, Jiomeet, Zoom Clone, Meet Clone
Mobile / Android
Fake Tweet - Post Creator
Mobile / Android
Universal Hotel Booking and Reservation App
Mobile / Android
EJIMA - WhatsApp Clone Chat Groups Video & Audio Call Chatting Social Network App
Mobile / Android
DateShate - Random Chat & Date
File Chooser
After successful payment, you will receive a download link for the source code