File read-delete problem

I’ve got a file xyz.txt in assets.
I’m reading file at the “screen1.initialaze” with “read from file name” and I am typing “//xyz.txt” as filename. (file content is json so I am using json to dictionary extension)
I am getting some other json information from internet and want to add that information to file and save it so I am using
blocks (4)
No problem up to now.
blocks (5)

I can see file content + internet content. The problem is, when I close app and reopen I can only see my file content ( not internet content )
So that means I can not save my file properly.
I tried to add/delete “//” to beginning but did not changed.
How can I add extra data to my txt file which is in assets?

You cannot. Assets are read only. You will need to copy your file in assets to your sdcard (ASD), then access it from there to read/write.

Thanks for fast answer,
What happens to copied file when I send update to my application?
(Assume user installed update)

Depends on how you update your app, but it should remain safe in your ASD. However, if you add new data to the file in assets, you will need to transfer that new data to the file on the ASD…

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.