Which is better to use for API calls Dispatcher.IO or Dispatcher.Main?

Hei, I am using a MVVM archetectural patern in my android application. I wanted to have api calls from my Viewmodel using coroutinescope.lauch{} Do I need to specify the Dispatcher as Dispatcher.IO as it will be exicuted in a IO thread or just use the Dispathcer provided by the viewmodel which is Dispatcher.Main >Solution :… Read More Which is better to use for API calls Dispatcher.IO or Dispatcher.Main?

Should Data Transfer Objects (DTOs) be used to bind UI too?

My question is simple: I have a large Data Transfer Object like: data class Terminal( @Expose @SerializedName("inspector_code") var inspectorCode:String, @Expose @SerializedName("inspector_id") var inspectorId:Long [x50] ) Most of them are used for the business logic, for http requests, transaction verifying, few of them are used for the UI. Should this type of DTO be used in… Read More Should Data Transfer Objects (DTOs) be used to bind UI too?