How can I read/write my text file in /Documents?

If the text file (Appunti.txt) is created by the app itself, it is no problem to read it with the File component and / or to save new text (in the shared folder /Documents).

If the text file is not created by the app itself, but was copied into the /Documents folder by another app or manually, there are 3 options (since the app, as you said, is only for your own use):

  1. Change the targetSdkVersion to 29 (easiest way).

  2. Declare MANAGE_EXTERNAL_STORAGE in the Manifest and request this permission (to get full access to all files / directories).

  3. Save / copy Appunti.txt (manually) in the ASD, eg here:
    /storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/Documents/Appunti.txt
    and copy / move it (in the Screen.Initialize event) to the shared folder → /Documents (releative path) using the app
    /storage/emulated/0/Documents/Appunti.txt (absolute path).

1 Like