Explain the environment configuration in kotlin Android development in detail
Explain the environment configuration in kotlin Android development in detail
Install plug-ins on Android studio
After settings - > plugins - > Browse repositories.. - > kotlin is installed, restart Android studio to take effect, as shown in the figure:
Configure kotlin in Android studio
(1) Configure it in build.gradle in the root directory. The code is as follows:
(2) Usage configured in APP / build.gradle
In this way, the configuration of kotlin has been completed. Let's write the first project Hello world
Start using the first small demo
(1) Write a textview control in the layout file. The code is as follows:
(2) We find ID assignment and use
The code of the first way to find a control is as follows:
The second method code for finding the control is as follows:
Thank you for reading, hope to help you, thank you for your support to this site!