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

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.

主站蜘蛛池模板: 胶南市| 游戏| 长丰县| 唐山市| 五台县| 鄱阳县| 桓台县| 额尔古纳市| 宜昌市| 上饶县| 海伦市| 三明市| 太康县| 平阳县| 泾源县| 蕲春县| 宜阳县| 平塘县| 漳州市| 阿克| 阿勒泰市| 新余市| 延川县| 郓城县| 龙里县| 浪卡子县| 从化市| 泽普县| 伊金霍洛旗| 毕节市| 伊金霍洛旗| 金乡县| 鹤岗市| 卢氏县| 丹巴县| 丰都县| 筠连县| 琼海市| 甘谷县| 沧源| 读书|