DEV Community

Discussion on: Maximizing Code Sharing between Android and iOS with Kotlin Multiplatform

Collapse
 
kuuurt profile image
Kurt Renzo Acosta

You got that right. This is because of K/N. Once Multithreaded Coroutines come out on Native, we can implement switching threads. :)

Collapse
 
pablodesiderioflores profile image
Pablo

Hey Kurt, thanks for the really well written article. I'm wondering,
how or why the ui is not causing visible "jank" or not getting android.os.NetworkOnMainThreadException for network calls if everything is on the main thread like Petar said?

Thread Thread
 
kuuurt profile image
Kurt Renzo Acosta

Thanks! You can take a look a this.

Thread Thread
 
pablodesiderioflores profile image
Pablo

But we cannot use with context dispatcher.io with kn as I read kn doesn't have multi threaded coroutines. My question is how the main thread doesn't get block? For example, I need to retrieve and save data from sqlDelight, Android and iOS. Database actions can be long running operations, if kotlin native just accepts kotlin coroutines single thread, so I cannot use dispatcher.io how can I do that?