Java tutorial
//package com.java2s; import android.content.Context; import java.io.File; public class Main { public static File getFilesDir(Context context) { File targetDir = context.getExternalFilesDir(null); if (targetDir == null || !targetDir.exists()) { targetDir = context.getFilesDir(); } return targetDir; } }