Example usage for android.os Environment MEDIA_MOUNTED

List of usage examples for android.os Environment MEDIA_MOUNTED

Introduction

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

Prototype

String MEDIA_MOUNTED

To view the source code for android.os Environment MEDIA_MOUNTED.

Click Source Link

Document

Storage state if the media is present and mounted at its mount point with read/write access.

Usage

From source file:Main.java

public static boolean isExternalStorageAvailable() {
    String extStorageState = Environment.getExternalStorageState();
    if (Environment.MEDIA_MOUNTED.equals(extStorageState)) {
        return true;
    }/*from ww  w .j  a  va  2  s .co  m*/
    return false;
}

From source file:Main.java

public static File getStoragePath() {
    String state = Environment.getExternalStorageState();

    if (Environment.MEDIA_MOUNTED.equals(state)) {
        return Environment.getExternalStorageDirectory();
    } else {//from  w w w  .  java2  s.  c o  m
        return null;
    }
}

From source file:Main.java

public static boolean sdCardIsAvailable() {
    String status = Environment.getExternalStorageState();
    if (!status.equals(Environment.MEDIA_MOUNTED)) {
        return false;
    } else {/*from  www.  ja va2  s . c  o m*/
        return true;
    }
}

From source file:Main.java

public static boolean isStorageExists() {
    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
        return true;
    }/*w w w  .  j  ava2s.  co m*/
    return false;
}

From source file:Main.java

public static boolean isSDCardAvailable() {
    String status = Environment.getExternalStorageState();
    if (!status.equals(Environment.MEDIA_MOUNTED)) {
        return false;
    } else {//from  w  w  w.j  av a  2s . c o m
        return true;
    }
}

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(Context context) {
    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
        return true;
    }/*from  w w  w .j a  v  a2s .  co m*/
    return false;
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

/**
 * is has sd//from  ww  w . j  ava2  s.c o m
 * @return
 */
public static boolean isSDCard() {
    return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
}