Create First Android App in Kotlin

Hi I thought you all Intall the Android Studio. Make sure your Android Studio is latest version (3.0.1) This version of Android Studio support Kotlin language.

  1. Start Android Studio and select Start new Project.
     
  2. Then add the Project name and selected the name of Company (or your name to give the unique identification of your project ) and then set the address of project you want to store and the select the kotlin support check box then click on Next Button.

    3. In this Phase you select which android Platform your app support. Select  from the option and then press Next Button.


     4. Now in this phase You select which type of Android application you want to create click on that type of application and then click on Next Button.


    5. This is last phase where you can add the name of file and Click on Finish Button. After that IDE take time to setup your project and make make Regarding your Project.



    After Some time it show IDE show this type of Environment to you. 



    This show two files on your IDE one is ManiActivity.kt that contain the coding part for the Android App. and Another one is activity_main.xml for the designing of the Android app or You can say thta view part of Android Application.

    Now we start the coding section for our first Android Application in Kotlin Language.

    Now we start FIRST from view Part put my following code into your xml  file.

       
In this XML file we use  Root Tag as Relative Layout  maintain the design of app.
In Relative Tag i used Button tag. In that Tag i used Some Properties of Button tag like Height, width, text and ID. these are compulsory for Button tag. ID gives the Unique Identification of the view in your Android App. and Height and Width give the size of Button according to you. 


  • Now we move to Coding Part of Kotlin in that part we declare the Button in that file and Apply click listener on that Button and print some message to know that Button work or not. Using Following code :- 


  • Run your app and it shows the following output




I hope this help you. for basic starting to make Android App in Kotlin Language using Android Studio.

Comments

AddThis