SAF: App Inventor implementation of Storage Access Framework

Show complete path.

Did you take persistable uri permission?
Also you don’t seem to follow the steps correctly.
First read then create document and then write to it.

It says: java.lang.String cannot be cast to android.net.Uri The blocks are correct.
UPDATE: The method is now working. isReadGranted and isWriteGranted are both true.

This is the only problem I got:
Unsupported Uri content://com.android.externalstorage.documents/tree/3BCB-0F0D%3ADocuments

Hey! it’s working now! I am doing some explore to work properly! my Image is ready to save to SD Card! This extension is useful :slight_smile: :hand_with_index_finger_and_thumb_crossed: :two_hearts:

ChangeLog Version 1.2 [July 3, 2023]

New Blocks


Changes

  • Minor internal changes to increase reading and writing speed
  • Works more efficiently now

ChangeLog Version 1.3

New Blocks
image
Both blocks sponsored by @Alexandre_Gorine :clap:

image

Changes

  • Some internal changes in InitialDir method to make it usable on Android < 10
  • CopyDocument will try to create document manually if Copy is not supported for given parent uri
    It may work so worth trying.
1 Like

:question:

Previously it returned an empty string for Android versions < 10.

1 Like

Hi there again! I have one question, What is InitialDir on OpenSingleDocument or OpenDocumentTree can do to use? Give me some example.

this is how to create file using saf in directory that user can decide

4 Likes

wow nice. if you put android.intent.extra.TITLE on the create document, it will automatically have file name?

yeah
it should be able to force directory also but im not able to get it to work

ah… OK Anyway don’t worry, I have to figure it out for Initial Directory. because I implemented my Designer app with Storage Access Framework.

you should pass it in extra also but it didnt work for me
if you are able to share the solution

1 Like

You can use InitialDir block like this:

1 Like

what extra key should i use for initialdir

android.provider.extra.INITIAL_URI

1 Like

i will test when i can now ab server is in maintenance

This is it! I will be able to work with Initial Dir selection.

where does label1 come from ?