ignore my question, I found it what I need it `::c...
# compose-desktop
p
ignore my question, I found it what I need it
::class.simpleName
By the way, I am impressed, after just moving some Android code to the kmp project and making minor arrangements. Now the same App runs on Android, iOS, JVM, MacOS and the Browser. 🎉 Great job!!! and have a good end of the year, be safe
K 3
🎉 1
❤️ 5
🙏 2
m
I am wondering though how you got away with this by just “making minor arrangements”. According to my experience it’s a huge endeavour to convert an existing Android app to a multi-platform app due to the many Android or Java dependencies which you normally find in them.
b
I think if you remove web from that list, converting jetpack app to desktop compose is trivial.
p
@Michael Paus Well, let me be fair. Is not a huge app or anything like that. It is a simple demo App that I have been working on. I had the Jvm/Android kmp setup and now I added iOS/macOS/JS But still, it is impressive. That small demo uses coroutines with different dispatchers and is able to run in the browser over webassembly. No independent platform code or KN bridge, just pure compose and Kotlin native standard libs. My respect for JB tbh
@Big Chungus yes I am using the experimental web assembly stuff, no JavaScript bridge. I mean, as long as you stick to pure Kotlin native libraries and pure compose, it is relatively simple. Adding/using platform APIs is a different story, but still not too complicated.
m
I stick to my statement. Converting a substantial existing Android app which was not written with multi-platform in mind is not trivial. Think about resource handling, navigation, ViewModel, … The way this is typically handled on Android is completely incompatible with multi-platform Compose. It even gets worse as soon as you add, e.g., iOS to the mix because you then even loose all the Java based functionality. Just think about file IO for example. Even simple things from the Kotlin standard library don’t work anymore like, e.g., formatting a numerical string because they are not supported for native targets.
b
But op just said it was - android+desktop
p
Yes, I definitely agree, a big only-Android project is a different animal.
m
@Big Chungus Then just skip the part starting with “It even gets worse …“.
d
"Converting a substantial existing Android app which was not written with multi-platform in mind" - even as a big advocate of KMM; I wouldn't attempt to convert an established Android App. KMM rocks for green-field Mobile projects where you can architect for it. Unpicking a legacy of Android-specific libraries and concepts running throughout all layers of your App is going to hurt. Probably faster to consider it an 'accelerated re-write' at that point, with copy/paste of Domain/Presentation logic sections and not much else.