Json To Dictionary Extension
Release date : 2020-10-24T23:00:00Z
Last Update Date : 2020-10-24T23:00:00Z
Current Version: 1
Min. Api version : 1 ( Works on every android version )
Ending Date : ( When kodular add it as a built in block )
Hello, every one ! Today i release my very first extension ! Json To Dictionary , i actually made it after seeing this topic : Request for JSON decode to dictionary, to parse json text to dictionaries till kodular bring this block , @WatermelonIce and @The_K_Studio requested me to share it in a new topic ( actually i didn’t release it because i thought it would be added in one week or something ) , but until this block is here, you can feel free to use my extension There are some other possible ways with kodular’s built in blocks : Kodular has removed Json component? But it might return wrong results as in this thread: JSON text decode problem, i actually published the extension here before : Request for JSON decode to dictionary in 2020-08-03T23:00:00Z, but now i rewritten and optimize the code a lot, so it works more properly.
Just 2 blocks
Decodes the given JSON text into appinventor dictionary.
Returns: Object ( a list of dictionaries if it was a JSON array, an empty string if there was an error, a dictionary if it was a normal JSON.
jsonText (String): The json text to decode.
Fired when an error occurs while decoding the JSON text.
error Message (String): The error that occurred.
How to use it?
Here is an example with a json api ( http://worldtimeapi.org/ ) about how to use it:
P.S: the clock just for updating the time, the error occurred event is used to detect that the web component threw an error, for ex: there was no internet connection.
Don’t know about dictionaries?
Dictionaries are much powerful then lists and it’s really useful for JSON apis, if you don’t know about Dictionaries, go and check this guide:
AIX : io.mohamed.JsonToDictionary.aix (6.3 KB)
How it works with a json api ( http://worldtimeapi.org/ ):
I hope you liked this extension! I would like to thank
@The_K_Studio @WatermelonIce for asking me to release it in a new topic
@AI2 for their JsonUtils class , which i have used in my extension.
And any one who liked this extension , too!
Also for for this amazing platform
Actually that was my very first extension ( it was released almost 3 months ago) so i’m sorry if it have any bugs If there is any, please report it here
Note: this extension would be obsolete when kodular implement it as a block.It won’t cause any conflict but it would be no longer useful.