Example usage for android.os Environment getExternalStorageState

List of usage examples for android.os Environment getExternalStorageState

Introduction

In this page you can find the example usage for android.os Environment getExternalStorageState.

Prototype

public static String getExternalStorageState() 

Source Link

Document

Returns the current state of the primary shared/external storage media.

Usage

From source file:Main.java

public static boolean isExistSDCard() {
    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
        return true;
    } else {/*w w  w .j  a  v  a  2  s  . co  m*/
        return false;
    }

}

From source file:Main.java

public static boolean externalMemoryAvailable() {
    return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
}

From source file:Main.java

public static boolean isExistSDcard() {
    String state = Environment.getExternalStorageState();
    return state.equals("mounted");
}

From source file:Main.java

public static boolean isSdcardShared() {
    String state = Environment.getExternalStorageState();
    return Environment.MEDIA_SHARED.equals(state);
}

From source file:Main.java

public static boolean isHasSdcard() {
    String status = Environment.getExternalStorageState();
    return status.equals(Environment.MEDIA_MOUNTED);
}

From source file:Main.java

public static boolean isExternalStoragePresent() {
    return Environment.getExternalStorageState().equals("mounted");
}

From source file:Main.java

private static boolean isExternalStorageMounted() {
    return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
}

From source file:Main.java

public static boolean isSDCardMounted() {
    String state = Environment.getExternalStorageState();
    return state.equals(Environment.MEDIA_MOUNTED);
}

From source file:Main.java

public static boolean isSDReadable() {
    String state = Environment.getExternalStorageState();
    if (Environment.MEDIA_MOUNTED.equals(state) || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
        return true;
    }//  www  .j  a v a2s  .  c o  m
    return false;
}

From source file:Main.java

public static boolean isExternalStorageAvailable() {
    return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
}