MFile - a modified version of Sunny's `EFile` extension - Shared folders - storage permissions - Android 11+

Yes, it should work on all Android versions. But the purpose and benefit of the extension is to avoid unnecessary storage permissions on Android 11+. Otherwise you can also use the File component.

Hello everyone
doesn't seem to work with Android 14. Files from the download folder cannot be read.
Best regards

They can be read, but they must be created by the app itself. Oherwise you must use SAF or MANAGE_EXTERNAL_STORAGE permission.

See also here:

How can I use MFile extension to do the following things?

  1. Upload text file from any memory-area of the phone.
  2. Save that file in ASD so it can be read and manipulated (means adding, editing, splitting etc) according to the need.
  3. Can we do step 2 outside of ASD as well?

(Thankyou @Anke for suggesting me to discuss this new problem in a new post.)

Upload to what?

Upload to read the text file. I am not able to do (read) it.

-- Only if I can read the file, I can do all other text-file manipulations.

-- help me.

Pick and read the text file and/or save it in a new folder /Documents/TextFiles/ using SAF and read/wirte from it / to it using the File component.

1 Like

How can I use SAF, can you explain with blocks?

how can I apply SAF to these blocks?

SAF means Storage Access Framework, am I right?

Can you share the documents that explain SAF? I shall learn few basics and ask doubts after that.

COMMENT UPDATED: SAF: App Inventor implementation of Storage Access Framework - #249 by Anke

Read everything, from beginning to end here:

then you should get a good understanding of how to use the extension.

Also some background:

Can you include one more block in MFile extension. ie, to read file from device (even if we never save it). Assume that, if a file is constantly getting updated manually by a user and mit ai2 has to read that file and perform some action based on the data in it.

Updated Point:

If you could include SAF within/behind that block we newbies will feel more beneficial.

[edited]

If a text/csv file is owned/created by your app, then use the File component to write, but use SAF to read.

If a text/csv file is NOT owned/created by your app, then you need the SAF extension to read/write.

Or just use SAF for read/write operations.

1 Like

1 Like

Currently MFile is not offering option to read file directly without saving it. Correct me if I am wrong.

If so can you develop one more block that is made using SAF technology to read files directly and even in higher Android versions?

Use the SAF extension!

You are wrong, MFile can of course read a text file directly without saving it, but the non-media file (.txt, csv) must be created by the app itself.

1 Like

Yes, it worked.

Can MFile recognize the rowdata or cell data or column data of csv file precisely? If so, I can parse specific data? Is there any way to do it?

There does not exist any possibility to edit parts of a file without first reading it completely, editing it and saving it again

You already received my answer here 1) Read .csv file from phone, 2) Seach for a keyword 'Apple4321' 3) If keyword found, then look for the nearest word if it is 'send' 4) If the word 'send' is found do some action like 'play music' - #9 by Taifun

It is a bad design choice to use a file as data storage if you have to edit data frequently, because it is cumbersome to work with files

You have to read it completely, edit what you want to edit and save it again...

And

Remember, you have to use SAF to read/write non media files your app does not own, see also Some basics on Android storage system

Also you might want to think about how you plan to solve the problem of 2 processes (Tasker and your app) writing at the same time
.

See again my suggestion without Tasker and without using csv files 1) Read .csv file from phone, 2) Seach for a keyword 'Apple4321' 3) If keyword found, then look for the nearest word if it is 'send' 4) If the word 'send' is found do some action like 'play music' - #28 by Taifun

Taifun

1 Like