panda.roid.io.Storages Maven / Gradle / Ivy
package panda.roid.io;
import android.os.Environment;
public class Storages {
/**
* Checks if external storage is available for read and write
* @return true if external storage is writable
*/
public boolean isExternalStorageWritable() {
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
return true;
}
return false;
}
/**
* Checks if external storage is available to at least read
* @return true if external storage is readable
*/
public boolean isExternalStorageReadable() {
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state) || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
return true;
}
return false;
}
}