Hey good morning everyone. I just started a new job. Their codebase is written entirely in Java. The have several shared Java libraries, which are used for the iOS (using j2objc), Desktop and Android apps. I’d like to slowly begin converting these to Kotlin. Is it possible to create a Multiplatform project and import the old Java project(s) into it? Or is there a better solution?
j
Jurriaan Mous
06/11/2020, 12:53 PM
It is not possible to use the Java code for all multiplatform targets. That only works in JVM target and setting up something like the previous j2objc structure for iOS. For the latter you need to use the objective-c interop which can generate Kotlin interfaces for the ObjC code.
You can let the IDE help translate Java to Kotlin and improve the generated code step by step. But this is a manual process.