is External Storage Readable and read only - Android android.os

Android examples for android.os:External Storage

Description

is External Storage Readable and read only

Demo Code

import android.os.Environment;

public class Main{

    /** Checks if external storage is available to at least read */
    public static boolean isExternalStorageReadable() {
        String state = Environment.getExternalStorageState();
        if (Environment.MEDIA_MOUNTED.equals(state)
                || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
            return true;
        }//  w w  w .j ava2 s  .  c om
        return false;
    }

}

Related Tutorials