/**
* Retrieve, creating if needed, a new directory in which the application
* can place its own custom data files. You can use the returned File
* object to create and access files in this directory. Note that files
* created through a File object will only be accessible by your own
* application; you can only set the mode of the entire directory, not
* of individual files.
*
* @param name Name of the directory to retrieve. This is a directory
* that is created as part of your application data.
* @param mode Operating mode. Use 0 or {@link #MODE_PRIVATE} for the
* default operation, {@link #MODE_WORLD_READABLE} and
* {@link #MODE_WORLD_WRITEABLE} to control permissions.
*
* @return A {@link File} object for the requested directory. The directory
* will have been created if it does not already exist.
*
* @see #openFileOutput(String, int)
*/
public abstract File getDir(String name, int mode);
通过注释我们可以看到这个方法是会在data/data/your pkg
创建一个目录的,只有你自己的应用有权限访问。
因而可以用这个方法快速创建一个data里面的目录。