Actually, I’ve already read this topic and tried this extension with the file component.
But the result was not good
The JSON file is in my assets.
My goal is, at the first run, to read the json file, put it in a dictionnary and store the dictionary in TinyDB.
On next runs, only have to get valur from TinyDB.
Actually, I already have a solution that works but each time I need a color I go to read the file.
And I think this method is very slow as the app has some lags.
So this is why I think that loading the json at first run to a dictionary stored in TinyDB should work better.
I have to reduce the read access, so I try to find a solution to read in memory (except for first get value from TinyDB)
AT FIRST RUN
read the json file and convert it to a dictionnary
save this dictionary to TinyDB
AT EACH RUN
set a global variable with the saved dictionary (thanks to the tinyDB get value)
read the value from the variable (with “get value for key” block)
First thanks for your help
I’m back after doing some tests.
Actually I’m facing (I think) an issue.
It seems that storing the dictionary to TinyDB takes some times and if I try to get value from it just after, the get value return nothing (maybe still doing the store value).
It is the same if I set my variable to the dictionary given with JsonTextDecodeWithDictionaries.
If I set only one variable, then the variable is ok
If I set 2 variable, the second is ok but there is nothing in the first
I put a timer to call a procedure that set the second variable and it works, but not with TinyDB method (that seems longer than just setting variables)
I just tested with the variable method (which I suspect to be quicker than getting values from Ressource Utilities component) and it is not quicker at all. I tested on my old Motorola Nexus that is very slow.
So I stay with my initial work