Hi All, Is it possible to use existing android pro...
# multiplatform
m
Hi All, Is it possible to use existing android project for multiplatform project to share my network layer between android and ios.
đźš« 2
f
Hi, i would add multiplatform module to your project and then put all shared code in there
m
@Foso I don't get you
c
MPP doesn’t translate Android JVM code from one platform to another. But if you have common code written in Kotlin, it can be compiled to both Android and iOS. So you can move anything written in Kotlin that doesn’t have any JVM dependencies to a common sourceset and use it immediately on iOS. Your networking code will likely take some rework to use something like ktor as a MPP-compatible HTTP client
m
@Casey Brooks thanks for your reply, i know i need to use ktor-client instead of retrofit. i will do those rework stuff. so there is a possibility. can you share any documents on configuration of MPP on android project. I have seen lot of post on setting up MPP. but i haven't seen any post that meets my requirement.