If anyone is having problems using this with Array of objects. Here is the solution. Use: val request: List = Gson().fromJson(inputStreamReader, Array::class.java).toList(). And updateUI function should be: private fun updateUI(request: List). In updateUI function you need to for loop your list. Sorry for bad explanation, but hopefully this helps someone out.
It was missing a couple thing such as, if there is no internet the app shouldn't crash, fetching intervals, and it should stop fetching when the page is on the background but still this is great. : )
This is a great video, super useful. Quick q - if this strategy were used to return info where each var in Currency had the same name, then how might you change the approach plz. I'm trying to adapt it to my own stuff but getting a bit stuck.
If they all have the same name then I believe you can put them into an array. This is in Java bit I believe it's what you are trying to do howtodoinjava.com/gson/gson-parse-json-array/
I studied IT in university, graduated in 2016. but that was really only a very basic understanding of java. Since then it's been self learning. I find i learn best by doing. and when i get stuck I google it, if theres a youtube video on the topic great otherwise stack overflow has some great information. Also the more time you spend programming the easier it is to swap languages, fundamentals of programming do not change in any programming language only syntax.