Hey, QQ: we have 2 android directories, one the an...
# multiplatform
r
Hey, QQ: we have 2 android directories, one the android app, and one in the shared directory, how to decide which classes goes where?
v
Android directory(module) is androidApp. shared is KMP directory(module). We put everything we can into shared. The android app as dull as possible
p
It really depends on why you do multiplatform. Which other targets do you support?
r
@Paul Woitaschek iOS
@Vlad yeah that makes senes ,thank you!
p
Then it still depends. Can you give an example what mind of code you want to add?
r
so the story is that I already have an Android project that i started migrating into a KMM project so I can release it on iOS as well I started questioning it once i wanted to move the datastore class, and wasn’t sure if this should be in the android module or the shared module since its android specific and I’m going to implement something else on iOS (native data store)
p
In this case I'd move it to Android. If each platform gets its own implementation for something, it makes more sense there. • People will see it in androidMain and immediately know it's only Android • People will actively search for an iOS counterpart when trying to understand the code. That's good • You won't increase the iOS binary size. That's also good. We have already hit size 75mb (or was it 50mb)? Framework limit once.
r
in Android you mean androidApp module or android directory in shared module?
p
Do you have a monorepo?
r
you mean single repository for the whole project android and iOS?
p
Yup
r
yes
p
Then I'd make it dependant on where the iOS implementation is going to live
In Swift - in the Android folder In iosMain - in the shared folder
r
probably iosMain
then yeah I’m going with the shared folder
p
👌