Example usage for android.os Environment getExternalStorageDirectory

List of usage examples for android.os Environment getExternalStorageDirectory

Introduction

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

Prototype

public static File getExternalStorageDirectory() 

Source Link

Document

Return the primary shared/external storage directory.

Usage

From source file:Main.java

public static String getSDCardPath() {
    return Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator;
}

From source file:Main.java

public static String getExternalStorageDirectory() {
    String path = Environment.getExternalStorageDirectory().getPath();
    return path;
}

From source file:Main.java

public static String getSdcardRoot() {
    return Environment.getExternalStorageDirectory() + File.separator;
}

From source file:Main.java

public static String getCamaraPath() {
    return Environment.getExternalStorageDirectory() + File.separator + "FounderNews" + File.separator;
}

From source file:Main.java

public static String getSDCardPath() {
    File path = Environment.getExternalStorageDirectory();
    return path.getAbsolutePath();
}

From source file:Main.java

public static File getSDStorageDirectory() {
    return Environment.getExternalStorageDirectory();
}

From source file:Main.java

public static File getDBSDCardPath() {
    File sd = Environment.getExternalStorageDirectory();
    String backupDBPath = "main.db";
    File sdcardPath = new File(sd, backupDBPath);
    return sdcardPath;
}

From source file:Main.java

public static File getLocalRoot() {
    File tmp = Environment.getExternalStorageDirectory();
    tmp = new File(tmp, "webapp");
    if (!tmp.exists()) {
        tmp.mkdirs();/*  ww  w  . jav  a  2 s.  c  o m*/
    }
    return tmp;
}

From source file:Main.java

public static boolean isExternalStorageMounted() {

    boolean canRead = Environment.getExternalStorageDirectory().canRead();
    boolean onlyRead = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED_READ_ONLY);
    boolean unMounted = Environment.getExternalStorageState().equals(Environment.MEDIA_UNMOUNTED);

    return !(!canRead || onlyRead || unMounted);
}

From source file:Main.java

public static String generateSdcardFilePath() {
    return Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator;
}