Hey fellow programmers,
I recently jumped from my normal python programming to Kotlin programming in Android Studio.
In python I have generated some dictionaries that contain strings as keys and tuples as values. These tuples theirselves then contain an int, two strings and again two ints. Imagine this simplified dict:
dict = {"key" : (1,"firstString","secondString",2,0),
"secondKey":(0,"firstString","secondString",4,1)}
Now comes the scary part: I would like to import my dicts into normal variables/ vals in Kotlin.
Therefore I put all four dicts I have in a text file in the res folder. The difficulty for me is both declaring the val of the appropriate data structure and then actually loading the key-value-pairs step by step into the val. All Kotlin tutorials seem to come to an end when diving this deep into their data structures.
Am I right in guessing I should have a hashmap for the dicts themselves and then a(n array) list for the tuples? Got even stuck when trying to declare that complex structure:
val importedDict: HashMap<String,Array<Integer,String,String,Integer>> = hashMapOf<String,Array<Int,String,String,Int>()
as there just seemed to be no valid data structure of multiple types in Kotlin.
I'm thankful for any hint you can give.