
This was no easy task and required quite some investigation at start.Ī first obstacle Meta engineers had to overcome came from several internal optimization tools in use at Meta that did not work properly with Kotlin. It was also clear to Kotlin engineers that they had to port to Kotlin as much of their Java codebase as possible, mostly to prevent Java null pointers from creeping into the Kotlin codebase and to reduce the remaining Java code requiring maintenance. Meta's decision to adopt Kotlin for their Android apps was motivated by Kotlin advantages over Java, including nullability and functional programming support, shorter code, and the possibility of creating domain specific languages. In the process, they have learned a number of lessons of general interest and developed a few useful approaches, explains Meta engineer Omer Strulovich.

The below is the screen shot of first screen of new Android Project Creation Window with an option to include Kotlin Support to the entire project.Meta has been at work to port their Android codebase from Java to Kotlin. Tick checkbox Include Kotlin support to get kotlin support for the entire project.

Official Source :: Convert to Kotlin From JAVA You can check Don't show this dialog next time, which makes it easy to dump Java code snippets into your Kotlin files. Or, create a new Kotlin file (File > New > Kotlin File/Class), and then paste your Java code into that file-when prompted, click Yes to convert the code to Kotlin. In Android Studio 3.0, open a Java file and select Code > Convert Java File to Kotlin File.

Kotlin is fully supported from Android Studio 3.0 (i.e, NO Kotlin Plugin required).
