No, what else should I talk about here if not SAF??
SAF working fine with Android 6 device here, just wanted to qualify that. I understand what you are saying regarding relevance.
I didn't bother to read any background information on SAF, because I am an idiot.
Idiot comes from the Greek (ἰδιώτης) and actually means "private person", not "expert." That's all. But you're certainly an expert when it comes to App Inventor.
13 posts were split to a new topic: When I pick an image using picker, I get READ_MEDIA_IMAGES has been denied
Dear @Anke, nice to read that. Me too, I've studied ancient greek and latin more than 50 years ago at the classic lyceum (as we call that type of school here in Italy), before discovering the charm of physics...
German language has many similarities with ancient greek and latin: so I loved to study it (German) but the problem has been the short time remaining to do that after a "long" working day and an eveving to dedicate to the kids....maybe next life....
I have worked up a couple of "forked" extensions based upon @vknow360 's code, and loosely based upon my saf guide
You can find everything on github
You can also download the extensions HERE
Dear @TIMAI2,
many thanks for your message with "forked" extensions.
Recently I've faced some problems with the "visibility" of files because the app that I've created for me and for my friend (with whom I do hystorical rallies) must run on our tablets but the problem is that my ones and his ones have different levels of Android therefore I have to maintain different versions of the same app, one compiled with "legacy" scope and the other one with "app" scope (always a nightmare about configuration control !
Moreover I need to exchange data (a .csv file containing GPS waypoints) created by one app with another app that shall use those waypoints to manage the track during the rally (during the race).
For this reason anything that can ease my life in file management is really a "panacea".... (as your tutorial....hopefully not in latin but in English
)
All the best !
That is going out of my head, I only got some portion of starting. BTW can I show a folder in my app, so the person can select which file to read data. And do u have aia, so I can understand it by using it with companion
Maybe this guide will help you ?
ReadFromFile will only read text files, so you should filter your list for just this type of file.
text/plain
will exclude other text file types, best to use text/*
You are correct. Use the contains block instead:
What you are doing has probably already been covered here:
AI will only get you so far. Best to read the documentation, and follow the available guides.
Hi all. Firstly, thanks for the great extension!.
I'm having an issue I'm hoping someone can help me with.
My app reads, modifies and saves CSV files. No problem adding rows, modfiying "cells", saving the file then reading it again. I'm having isses when deleting rows and attempting to shorten the file text. It seems that WriteToFile does not truncate the file and then write new data, just overwrites existing data leaving garbage at the end of the file.
App does the following:
1). Reading a CSV file with SAF ReadFromFile,
2). Converting to list (of lists) with list from csv table.
3). Deleting some rows of data with remove list item
4). Over writing the same uri I read with WriteToFile by converting the modified list to csv table.
The CSV file is now corrupted due to remaining (un truncated) text at the end of written data.
Is this the intended behavior? If so, how do I truncate the file? Do I need to delete then create a new file to write less text to a file? Or may there be some other reason for this that I'm missing? Something to do with Drive?
I can't find any reference to the behavior I'm experiencing.
Thanks in advance. Daryl
Ok, I can confirm this is only happening for reading/writing files on Drive. When I download the file to Downloads, open and delete csv records and then overwrite it with my app, no issues.
You may get some inspiration from these:
Thanks, I have read your articles, very helpful. I'm not having any issues with permissions etc and would like to stick with direct editing with SAF rather than your sheets solution as that would be too complex for many intended users.
Maybe I will try to pad the end of the file with spaces if it is shorter than originally read. Then remove trailing spaces when it is read again? It's a shame WriteToFile didn't truncate the file before writing when on drive. Maybe it should (as it does on the phone) and this was missed when implemented?
Cheers, Daryl