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 isSdCardWriteable() {
    String status = Environment.getExternalStorageState();
    if (status.equals(Environment.MEDIA_MOUNTED)) {
        return true;
    }//  w w  w.j a va2 s  . c  o m
    return false;
}

From source file:Main.java

public static boolean isSdcardExist() {
    String status = Environment.getExternalStorageState();
    if (status.equals(Environment.MEDIA_MOUNTED)) {
        return true;
    } else {/*  www .  j  a  v a2s. co m*/
        return false;
    }
}

From source file:Main.java

private static boolean isExternalStorageWritable() {
    final String state = Environment.getExternalStorageState();
    if (Environment.MEDIA_MOUNTED.equals(state)) {
        return true;
    }//w  w  w  .  ja  v  a 2s .co m
    return false;
}

From source file:Main.java

public static boolean sdcardMounted() {
    final String state = Environment.getExternalStorageState();
    if (state.equals(Environment.MEDIA_MOUNTED) && !state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
        return true;
    }/*from   w  w w .j  av  a2  s  . co  m*/
    return false;
}

From source file:Main.java

public static boolean sdCardIsAvailable() {
    String status = Environment.getExternalStorageState();
    if (!status.equals(Environment.MEDIA_MOUNTED))
        return false;
    return true;/*from   w w w . ja v  a 2s .  c om*/
}

From source file:Main.java

public static boolean sdCardMounted() {
    final String state = Environment.getExternalStorageState();
    if (state.equals(Environment.MEDIA_MOUNTED) && !state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
        return true;
    }//from   ww  w .  j  a  v  a  2s . c o m
    return false;
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static boolean sdCardIsAvailable() {
    String status = Environment.getExternalStorageState();
    if (!status.equals(Environment.MEDIA_MOUNTED)) {
        return false;
    }/*w  ww. j a  v a  2 s .c  o m*/
    return true;
}

From source file:Main.java

public static boolean isMountSdCard() {
    String mountState = Environment.getExternalStorageState();
    if (mountState.equals(Environment.MEDIA_MOUNTED)) {
        return true;
    }//from w  ww  . java2s.  com
    return false;
}