Android examples for java.io:Directory
get Data Directory
import java.io.IOException; import android.content.Context; import android.content.pm.PackageManager; public class Main { public static String getDataDirectory(Context context) throws IOException { try {/* ww w. ja va2s .c o m*/ return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).applicationInfo.dataDir; } catch (PackageManager.NameNotFoundException nnfe) { throw new IOException("Cannot access to data directory", nnfe); } } }