Kotlin/Native and Multiplatform · Shared Presenter from Android | raywenderlich.com

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1304635-kotlin-native-and-multiplatform/lessons/22

Hi Joe, I noticed a small problem with the sample code: The MainActivity’s Toast with errorMessage should be done within runOnUiThread {}

Thanks and nice catch on that, @jshvarts! We stuck too close to the happy path here, so did not hit that issue directly. We’ll fix that when we update the course as Kotlin Multiplatform matures. Thanks again!

Hi @macsimus , First off, thanks for such a great course. Quality is impressive. I tried to download the material from this lesson. Build and Run, but for some reason, I’m getting “No Members” I don’t know why. I suppose that maybe It’s because still in beta, but I just wanted to ask if you faced a similar issue. Many thanks!

@macsimus Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hi @skydhax thanks for the question! I downloaded the materials for this video, built the shared code, then ran the Android app. I do see the “No Members” toast briefly, then I see the second Toast with the downloaded members from GitHub.

This is just a consequence of the way we’ve setup the repository and used coroutines to show data in the view. In a later video you’ll see the members in a RecyclerView on Android.

In a production app, you’d cache the downloaded members locally and the user would see those initially, then they’d see new members in the list when the network call completes. We hope to do some videos on SQLDelight soon that will show how to cache data via the shared code.

Thanks again for the question!

Many thanks for the explanation @macsimus It’s interesting how corutines works. I’m an iOS developer, but I’m definitely going to study kotlin and corutines. Excellent course!