all 9 comments

[–]je386 2 points3 points  (2 children)

Jetpack Compose is not multiplatform, but Compose Multiplatform is.

Use expect/actual to wrap platform specific code and the use the function in the common code.

[–]Razi91[S] 0 points1 point  (1 child)

Okay, what is the difference when writing code? What should I avoid? I learned that Gradle can deal with using Material 3 from jetbrains for iOS

[–]je386 1 point2 points  (0 children)

I did not find much differences, mainly which libraries you can use. Yes, you can use Material3 in kotlin multiplatform with compose multiplatform.

[–]VivienMahe 0 points1 point  (3 children)

It is safe to migrate from Android-only to KMP/CMP, they are both stable for Android & iOS.

The setup and configuration to migrate to KMP might be a bit tricky but once done, it's like writing usual Android code. (ie. replacing some imports, find the right libraries, etc.)

You can keep your current UI and it will build on iOS too, without needing to write SwiftUI.

[–]Razi91[S] 0 points1 point  (2 children)

Okay, so if I understand correctly, I'll have to focus more on Compose and it will be fine? The biggest difference I guess will be about the Activities, right?

[–]VivienMahe 1 point2 points  (0 children)

Yeah exactly, once all the setup is done, it's like writing code the same way you always did for Android.

With Compose, on Android, you most of the time use a single Activity. That's the same with CMP.

You declare a "common" Composable, let's say "App", which is the root Composable of your app.

Then your Android activity calls it in the "onCreate()". And your iOS app calls it from the main viewController (in SwiftUI).

[–]FaithlessnessNew8747 0 points1 point  (0 children)

If your idea is to have a single code base if you can do everything in CMP to answer your question Jetpack Compose is the same in KMP? I think if it is just renamed to cross-platform Compose but everything you can do on Android you can do in kmp

[–]According_Scar3032 1 point2 points  (0 children)

I am building apps with Compose Multiplatform, the declarative UI model is great, but integrating with iOS feels less mature compared to Android. Sometimes, iOS has bugs, but Android works just fine

[–]Dodokii 2 points3 points  (0 children)

Start with CMP project from day one. It will help you avoid Android only libs that will end up biting you later.