Android Bitmap Load getBitmapStoragePath(Context context)

Here you can find the source of getBitmapStoragePath(Context context)

Description

get Bitmap Storage Path

Declaration

public static String getBitmapStoragePath(Context context) 

Method Source Code

//package com.java2s;

import java.io.File;

import java.io.IOException;
import android.content.Context;

import android.os.Environment;

public class Main {
    private static final String APP_DIR = "dailyselfie/pictures";

    public static String getBitmapStoragePath(Context context) {
        String bitmapStoragePath = "";
        if (Environment.getExternalStorageState().equals(
                Environment.MEDIA_MOUNTED)) {
            try {
                String root = context.getExternalFilesDir(null)
                        .getCanonicalPath();
                if (null != root) {
                    File bitmapStorageDir = new File(root, APP_DIR);
                    bitmapStorageDir.mkdirs();
                    bitmapStoragePath = bitmapStorageDir.getCanonicalPath();
                }/*from  ww w.j av a2s .  com*/
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return bitmapStoragePath;
    }
}

Related

  1. getBitmapFromUri(Context ctxt, Uri selectedImageURI)
  2. getBitmapFromUrl(String url)
  3. loadBitmapFromFile(String fileNameWithPath)
  4. downloadBitmap(URI uri)
  5. returnBitMap(String path)
  6. getTempBitmap(Context context)
  7. createBitmapFromImageFile(File imagefile)