A light-weight android library that can be quickly integrated into any app to let users choose folder, also files (but esp built for folders).
- To let users choose folder for saving files
- To let users choose backup folder
- To let users pick files to upload etc...
![]() |
![]() |
![]() |
---|---|---|
Can pick folders | Can create folder | Can also pick file |
For your convenience, it is available on jCenter, So just add this in your app dependencies:
compile 'lib.kashif:folderpicker:2.2'
To pick folder
Intent intent = new Intent(this, FolderPicker.class);
startActivityForResult(intent, FILEPICKER_CODE);
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == FILEPICKER_CODE && resultCode == Activity.RESULT_OK) {
String folderLocation = intent.getExtras().getString("data");
Log.i( "folderLocation", folderLocation );
}
}
Options
//To show a custom title
intent.putExtra("title", "Select file to upload");
//To begin from a selected folder instead of sd card's root folder. Example : Pictures directory
intent.putExtra("location", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath());
//To pick files
intent.putExtra("pickFiles", true);