官术网_书友最值得收藏!

Kotlin under the hood

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:

  • A file with a .java extension contains Java code
  • A file with a .kt extension contains Kotlin code
  • A file with a .class extension contains Java bytecode
  • A file with a .dex extension contains Dalvik bytecode
  • A file with a .apk extension contains the AndroidManifest file, resources, and .dex file

For 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.

主站蜘蛛池模板: 靖远县| 通州市| 无棣县| 皮山县| 潞西市| 石渠县| 上栗县| 松原市| 崇信县| 四会市| 颍上县| 清涧县| 唐山市| 克拉玛依市| 武功县| 曲沃县| 岫岩| 苍南县| 陕西省| 青州市| 连平县| 察隅县| 通州区| 金溪县| 长乐市| 沅陵县| 城口县| 崇州市| 瑞丽市| 儋州市| 灌南县| 花莲市| 塘沽区| 深州市| 获嘉县| 上虞市| 区。| 达日县| 聂拉木县| 浦北县| 邹城市|