-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Android Development with Kotlin
By :

We will focus mainly on Android, but keep in mind that Kotlin can be compiled to multiple platforms. Kotlin code can be compiled to Java bytecode and then to Dalvik bytecode. Here is the simplified version of the Kotlin build process for the Android platform:
.java
extension contains Java code.kt
extension contains Kotlin code.class
extension contains Java bytecode.dex
extension contains Dalvik bytecode.apk
extension contains the AndroidManifest
file, resources, and .dex
fileFor pure Kotlin projects, only the Kotlin compiler will be used, but Kotlin also supports cross-language projects, where we can use Kotlin together with Java in the same Android project. In such cases, both compilers are used to compile the Android application and the result will be merged at the class level.
The Kotlin standard library (stdlib) is a very small library that is distributed together with Kotlin. It is required to run applications written in Kotlin and it is added automatically to our application during the build process.
In Kotlin 1.1, kotlin-runtime
was required to run applications written in Kotlin. In fact, in Kotlin 1.1 there were two artifacts (kotlin-runtime
and kotlin-stdlib
) that shared a lot of Kotlin packages. To reduce the amount of confusion, both the artifacts will be merged into a single artifact (kotlin-stdlib
) in the upcoming 1.2 version of Kotlin. Starting from Kotlin 1.2, kotlin-stdlib
is required to run applications written in Kotlin.
The Kotlin standard library provides essential elements required for everyday work with Kotlin. These include: