How do you save and load file txt into tinydb with different tags?

My guess is that you have not set the namespace to "Backupfile" and you have not set the filename correctly.

Ok thanks again for your guess i will try again.

Good evening, unfortunately I am still stuck. With the above block I can save the data directly on the phone but I cannot retrieve it when I want to load it into the application. Any suggestions on how to do it?

This isnt the way to load the backup file, you need to provide a full actual valid path of the file that will be returned by the FilePicker, check those green property blocks from where you get the path which you'll give to the "LoadFile" block.

Thanks again for your guess i will try again.


Good evening, everyone!

I've finally achieved success! With the first block, I can now save a file named "file.txt" containing the three different tags on the mobile device. The second block successfully loads the saved data.

However, I'm facing a challenge: even after loading the data, I need to manually refresh the companion screen using MIT App Inventor to see the updated information reflected in the list.

Do you have any suggestions on how to automatically update the list upon data loading, eliminating the need for manual refresh?

Ok, I managed to solve the problem with some tricks by calling another screen in the program. This way, you avoid manually refreshing the complementary screen using MIT App Inventor to see the updated information reflected in the list.

I am asking the community for one last bit of help to complete my program. Does anyone know how to instruct this block, which I am attaching, to save the BackUp.txt file to the Download folder of the main memory of a mobile phone without an SD card?

image

Try changing App to Shared and /BackUp.txt to /Download/BackUp.txt.

Note this is an insecure location to store sensitive data!

Thanks again for the suggestion on how to save the txt file, and especially for the advice regarding data security.


Hi TIMAI2,

Thanks again for your suggestion, but it seems that simply "saving" the contents of the TinyDb to a text file and then storing it on my phone has become an unsolvable problem for me. Let me explain:

With the two blocks I attached, I am able to save a text file called BackUp.txt on my phone. But the strange thing is that when I open the file picker on my phone and wait for the selection of the BackUp.txt file, I can click on any file and the application still loads the BackUp.txt file. Maybe I'm not explaining myself well. I mean that no matter which file I choose after pressing the filePicker button, the application automatically opens the BackUp.txt file ???
I suppose this problem prevents me from loading previous BackUp.txt files with the application. Thanks again for your time and suggestions.

Here is a simple example aia project that uses the etinydb extension. I am still conerned that you may not be doing things correctly?
etinydbTestExtn.aia (13.7 KB)

Can I ask why it is you need to copy this file to shared storage, and then what you intend to do with it once it is there ?

Hi, of course you can ask!

It doesn't matter which archive you copy the file.txt to. It's important to copy it to your phone so you can store it later on a USB drive or in a secure cloud for future access.

Why have it available? If you lose the application for any reason, or even if you install it on another device, you simply need to reinstall the app on your phone and import the file.txt to retrieve your saved passwords.

Thank you again. I'm going to go and look at that aia file you provided now. I appreciate your time.

Just upload to the cloud from your ASD then ?

Yes, I thought about it, but I find the method that I haven't been able to do yet, which is to save it on my phone, to be more secure.

Then why suggest your "cloud" ?

I have already indicated that shared storage is less secure than your app ASD.

Of course, you are absolutely right about the security issue. But it seems there is a misunderstanding.

Exporting the file.txt or JSON to the app ASD (a secure method for data privacy as yuou have said) no longer allows me to export the aforementioned file to a USB stick or the phone. However, this operation is essential when i would like to reinstall the application on the phone, as i will then need the file.txt or JSON containing all the password data.

This operation is not secure for data security, but the file.txt would only be used to allow the newly installed application on the phone to read the previously saved file regardless of the drive where it was saved.
Another example could be the fact of owning two cell phones. If you already have the application containing various saved passwords installed on one of them, it would be enough to install the application on the second phone, take the file.txt file from the first and load it on the second phone.

Thank you again for your patience and the time you dedicate to me.

Here I am at the end after hours of work I was able to complete the last two blocks related to saving and loading data related to the password list, thanks to the community and above all to the contribution of TIMAI2. For now I have to stop and I regret not being able to export the data contained in the EtinyDb1 to a text file containing the entire list of passwords and then save this text file to a shared folder on the phone in order to be able to have them for a subsequent reconfiguration of the application. I attach the aia file for anyone who wants to try the functionality and maybe take away this regret.
ImaPassword.aia (549.3 KB)


Hello everyone, and here I am again to complete my work and take away this regret that I had left.
Our construct, i say "our" because it's the result of a Frankenstein-like work since i have used scattered building blocks from the net that lent themselves to my purpose, and with a pinch of subjective fantasy and your help, i have finally solved it. Below, i attach the three blocks that conclude my intent. Thanks again.



1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.