I started programming on Android with mit app inventor, it's possible that I can't find a simple block example to save, read and display a text file on a list (with the path in the internal memory of the phone), in all the answers I found it seems like I have to climb the mirrors, and I receive an error message with all the paths I try. tnx to anyone who responds.(Hopefully as clear and simple as possible.)
ho iniziato a programmare su Android con mit app inventor, possibile che io non riesca a trovare un esempio semplice a blocchi per salvare leggere e visualizzare un file di testo su una lista (con tanto di percorso nella memoria interna del cellulare) , in tutte le risposte che ho trovato sembra che ci sia da arrampicarsi sugli specchi, ed io ricevo un messggio di errore con tutti i percorsi che provo . grazie a chi rispondera' (si spera il + chiaramente e semplicemente possibile)
To store a liist in a file you have to convert it into a table in csv format; use the list to csv table for this
And after reading the file then convert the table in csv formst back into a list. If it is a 1 column list use the split block and split at \n to get the list again
I started programming on Android with App Inventor. It's possible I can't find a simple (and I repeat, simple) block-based example for saving, reading, and displaying a text file as a list (with the path to the phone's internal memory). All the answers I've found seem to be a bit of a stretch, and I get an error message with every path I try.
I used the text file because I appended the subsequent fields with three dashes—which I then used as dividers for the list. But if you could kindly explain .csv files to me, I'd be eternally grateful.
I'm still longing for the old Visual Basic, Pascal, C++, and the old machine language that didn't have many limitations, but okay, now we have to adapt to Android... it's going to be increasingly difficult to make things simple.
Thanks to anyone who responds
(hopefully as clearly and simply as possible).
I'm repeating the same request because, due to notifications, I mistakenly clicked on the solution and can't see it anymore. The answer
ho iniziato a programmare su Android con mit app inventor, possibile che io non riesca a trovare un esempio semplice (e ripeto semplice) a blocchi per salvare leggere e visualizzare un file di testo su una lista (con tanto di percorso nella memoria interna del cellulare) , in tutte le risposte che ho trovato sembra che ci sia da arrampicarsi sugli specchi, ed io ricevo un messggio di errore con tutti i percorsi che provo
usavo il file di testo perche accodavo i campi successivi con tre trattini --- che poi utilizzavo come divisori per la lista, ma se gentilmente mi spiegate i files.csv ve ne sarò eternamente grato
sto ancora rimpiangendo i vecchi visual basic, pascal, c++, e l' antico linguaggio macchina con cui non si avevano molti limiti, ma ok, adesso dobbiamo adattarci ad android..... della serie che sarà sempre piu difficile rendere le cose facili
grazie a chi rispondera
(si spera il + chiaramente e semplicemente possibile)
sto ripetendo la stessa richiesta perche a causa delle notifiche, ho spuntato erroneamente sulla soluzione e non riesco piu a vedere la risposta
CSV stands for Comma Separated Values.
It can be used to represent lists and tables (lists of lists) in text, unambiguously, to allow transport of lists and tables.
Rows of a table are ended with \n (line Feed).
items on a row are separated with commas.
Quotes (") may be added around text items to hide internal commas.
AI2 lists are linked lists, so they require conversion to CSV or JSON for transport.
If I need to export tabular data, I post it to a Google sheet using the spreadsheet component, or build up a table, convert it to CSV using the list block for that purpose, then use the Sharing component blocks to pass the CSV text to whatever app on my phone wants to import text (mail app, text editors, etc.)
Poking around in the Android file system is aggravating, the price of app safety.
P.S. Whenever I receive a .csv file, I open it in the free NotePad++ Windows program, to verify for myself that it has the required commas and line feeds.
Ciao Gianni,
non ho approfondito molto le tue richieste, ma solo riguardo il tuo ultimo post, vorrei capire meglio cosa tu intenda per "copiare la videata". Ovvero, se il tool che usi per copiare la videata ne fa un'immagine, ovviamente questa non può essere convertita in un file di testo (i csv sono file di testo, editabili con Notepad di Windows o, meglio, con Notepad++ (lo trovi gratis sul web) che ha molte più funzionalità.
Quindi: dal momento che tu ottieni un file di testo, in formato csv, cioè con i "campi" separati da virgole, usando i blocchi che convertono i file in liste (come ti ha già detto @ABG ) li puoi gestire, elemento per elemento, nelle tue formule.
Come consiglio ti direi di crearti "a mano" un file csv che simuli il vero file, in modo da testare gli algoritmi dell'app senza l'incognita del file, poi, quando tutto funziona, rimetti la parte che legge il file e debugghi solo più quella. (una Andreottiana politica dei "piccoli passi" ).
Ciao , Ugo.
English (resumed):
In a nutshell: before trying to attempt to read a "converted" file, my hint is to create a super simple csv file, by hand, and to test in such a way the app's algorithms, and only in a second step to read the "true file".
ciao ugo
per sapere quale programma usate per copiare la videata era per inserire lo screensaver su cio che sto scrivendo per farvi vedere i blocchi che ho usato (a quanto pare non molto bene) e io sto usando fastone capture per catturare lo schermo ma qui non me lo fa incollare
il BAD ARGOMENTS TO LIST TO CST TABLE cannot accept argoments continua a sbandierarmelo qualsiasi modifica io faccia
praticamente sto facendo la prova di un promemoria
la prima volta salvo un filetesto.csv con due righe vuote
successivamente inserisco descrizione e seleziono la data. confermando aggiungo la riga 2025-12-31-testo
alla lista (ho provato anche a numerarle \1 \2 \3.... stesso errore)
Hi Ugo,
I'm wondering what program you used to copy the screenshot. It was to insert the screensaver over what I'm writing so you can see the blocks I used (apparently not very well). I'm using Fastone Capture to capture the screen, but it won't let me paste it here.
The "BAD ARGUMENTS TO LIST TO CST TABLE cannot accept arguments" error keeps popping up no matter what changes I make.
I'm basically testing a reminder.
The first time I save a text.csv file with two blank lines.
Then I enter a description and select the date. When I confirm, I add the line 2025-12-31-text
to the list (I also tried numbering them \1 \2 \3... same error).
Dear @Gianni_Romagnoli, please pay attentiun to what @Anke is telling you, because she's the most experienced PU about file files management on Android systems.
And, and we both have told, please attach also a sample of your csv file, or a simplified structure of the data that you wish to write/read to/from it.
Cheers.
EDIT: another hint that could help also the other PU's to easier understand your blocks, could you please use the english language in the blocks ? In the menu bar:
Incidentally, I would give the same advice if the blocks were in my native language, German. Not because of the other non-German-speaking PUs, but for myself.
When I save the OpenOffice.org calc spreadsheet as a .csv file and read it with Notepad, it displays the two lines "test1" and "test2" like a normal text file.
(Now copy-and-paste has started to stop working again.)
As soon as I have some time and the screenshot starts working again, I'll show you the blocks in English.
If I had found clear and simple answers (and I've searched the entire web), I wouldn't have started a topic that has most likely already been solved. I'm so sorry I couldn't find the solution.
il foglio calc di openoffice.org quando lo salvo come file.csv e vado a leggerlo con notepad mi da le due righe prova1 e prova2 come un normalissimo file di testo
(adesso ha ricominciato a non funzionare il copia-incolla)
appena trovo un po di tempo e ricomincia a funzionare il cattura schermo vi mostro i blocchi in inglese
se avessi trovato risposte chiare e semplici (e ho girato tutto il web) non avrei iniziato un argomento che molto probabilmente è gia stato risolto e scusate tanto se non sono riuscito a trovare la soluzione