We can build an android application using Kotlin and Java. In the tutorials, we are using Kotlin language to build the application. In previous tutorial, we learned how to create a project for Kotlin language but here, we will learn how to run an application using the AVD (Android Virtual Device).
We obtain two files when we launch the project, which are:
MainActivity.kt– This is Kotlin file and used to code in Kotlin language.
activity_main.xml– This is xml file and used for the layout of our main activity.
There are enormous number of activities in the Android application. For each of the activity we require a separate Kotlin file to write the code. All the functionalities are added like onclick, onCreate etc.
Kotlin code –
For each activity there is separate xml file to specify the design or layout of our activities. Hence, there are number of functioning like we can adjust button to the top or bottom and make text bold or italic etc.
XML code –
Run as an Emulator
We made some changes in our Kotlin and xml files and then we can run our application using an emulator. It seems to be like below:-
- Hello World program in Kotlin
- How to Create a Dark Mode for a Custom Android App in Kotlin?
- 8 Must-Have Skills for Becoming an Android App Developer
- How to Create Static Shortcuts in Android App?
- How to Create a Basic Widget of an Android App?
- How to Create a Dynamic Widget of an Android App?
- How to Adjust the Volume of Android Phone Programmatically from the App?
- Kotlin Data Types
- Kotlin | Retrieve Collection Parts
- Destructuring Declarations in Kotlin
- DatePicker in Kotlin
- Kotlin labeled continue
- Introduction to Kotlin
- Kotlin Type Conversion
- Kotlin Exception Handling | try, catch, throw and finally
- Kotlin if-else expression
- Kotlin Environment setup for Command Line
- Kotlin constructor
- Kotlin Environment setup with Intellij IDEA
- Kotlin Nested class and Inner class
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.