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

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.

主站蜘蛛池模板: 鹤峰县| 武平县| 遵义市| 远安县| 微博| 平武县| 仙居县| 泸州市| 辽中县| 察隅县| 隆化县| 洛宁县| 榕江县| 堆龙德庆县| 淮北市| 安远县| 霍州市| 双鸭山市| 黄梅县| 龙口市| 商河县| 凤山县| 三门峡市| 从化市| 三门峡市| 淮滨县| 建德市| 文成县| 英超| 柯坪县| 威远县| 灵台县| 威远县| 汶上县| 清水河县| 建湖县| 吴旗县| 洛阳市| 华阴市| 长乐市| 梁河县|