Code example for Context

Methods: getExternalFilesDirgetFilesDir

0
        //} 
    } 
 
    private static String scriptsDirName(Context context) {
        File storageDir = null;
        if (isDebugBuild()) { 
            storageDir = context.getExternalFilesDir(null);
            if (storageDir == null || (!storageDir.exists() && !storageDir.mkdirs())) {
                Log.e("Development mode active, but sdcard is not available.  Make sure you have added\n<uses-permission android:name='android.permission.WRITE_EXTERNAL_STORAGE' />\nto your AndroidManifest.xml file.");
                storageDir = context.getFilesDir();
            } 
        } else { 
            storageDir = context.getFilesDir();
        } 
        return storageDir.getAbsolutePath() + "/scripts";
    } 
 
    private static void setDebugBuild(Context context) {
        PackageManager pm = context.getPackageManager();
        PackageInfo pi;
        try {