Skip to content

mhutti1/android-storage-devices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

android-storage-devices

Get a list of writable storage locations in android.

To use this. First create a StorageSelectDialog and bind a listener to it:

StorageSelectDialog storageSelectDialog = new StorageSelectDialog();
storageSelectDialog.setOnSelectListener(this);

When it is time to show the dialog simply call:

FragmentManager fm = getFragmentManager();
storageSelectDialog.show(fm, "title");

You should implement StorageSelectDialog.OnSelectListener and receive the selected device with:

@Override
public void selectionCallback(StorageDevice storageDevice) {
	Do something here
}

To get a list of storage devices available use:

// Writable
ArrayList<StorageDevice> storageDevices = getStorageDevices(context, true);
// Readable
ArrayList<StorageDevice> storageDevices = getStorageDevices(context, false);

Duplicates may be returned (we do our best to filter them but due to system limitations its not always possible).

To add with jcenter add this to gradle:

compile 'eu.mhutti1.utils.storage:android-storage-devices:x.x.x'

About

Get a list of writable storage locations in android.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages