There is a code that saves data to a file in the application directory.
try { OutputStream outputStream = openFileOutput("nameOfFile.txt", 0); OutputStreamWriter osw = new OutputStreamWriter(outputStream); osw.write("data"); osw.close(); } catch (Throwable t) { Toast.makeText(getApplicationContext(), "Exception: " + t.toString(), Toast.LENGTH_SHORT).show(); } It is necessary that the program check the presence of the Folder folder in the application directory, in its absence create a folder, and then save the file to the Folder folder in the application directory.
I found manuals for creating a folder along a specific path (to a memory card), but it is not clear to me which path to point to for the application storage.