Android FileIO with Android Obtaining the working folder


You can get your working folder by calling the method getFilesDir() on your Activity (Activity is the central class in your application that inherits from Context. See here). Reading is not different. Only your application will have access to this folder.

Your activity could contain the following code, for instance:

  File myFolder = getFilesDir();
  File myFile = new File(myFolder, "myData.bin");