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 sdCardCheck() {
    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
        return true;
    } else {//from  w  ww .j ava 2  s  .c  o  m
        return false;
    }
}

From source file:Main.java

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

From source file:Main.java

public static boolean isSDCardExist() {
    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
        return true;
    }/*from  w ww  .ja va 2 s . c om*/
    return false;
}

From source file:Main.java

public static String getSdPath() {
    if (Environment.getExternalStorageState().equalsIgnoreCase(Environment.MEDIA_MOUNTED)) {
        return Environment.getExternalStorageDirectory().toString();
    }/*from  w w w.  j a  v  a  2s .  co  m*/
    return null;
}

From source file:Main.java

public static boolean checkSdCard() {
    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
        return true;
    } else {//ww  w  .  jav a2  s  .  c o  m
        return false;
    }
}

From source file:Main.java

public static boolean existSdcard() {
    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
        return true;
    } else {//from  w  w  w .  j ava2s.c o  m
        return false;
    }
}

From source file:Main.java

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

From source file:Main.java

public static boolean isSdcardExist() {
    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
        return true;
    }/*from  w w w .  j a  va2 s.  c o m*/
    return false;
}

From source file:Main.java

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

From source file:Main.java

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