Creating a dictonary in extension

Hello all i wanted to make a dictonary in extension like this

but i know it would not be a good idea to initialize a dictonary with arrangements
so i have thought about to use the set value for key block to set value of key to arrangements after the arrangement is created. but i don't know how to define a dictonary and use set key, get key methods in an extension

Use Hashtable/HashMap classes, they do something like dictionaries.See also , their documentaion:

HashMap:
https://developer.android.com/reference/java/util/HashMap
Hastable:
https://developer.android.com/reference/java/util/Hashtable

1 Like

Don't use a Hashtable. Use a HashMap. YailDictionary is the concrete type that backs dictionaries in the blocks language is also a subclass of HashMap. The App Inventor runtime will convert between a standard HashMap and a YailDictionary automatically.

1 Like