How to create / open files using the Storage Access Framework (SAF)?

How do you create / open (non-media) files using the Storage Access Framework (SAF), especially on Android 10+?

Reason for asking:
Many apps need access to files in the external storage that were created by other apps.

The question is aimed in particular at the Niotron team.

5 Likes

Yes you are write @Anke and also i am not expert in work of files accessing or any other work/ function in which files are required but still i know a little :sweat_smile:
i am tagging Staff here @NiotronStaff
please resolve the query

1 Like

Well actually what we did is fixed few issues that was in the code to work in the android version that are compatible, but yea, apps targeting API 30 seems to have the same issues as the Appinventor test server, because of restrictions in accessing file in the Android 11 devices. We are still waiting for Appinventor to deal with it :sweat_smile:

1 Like

Ok, I’ll ask this question again in the AI2 forum.

1 Like

Here is a new and important post from Evan Patton (MIT team) regarding the File component that anyone on the Niotron team should take a closer look at:
@Souvik @Krish

5 Likes

Fortunately I am also working on SAF related extension and most of its work is done.
Implemented:

  • SAF file picker (Tree method)
  • Take persistable uri permission (so you don’t lose access to file after reboot)
  • Check read and write access
  • Build document’s uri
  • IsDocumentUri , IsTreeUri and IsChildUri methods
  • Create document (File and Dir)
  • Delete document
  • Write to File
  • Read from File
  • Listing files
  • Rename Document
  • Copy document
  • Move document
  • Get mime type, display name,size and last modified time
5 Likes

Waiting for your extension

1 Like

This is excellent news.
I am excited …

2 Likes

Extension has completed alpha phase. :nerd_face:

5 Likes