Android examples for Hardware:Directory
get Dcim Directory from Environment
//package com.java2s; import java.io.File; import android.os.Environment; public class Main { public static File getDcimDirectory(String dirName) { if (dirName == null) { return null; }//from ww w . j a va2 s . com File dcimDirectory = null; String dcimPath = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_DCIM).getPath(); dcimDirectory = new File(dcimPath, dirName); if (!dcimDirectory.exists()) { dcimDirectory.mkdirs(); } return dcimDirectory; } }