FileIO with Android
suggest changeVersions
This topic was tagged for Android 1.0 and 7.1.
Introduction
Reading and writing files on Android uses the same java.io package as standard Java. Android adds rules for which folders you may write, for permissions, and for MTP workarounds.
Remarks
Android can share a file between applications, as documented here. Skip that setup when only one app creates and uses the file.
Android also offers other storage options: shared and private preferences, saved bundles, and a built-in database. In some cases those fit better than plain files.
An activity has a few helpers for its private files. Context.deleteFile() deletes a file created with openFileOutput, in place of File.delete(). Context.fileList() returns the names of those files. It is the file list for that directory, and it is not a recursive File.listFiles() of arbitrary folders.