How when and where text files are stored

I dont seem to have any issue writing or reading a text file in the app directory:
This PC\Galaxy Tab S5e\Tablet\Android\data\appinventor.ai_roosterapp_biz.Rooster44\files

i cannot see the location within android file explorer, but looking from my pc i see the file, i can read, write and delete it.

my issue is that the user inputs data about the configuration. that info is packaged up as a JSON string and written into a text file.

the app will reopen and "read" the file to repopulate fields and that seems to happen accurately, but if i open the text file it clearly does not have all of the data that is being displayed.

i will work to get examples of the but directly, the question is where is it hiding the information if its not in the file? is the android device showing me an older version of the file? how will i prove that?

i am going to have the json string displayed so i can compare, but ive been stuck here on this for a few days


here is a screenshot of the app that clearly has a lot more text than the pc is seeing. i have closed the file explorer in attempt to refresh it. I also see erroneous additional text, but thats error in how i appended the text.

how do i get an updated version of this file?
everything i can see in the app indicates the file is working, accurate and up to date, but externally I cannot see that its updated.

I need to be able to copy and paste the file to save as a backup, mostly for testing as every time i uninstall the app, it deletes the file directory, and it takes more time to input enough info to test the app. pasting in a known good version would be easier, but that does not solve my issue of why i cant see it updated.

What text editor program are you using to open the file?
I use Notepad++

How about saving the file in one of the shared folders (/Documents or /Download) that are accessible via the device (unlike ASD on Android 11+)?


Show your relevant blocks and post a simple test aia (including the text file (JSON string) and the new (updated) text file.

i will post relevant blocks as soon as i see the issue again. as I am working on other aspects of the app while giving time for response here... its not at my fingertips to reproduce.

i am using notepad but i dont know about++ it is just the default text editor in microsoft

i tried using a Macbook, and that was a whole can of worms

a simple test aia does not seem like a real alternative in recreating the issue as the scope is extensive, but point taken, the results should be consistent.

Follow the advice from @Anke and store the file in shared storage, i.e. set the file scope to Legacy and use the following path: /Download/RoosterConfig.txt

You can store the file there and also read it again, but precondition is, that you do not edit it using an external app

See also

If you like to edit it, then use SAF to get access again

Taifun