Example usage for android.os Environment DIRECTORY_PICTURES

List of usage examples for android.os Environment DIRECTORY_PICTURES

Introduction

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

Prototype

String DIRECTORY_PICTURES

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

Click Source Link

Document

Standard directory in which to place pictures that are available to the user.

Usage

From source file:Main.java

public static String getGalleryPath() {
    return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/";
}

From source file:Main.java

public static String getAppGalleryPath() {
    return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString()
            + "/pharaohCard/";
}

From source file:Main.java

public static String getAppFolder() {
    String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/";
    return path;//from  w  w  w .  j  a v a 2  s .  co  m
}

From source file:Main.java

public static File getAlbumDir() {
    File dir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),
            getAlbumName());//  w  ww  . jav  a 2  s.com
    if (!dir.exists()) {
        dir.mkdirs();
    }
    return dir;
}

From source file:Main.java

public static Uri getOutputUri() {
    File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
    if (dir.exists() == false) {
        dir.mkdirs();/*from   www . j a  va2  s  . c om*/
    }
    File file = new File(dir, "photo.png");
    return Uri.fromFile(file);
}

From source file:Main.java

public static String getDirPath() {
    File mediaStorageDir = new File(
            Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "Dove");
    if (!mediaStorageDir.exists())
        return null;
    else/* w ww . jav a 2  s .c o m*/
        return mediaStorageDir.getPath();

}

From source file:Main.java

public static File getDir() {
    File sdDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
    return new File(sdDir, ASKEM_DIRECTORY);
}

From source file:Main.java

public static File getAlbumStorageDir() {
    return new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), ALBUM_NAME);
}

From source file:Main.java

public static String getFolderName(String name) {
    File mediaStorageDir = new File(
            Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), name);

    if (!mediaStorageDir.exists()) {
        if (!mediaStorageDir.mkdirs()) {
            return "";
        }//  w ww  . j  a  v  a  2  s.  c  o  m
    }
    return mediaStorageDir.getAbsolutePath();
}

From source file:Main.java

public static File createImageFile(String imageFileName) throws IOException {
    File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
    File image = File.createTempFile(imageFileName, /* prefix */
            ".jpg", /* suffix */
            storageDir /* directory */
    );/*from   w ww  .  j av  a  2 s  .c om*/
    return image;
}