Hi, We have a android application (kotlin + compos...
# multiplatform
a
Hi, We have a android application (kotlin + compose) in production and we were looking ways to launch the same application in ios. I saw couple of examples in github. but all seems to have single module. could anyone help me with a structure for multi-module multiplatform app. Thanks in advance.
currently planning to compose multiplatform for sharing the ui as well.
p
Have fun with this one: https://github.com/chrisbanes/tivi
a
Thanks a lot @Pablichjenkov
πŸ‘ 1
m
There is a wizard for generating a project template: https://kmp.jetbrains.com/
a
Actually I am in processs of migrating our android application to Compose multiplatform. since it is multi-module I was kind of struck there are some choices to be made. either move all modules inside the shared module or each module has implementation for ios and android. Thanks @McEna
p
At the end pretty much everything is a module. Those repo you call "single module" are actually multi module.
shared
or
common
is an independent module from androidApp or jvmApp. And notice you can change the module names and it will still work. Here is another example perhaps less complex than tivi https://github.com/serbelga/Todometer-KMP/tree/main
πŸ‘ 1
a
thanks a ton @Pablichjenkov having a look.
b
I also have a template I’m using as well
a
Hey @Pablichjenkov , I really like the way you modularized the TodoMeter. I am curious about one point, what is the difference between the app and common modules in the main root? Is there a reason you kept them separated?
p
Thanks Andrea πŸ˜€ but I am not TodoMeters author, credit goes to Sergio Belda Galbis
πŸ‘ 1
a
Thanks @Pablichjenkov ! Sorry I did not notice it πŸ˜ƒ @Sergio Belda Galbis tagging you at this point πŸ˜ƒ
πŸ‘ 1
s
Hi Andrea,
:app
module contains the common UI code for the apps modules:
:app-android
,
:app-desktop
and
:app-ios
. I created this extra layer because I didn't want to put common app UI code in the
:common
module that would be visible for
:wearapp-wearos
module, which is a wearable app. That means that in the future I could have something like this: β€’ App:
:app-android
,
:app-desktop
and
:app-ios
->
:app
->
:common
β€’ Wearable App:
:wearapp-wearos
and
:wearapp-watchos
->
:wearapp
->
:common
a
Hi @Sergio Belda Galbis, thanks for the details, all clear! We are planning our migration and I am looking around to match our idea in terms of structure with other projects, thank you!
s
πŸ˜‰