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

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.

主站蜘蛛池模板: 东至县| 安化县| 龙州县| 兰州市| 广东省| 泰宁县| 沧源| 威海市| 文水县| 济阳县| 阿合奇县| 贵港市| 青河县| 阿图什市| 沅江市| 台南市| 铜鼓县| 读书| 青阳县| 宣恩县| 益阳市| 峨眉山市| 铜鼓县| 洪泽县| 锦屏县| 若羌县| 通州区| 溧阳市| 尉氏县| 明溪县| 肥西县| 汕头市| 肇源县| 峨边| 施甸县| 海口市| 都昌县| 赣榆县| 广汉市| 湘乡市| 嘉善县|