Introduction: Due to the business needs of the company, Kotlin will be used in the future. I will record the process of learning Kotlin in Nuggets. In my opinion, every language is born to solve some problem, and Kotlin is no exception. Let’s walk into Kotlin’s world

What is Kotlin?

Kotlin is a static programming language for modern multi-platform applications, developed by JetBrains. Kotlin can be compiled to Java bytecode or JavaScript, making it easy to run on devices without a JVM. In addition, Kotlin can compile binary code to run directly on machines such as embedded devices or iOS. Kotlin has become the official Supported development language for Android.

Why use Kotlin first for Android development?
  • Expressive and concise: You can do more with less code. Express your ideas and write less boilerplate code. 67% of professional developers who use Kotlin report increased productivity.
  • Safer code: Kotlin has a number of language features that can help you avoid common programming errors like null pointer exceptions. Android apps that contain Kotlin’s code are 20% less likely to crash.
  • Interoperable: You can call Java code in Kotlin code, or Kotlin code in Java code. Kotlin is fully interoperable with the Java programming language, so you can add as much Kotlin code to your project as you need.
  • Structured concurrency: Kotlin coroutines make asynchronous code as easy to use as blocking code. Coroutines can greatly simplify the management of background tasks, such as network calls and local data access.
How does Kotlin relate to the JVM?

Tool installation and environment configuration

1. Install tools and configure the environment

Install Android Studio, download the Android SDK, Kolint development environment configuration: a. ndroid Studio download official website b. Download the Java development kit (JDK, download address: www.oracle.com/java/techno…

Create a project after downloading the SDK: Select the template: Phone and Tablet — > Bottom Navigation ActivityE. After the configuration is complete — > Finish — > Download the dependent libraryF. Display the coding page

V. Introduce the project structure

Vi. Practice: Build the first Apk

Select Build — >Build Bundle(s)/APK(s) — >Build APK(s) to generate the installation package

Reference: developer. The android. Google. Cn