If you're trying to get access to a file, try the openFileOutput()
and openFileInput()
methods as described here. They automatically open input/output streams to the specified file in internal memory. This allows you to bypass the directory and File
objects altogether which is a pretty clean solution.