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

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.

主站蜘蛛池模板: 红河县| 和平县| 顺昌县| 堆龙德庆县| 安阳市| 虹口区| 集安市| 元朗区| 海原县| 华安县| 玛纳斯县| 汉川市| 锡林郭勒盟| 青海省| 南陵县| 宁南县| 莱芜市| 安康市| 海城市| 遂宁市| 外汇| 溧水县| 黑河市| 齐河县| 内黄县| 监利县| 米泉市| 汾西县| 上杭县| 乌兰浩特市| 青海省| 平武县| 许昌县| 遵化市| 波密县| 西林县| 洞头县| 广平县| 通海县| 应城市| 罗城|