eg: details about the questions ..i have a android app project using JAVA. I want to make my Android application work on iOS using KMM.i haven't found any live solution yet. it would be great if you've any practical example to to make my Android application work on iOS using KMM?
CodePudding user response:
there is no magic tool to do this ...
you can follow this steps ..
first you should convert java code to kotlin code by
Android Studio Menu -> Code -> Convert Java File to Kotlin File
then you should separate your code into business layer and presentation layer
you can know about it by reading clean architecture Android
then we will put business layer
into Shared Module
then we will put presentation layer
into ANDROID APP
then application will be ready to use his business logic into ios
then you can write your swift code into IOS APP
note :
Presentation layer
contain view , viewmodel and any Platform dependent tools like workmanger
business layer
contain network
and caching
code like KTOR , SQLDELIGHT and any logic that may be shared between Android
and Ios