I'm new to Android. I searched for how to create a file within the Android directory and was lead to this post which mentions to save it to the assets directory: Where to put text files in directory in Android
My problem is, turns out I cannot edit files which are in the assets directory.
context.openFileOutput
saves it to what context.getFilesDir()
returns, which is /data/
folder (which from my understanding is not within the Project directory because I need to ask permission for it) but the problem I'm having with saving it there is that I get permission denied, even when I have permission to save (I made this post about it: Getting a Permission denied error when creating a file with Android, even when permission is given)
With that said, what's the correct way to save a .txt file within the Android project directory but Not inside the assets folder?