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 long getSDSize() {
    String str = Environment.getExternalStorageDirectory().getPath();
    StatFs localStatFs = new StatFs(str);
    long blockSize = localStatFs.getBlockSize();
    return localStatFs.getAvailableBlocks() * blockSize;
}

From source file:Main.java

public static File getAppDirectory() {
    return new File(Environment.getExternalStorageDirectory().getPath() + File.separator + "LocalMangaViewer"
            + File.separator);/* w ww. j a va  2  s .co  m*/
}

From source file:Main.java

public static boolean isExist() {
    File file = new File(Environment.getExternalStorageDirectory(), "db_contacts.db");
    return file.exists();
}

From source file:Main.java

public static File getGpsStartTesterDir() {
    return new File(Environment.getExternalStorageDirectory(), "Binartech/GpsStartTester");
}

From source file:Main.java

public static String getImagePath(String prefix) {
    return Environment.getExternalStorageDirectory() + File.separator + "IBP" + File.separator + "ibp_" + prefix
            + ".jpg";
}

From source file:Main.java

public static File getGpsHotStartTestDir() {
    return new File(Environment.getExternalStorageDirectory(), "Binartech/GpsHotStartTester");
}

From source file:Main.java

public static File getUploadFolder() {
    File file = Environment.getExternalStorageDirectory();
    File path = new File(file, File.separator + "farm" + "");
    if (!path.exists())
        path.mkdir();/*from   ww  w  .  j  a v a2s  . c  o  m*/
    return path;
}

From source file:Main.java

public static File getHomeFileLoc() {
    File sdcard = Environment.getExternalStorageDirectory();
    File sdpath = new File(sdcard.getAbsolutePath() + File.separator + "KnouNotice");
    if (!sdpath.exists()) {
        boolean flag = sdpath.mkdirs();
    }/*  www.  j  av  a2 s.  co  m*/
    return sdpath;
}

From source file:Main.java

public static String getCameraPath() {
    String filePath = Environment.getExternalStorageDirectory().getPath() + File.separator + "zmtCach"
            + File.separator + "camera" + ".jpg";
    return filePath;
}

From source file:Main.java

public static File getAlbumDir() {
    File f = new File(Environment.getExternalStorageDirectory(), "moneycat");
    if (!f.exists()) {
        f.mkdir();/* w w w.  jav  a2s .  c  om*/
    }
    return f;
}