Source link:


Super Lite Android Library to select files/directories from Device Storage.

Developed by

Angad Singh ( @angads25)


Where to Find:

Read all about internal classes and functions in the wiki.


  • Easy to Implement.
  • No permissions required.
  • Files, Directory Selection.
  • Single or Multiple File selection.


  • Library is also Available in MavenCentral, So just put this in your app dependencies to use it:
 compile 'com.github.angads25:filepicker:1.1.1'



  1. Start by creating an instance of DialogProperties.

     DialogProperties properties = new DialogProperties();

    Now 'DialogProperties' has certain parameters.

  2. Assign values to each Dialog Property using DialogConfig class.

     properties.selection_mode = DialogConfigs.SINGLE_MODE;
      properties.selection_type = DialogConfigs.FILE_SELECT;
      properties.root = new File(DialogConfigs.DEFAULT_DIR);
      properties.error_dir = new File(DialogConfigs.DEFAULT_DIR);
      properties.offset = new File(DialogConfigs.DEFAULT_DIR);
      properties.extensions = null;
  3. Next create an instance of FilePickerDialog, and pass Context and DialogProperties references as parameters. Optional: You can change the title of dialog. Default is current directory name. Set the positive button string. Default is Select. Set the negative button string. Defalut is Cancel.

     FilePickerDialog dialog = new FilePickerDialog(MainActivity.this,properties);
      dialog.setTitle("Select a File");
  4. Next, Attach DialogSelectionListener to FilePickerDialog as below,

     dialog.setDialogSelectionListener(new DialogSelectionListener() {
    public void onSelectedFilePaths(String[] files) {
     //files is the array of the paths of files selected by the Application User.

    An array of paths is returned whenever user press the select button`.

  5. Use method to show dialog.


Marshmallow and above requests for the permission on runtime. You should override onRequestPermissionsResult in Activity/AppCompatActivity class and show the dialog only if permissions have been granted.

  //Add this method to show Dialog when the required permission has been granted to the app.


public void onRequestPermissionsResult(int requestCode,@NonNull String permissions[],@NonNull int[] grantResults) {

 switch (requestCode) {


if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {



//Show dialog if the read permission has been granted.;



else {

 //Permission has not been granted. Notify the user.

 Toast.makeText(MainActivity.this,"Permission is Required for getting list of files",Toast.LENGTH_SHORT).show();




That's It. You are good to proceed further. 


  1. Start by declaring FilePickerPreference in your settings xml file as:

      android:title="Pick a Directory"
      android:summary="Just a Summary"
      app:titleText="Select Directories"
  2. Implement Preference.OnPreferenceChangeListener to class requiring selected values and Override onPreferenceChange(Preference, Object) method. Check for preference key using Preference reference.

      public boolean onPreferenceChange(Preference preference, Object o)
    return false;
  3. Typecast Object o into String Object and use split(String) function in String class to get array of selected files.

      public boolean onPreferenceChange(Preference preference, Object o)
    String value=(String)o;
     String arr[]=value.split(":");
    return false;

    That's It. You are good to move further.


  • defaultValue, error_dir, root_dir, offset_dir must have valid directory/file paths.
  • defaultValue paths should end with ':'.
  • defaultValue can have multiple paths, there should be a ':' between two paths.
  • extensions must not have '.'.
  • extensions should end with ':' , also have ':' between two extensions. eg. /sdcard:/mnt:


FilePickerPreference stores selected directories/files as a String. It delimits multiple files/directories using ':' char.

Read more on implementation here.








GPU Overdraw

GPU Rendering


Copyright (C) 2016 Angad Singh  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 


SerializableParcelableGeneratorPlugin for IntelliJ IDEA & Android Studio to generator SerializableParcelable code.

MaterialDialogBottomSheet is a custom dialog implementation to use BottomSheet MaterialView feature of Lollipop in older versions

Pulls notifications from a remote JSON file and shows them in your app.

Android progress bar with cool animation.

A demo usage of Fresco to show how to load images.

Aeromock is an application server that generates HTML from template files and data files. It enables speedy frontend development without the need for server side modules. Aeromock is referred to as a lightweight mock web application server.


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes