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鈥檚 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鈥檒l 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鈥檓 getting 鈥淣o Members鈥 I don鈥檛 know why. I suppose that maybe It鈥檚 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 鈥淣o Members鈥 toast briefly, then I see the second Toast with the downloaded members from GitHub.

This is just a consequence of the way we鈥檝e setup the repository and used coroutines to show data in the view. In a later video you鈥檒l see the members in a RecyclerView on Android.

In a production app, you鈥檇 cache the downloaded members locally and the user would see those initially, then they鈥檇 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鈥檚 interesting how corutines works. I鈥檓 an iOS developer, but I鈥檓 definitely going to study kotlin and corutines. Excellent course!