Hi everyone, I need to build an app for android an...
# compose
h
Hi everyone, I need to build an app for android and ios using some cross platform technology, currently considering kmm with compose multiplatform as a shared UI, are there any potential issues/blockers that I should deal with when starting and in general is it production ready technology?
m
Compose Multiplatform is really good for as a shared UI. It's stable on Android and that's pretty much straightforward; Alpha on iOS but still works great depending on the complexity of the app you're building. I’m doing something similar at the moment and I’ve gotten a few findings… • The TextField on iOS still bugs me out, I can't control the cursor by long-pressing the space bar and the keyboard keeps jumping up and down when moving from one TextField to another. • Be prepared to utilise common interface wrappers. I don't trust new libraries for production projects so I have to resort to calling platform-specific dependencies a lot. But it's cool since I already write iOS/Swift and I get to use Swift Package Manager libs. • The UI is surprisingly smooth (sometimes even smoother on my iPhone 😅. Look at this animations I did here - it feels better on my iPhone than on my Samsung (Probably because my iPhone is better though). • Make use of the popular libs with active support. Also, don't tightly couple your code with your libs, things could change at any moment. • Take advantage of your expect/actuals, they can be helpful. Also brush up on your Swift and iOS knowledge - you may find yourself having to refer to it a couple of times, especially for Compose UI/UIKit interoperability. Overall, this is my favourite cross-platform tech right now! I love the way I can gradually adopt certain features instead of all. Also, iOS should be beta this year 🎉
l
@Mofe Ejegi you mentioned that KMM is your favorite. Have you used Flutter? I ask because I'm curious if this two tecnologies are similar or one is has better features than other, this kinda of thing.
m
I've explored Flutter/Dart and to an extent, also React Native. Flutter is currently more mature than KMP and arguably a better option if you want to share your UI for a production cross-platform application. I do like KMP because of the ability to go full native UI on both platforms and share logic. Even with the shared Compose UI, I still love it because I'm heavily biased towards anything Kotlin (don't really like Dart). As an Android engineer, it also closely mirrors my Android development experience and doesn't require me to learn something Hybrid. I build native Android with Kotlin, native iOS with Swift and do MultiPlatform development with KMP, Kotlin and Swift. The perfect combo for me as a Mobile developer!