How to save a file to application memory

How can I save a file in the device memory so that the user cannot access it?
in the first picture, the file is saved to the SD card and read, everything is fine.
But I need to save it in the application, like in the second picture. I get an error that the file was not written. /

So two things:

  1. What is the exact error message you're seeing when you attempt to write to the file. Include a screenshot if possible.
  2. Are you testing this in the companion or in a compiled app? The behavior of the companion is to always write to the visible storage for debugging purposes. Only compiled apps will be able to write to their app-private folder on the /data partition. Technically, this can still be read if the device is rooted.

compiled app is jobing.
i will delete post

Don't delete or edit. It will stay for others.

which Android version are you using for your tests?
and what is the complete error message in the companion app?


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.