Leeson1 : How to create Project and test a simple button [android studio with Kotlin]


   



    Firstly, you should not be bored when learning this lesson, especially if you are a beginner. Secondly, there is an illustrative and practical video accompanying the written lesson if you do not want to read. Finanally, read the lesson step by step carefully and have a good start.


    Step1 : Create a new project :


- Go to File --> New Project


- Choose the app style "Basic Activity"


- Change the app Name (MyNewApp) and package Name (app.companyname.mynewapp)


- Done, wait a few minutes to create the project files.


   Step2 : The App design : 


- Go to "App" in the left side and click on "res" aftre that click on "contentmain.xml", a new window will appear in the right side.
- In the "palette" window click on "Common", move the "TextView" to layout space, do the same thing for the button.



- After that click on "Text" menu in the bottom of "contentmain.xml" window, we get the zone of code to change the compenent attributes (color, text, sizes, id...).



- All we in this moment is to change the identification and text of compenents 



   Step3 : The App code :


    All is well? Lets type the code, go to "App" in the left side and click on "java" and click on "MainActivity.kt" file. In main activity you will put the code.

- In the "onCreate" function, create two variable "txt1" for the TextView use and "btn1" for the Button use.
- after that we can use any TextView and Button Events.
- The Event we want to do is click on Button to show text in TextView using " setOnClickListener  "


   Step4 : Run app and Test :

- We need to show results to check the code.
- Click on run button "green triangle" in the bottom window




-VIDEO TUTORIAL: