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 )
Description
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? - #21 by Peter 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 - #2 by Mohamed_Tamer in 2020-08-03T23:00:00Z, but now i rewritten and optimize the code a lot, so it works more properly.
Blocks
Just 2 blocks
Documentation
JsonTextDecodeWithDictionaries
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.
Error
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:
Download Links
AIX : io.mohamed.JsonToDictionary.aix (6.3 KB)
How it works with a json api ( http://worldtimeapi.org/ ):
AIA : JsonTextDecodeWithDictionaries.aia (49.8 KB)
APK: JsonTextDecodeWithDictionaries.apk (5.5 MB)
Credits
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.
Thanks!
Mohamed Tamer