First of all, to install Kotlin, then how to install in Android Studio, the steps are as follows:
The installation is complete, and then the Kotlin is added to our project.
Android Studio has one-click Configuration features:
appear after click
appear after click
Click OK, and the following code will be added to the Gradle:
Then rebuild the project and use it, then for the project that you have created
We can convert Java code to Kotlin, one-click Conversion method is as follows
However, it is important to note that not all Java code can be converted this way, some of the more complex may be problematic, and due to some of the features of Kotlin, if the conversion directly, it may also cause the app to flash back.
The following is a brief introduction to some of the Kotlin's syntax and features:
Let's start by introducing the next-to-null security, which needs to be noted during programming:
Android Studio installation and configuration Kotlin