getFilesDir()
returns a File object to a directory that is private to your application only. When you use openFileOutput(String, int)
, the data you write is directly stored in this directory and is not accessible by any other application. It holds your application files.
getDir()
enables you to create any file or directory in the internal memory, which is also accessible by other applications depending on the mode you create it. openFileOutput(String, int)
will not work with the output of this so you will have to use other means of writing and reading files to deal with this directory or file. This is more used for creating custom files other than files only used by your application.