Here you can find the source of getRootFilePath()
public static String getRootFilePath()
//package com.java2s; import android.os.Environment; public class Main { public static String getRootFilePath() { if (hasSDCard()) { return Environment.getExternalStorageDirectory() .getAbsolutePath() + "/"; } else {/*from w w w.j a v a 2s . c o m*/ return Environment.getDataDirectory().getAbsolutePath() + "/data/"; } } public static boolean hasSDCard() { String status = Environment.getExternalStorageState(); if (!status.equals(Environment.MEDIA_MOUNTED)) { return false; } return true; } }