Hi All,
Is it possible to use existing android project for multiplatform project to share my network layer between android and ios.
đźš« 2
f
Foso
04/27/2020, 4:20 PM
Hi, i would add multiplatform module to your project and then put all shared code in there
m
Madhan
04/27/2020, 4:53 PM
@Foso I don't get you
c
Casey Brooks
04/27/2020, 5:13 PM
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
Madhan
04/27/2020, 5:19 PM
@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.