https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

Sven Kellgren

11/15/2023, 10:33 PM
Hello! I've started a new project using the kmm plugin. The question I have is where to organize the code (models, views, etc.) ? I have a directory called "androidApp" which has the MainActivity as well as the android-manifest file. Then I have a directory called "shared" where I have the androidMain, commonMain, and iosMain folders. I suppose I keep all the views in the androidApp/src/main/java directory and as much logic in the shared/src/commonMain as possible?
a

Alejandro Rios

11/15/2023, 10:58 PM
If you're not using Compose multiplatform, then that approach is correct.
s

Sven Kellgren

11/16/2023, 10:17 AM
I am using it actually. Should I move the ui logic to the commonMain folder then?
a

Alejandro Rios

11/16/2023, 1:36 PM
Yes, you can do that as well, the idea is to have everything that can be shared in shared/src/commonMain