Code example for File

Methods: exists, getAbsolutePath, mkdir

0
     * @param Context 
     * @return Directory for files of Databases 
     */ 
    public static String databaseDirectory(Context context) {
        File dir1 = new File(Environment.getDataDirectory(), "data/" + context.getPackageName());
        File dir2 = new File(dir1, "databases");
        if(!dir2.exists()){
        	dir2.mkdir();
        } 
        return dir2.getAbsolutePath();
    } 
 
 
    private final Context mContext;
    private final String mName;
    private final CursorFactory mFactory;
    private final int mNewVersion;
 
    private SQLiteDatabase mDatabase = null;
    private boolean mIsInitializing = false;