Android uses kotlin to implement a simple login interface

Kotlin is a static type programming language running on the Java virtual machine. It is called swift in the Android world. It is designed, developed and open source by JetBrains.

Kotlin can be compiled into Java bytecode or JavaScript to run on devices without JVM.

In Google I / O 2017, Google announced that kotlin has become the official development language of Android.

On the first day when I first came into contact with kotlin, I imitated the login interface of QQ and first wrote a simple login interface. Although I am not very familiar with it and am still slowly exploring it, kotlin is really simple. The author's implementation results are as follows:

The login interface code is as follows:

The effect achieved is the same as that achieved by setting the layout file, but compared with using the layout file, using kotlin will be more concise and clear, eliminating the operations of defining variables and finding the layout file, which greatly liberates our programmers;

The following code shows the layout effect realized by the author using the layout file. It is the same as the above effect, but it will be much more complex. You can experience it yourself;

summary

The above is what Xiaobian introduced to you. Android kotlin implements a simple login interface. I hope it will help you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>