Learn how to use button in android using Kotlin

Introduction

As we all know Google has announced Kotlin as the official language of Android. Now for noobs, this is a completely new thing. Let’s get started with basics of it. So in this, we will learn how to use simple Button in android using Kotlin language.



Follow all steps to create a new android project as shown in above video. Now if you are using Android Studio 3.0 then no need for these following steps, you can just skip. But for those who are using Android studio, less than 3.0 have to put some extra effort to convert JAVA to KOTLIN. For doing this you can use ctrl+shift+a, you will get the search bar. In that start typing java to convert kotlin and click on the first item.

I hope you have now successfully converted your JAVA to KOTLIN, now go to app Gradle file add kotlin android extension to your project, add as shown in above code segment. After that do not forget to import kotlin resources in your main activity file.

Follow the video tutorial and source code given above and let me know your result by your comment below.

Click on the Bell icon and stay updated with with latest tech news and tutorials.

Leave a Reply

Your email address will not be published. Required fields are marked *