Live data from Hacker News

Kotlin Multiplatform for Android and iOS

kotlindevelopment.com

21–30 of 38 posts

Re: Kotlin Multiplatform for Android and iOS

#21

Seems like a gimmick to me. In a nutshell this has the same limitation has Xamarin. The Business Logic is shared , but the UI Logic and the Technical Logic aren't shared or not completely. The Xamarin community has been struggling with this issue for half a decade and they ended up re-writting their own rendering engine[0] (similar to Flutter) in C# on top of Xamarin to obtain truly MVVM Cross-Platform Framework. My…

The difference is that Kotlin has first class support on Android. Aside from that I agree, Kotlin is obviously second class on iOS. IMHO for simple multi-platform projects I'd use either plain webtechs or react-native. The impedance mismatch between Kotlin and Swift/ObjC is going to be an hindrance no matter what.

Re: Kotlin Multiplatform for Android and iOS

#22
post #15

The thing that I still don't know about are how would things like data persistence be handled in a cross platform manner? I recently built a kotlin Android app for work, and our architecture is tightly coupled to Android's Room database and LiveData objects. Obviously if we build it to be cross platform we wouldn't be able to use a Room database or LiveData objects on an iOS device. Would we have to roll our own pers…

I'd suggest to use SQLite as a persistent storage. It's very fast, convenient and cross-platform.

Room/LiveData are abstractions over the persistent store but by default/in practice they abstract over SQLite.

Re: Kotlin Multiplatform for Android and iOS

#23

Looks great! My biggest concern and one of the reasons I'm not using Swift or C++ for a cross platform library is that most of the dependencies you (at least I need) need don't support those languages (Auth0, Firebase, Crashlytics etc...). So you end up writing more complex code to make that also work. If Kotlin native can bring those types of libraries to be supported it will be huge IMO.

Some of the firebase apis have c++ implementations: https://firebase.google.com/docs/cpp/setup

Yep just not the main one I need (FireStore)

Re: Kotlin Multiplatform for Android and iOS

#24
post #16
post #10

Earlier quoted context omitted.

Windows isn't a mobile platform. They tried 2.5 times and have given up. In mobile it's iOS and Android, and neither Apple nor Google recognize C# as a first-class language. If you can write a compiler that emits code that LLVM can compile to ARM binary with Xcode or package your MSIL with a micro .NET VM on Android, then more power to you but Apple and Google aren't going to help you if you get stuck.

Windows tablets, laptops and 2-1 devices are quite mobile to me.

Prerty difficult to find a good dash mount, no usb charging, bit bright at night and having to plug in an external gps unit is fairly limiting though.

Re: Kotlin Multiplatform for Android and iOS

#25

Earlier quoted context omitted.

> The main difference is that one of the vendors actually supports the language in question (Kotlin) as a first-class citizen. How is this different for Xamarin? C# has first class support on Windows.

Xamarin's "first class" support for Windows is Windows Store only though?

no.

While still in Preview, Xamarin.Forms actually supports Linux with Gtk#, Windows with WPF and UWP and Mac with Cocoa (actually Cocoa with C# does work really well).

Re: Kotlin Multiplatform for Android and iOS

#26
post #16

Earlier quoted context omitted.

Windows tablets, laptops and 2-1 devices are quite mobile to me.

Prerty difficult to find a good dash mount, no usb charging, bit bright at night and having to plug in an external gps unit is fairly limiting though.

The car computer already takes care of that.

Re: Kotlin Multiplatform for Android and iOS

#27
post #21

Seems like a gimmick to me. In a nutshell this has the same limitation has Xamarin. The Business Logic is shared , but the UI Logic and the Technical Logic aren't shared or not completely. The Xamarin community has been struggling with this issue for half a decade and they ended up re-writting their own rendering engine[0] (similar to Flutter) in C# on top of Xamarin to obtain truly MVVM Cross-Platform Framework. My…

The difference is that Kotlin has first class support on Android. Aside from that I agree, Kotlin is obviously second class on iOS. IMHO for simple multi-platform projects I'd use either plain webtechs or react-native. The impedance mismatch between Kotlin and Swift/ObjC is going to be an hindrance no matter what.

JavaScript is also an impedance mismatch.

Re: Kotlin Multiplatform for Android and iOS

#28
post #16
post #10

Earlier quoted context omitted.

Windows isn't a mobile platform. They tried 2.5 times and have given up. In mobile it's iOS and Android, and neither Apple nor Google recognize C# as a first-class language. If you can write a compiler that emits code that LLVM can compile to ARM binary with Xcode or package your MSIL with a micro .NET VM on Android, then more power to you but Apple and Google aren't going to help you if you get stuck.

Windows tablets, laptops and 2-1 devices are quite mobile to me.

[deleted]

Re: Kotlin Multiplatform for Android and iOS

#30
post #27
post #21

Earlier quoted context omitted.

The difference is that Kotlin has first class support on Android. Aside from that I agree, Kotlin is obviously second class on iOS. IMHO for simple multi-platform projects I'd use either plain webtechs or react-native. The impedance mismatch between Kotlin and Swift/ObjC is going to be an hindrance no matter what.

JavaScript is also an impedance mismatch.

> JavaScript is also an impedance mismatch.

Yet both Android and iOS allow embedding a Javascript engine in an native application with no effort whatsoever.

Post reply on HN