-4

eg: details about the questions ..i have a android app project using Kotlin. 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?

Debendra
  • 35
  • 2
  • 13
  • You can't use any Java code in the shared/iOS part. Shared code can only be written in Kotlin, there's no way you just can make your android app work on iOS. No UI code can be reused, only data/network layers. Read any articles or documentation for more information. – Phil Dukhov Feb 26 '22 at 03:42
  • Ok then How can i make my kotlin project work on ios app. – Debendra Feb 26 '22 at 06:24

1 Answers1

2

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

dawoud
  • 104
  • 1
  • 6