Kotlin has become the recommended and official language for android development. In this tutorial, we will learn how to create a Hello World Android app in Kotlin.
Kotlin已成为Android开发的推荐和官方语言。 在本教程中,我们将学习如何在Kotlin中创建Hello World Android应用。
创建Android Hello World Kotlin应用 (Creating Android Hello World Kotlin App)
You need Android Studio and JDK version 6 or higher installed in order to build and run an android application. If you’re unaware of Android Studio do visit this tutorial before proceeding ahead.
Let’s start building our Hello World Android Application by starting Android Studio.
![android hello world welcome screen](https://cdn.journaldev.com/wp-content/uploads/2018/01/android-hello-world-welcome-screen.png)
您需要安装Android Studio和JDK版本6或更高版本才能构建和运行android应用程序。 如果您不了解Android Studio,请先阅读本教程,然后再继续。
让我们通过启动Android Studio开始构建Hello World Android应用程序。
The package name naming appends the application name to the reverse of the company domain name. Take note that we’ve checked Include Kotlin Support so that the default classes are originally written in Kotlin (.kt).
Set the path of the project to whatever you like! (I’ve done so for mine).
程序包名称命名将应用程序名称附加到公司域名的相反名称。 请注意,我们已经选中了包括Kotlin支持,以便默认类最初是用Kotlin(.kt)编写的。
将项目的路径设置为您喜欢的任何内容! (我已经这样做了)。
Select the Target Android Devices from the next screen. You can set the minimum SDK version as per your choice.
Following are the Android OS Versions currently available:
在下一个屏幕中选择目标Android设备 。 您可以根据需要设置最低SDK版本。
以下是当前可用的Android OS版本:
- Android 1.0 and 1.1 were not publicly named. Android 1.0和1.1未公开命名。
- Cupcake: Android 1.5 纸杯蛋糕:Android 1.5
- Donut: Android 1.6 甜甜圈:Android 1.6
- Eclair: Android 2.0–2.1 埃克莱尔:Android 2.0–2.1
- Froyo: Android 2.2 Froyo:Android 2.2
- Gingerbread: Android 2.3 姜饼:Android 2.3
- Honeycomb: Android 3.0–3.2 蜂窝:Android 3.0–3.2
- Ice Cream Sandwich: Android 4.0 冰淇淋三明治:Android 4.0
- Jelly Bean: Android 4.1–4.3 果冻豆:Android 4.1–4.3
- KitKat: Android 4.4 KitKat:Android 4.4
- Lollipop: Android 5.0–5.1 棒棒糖:Android 5.0–5.1
- Marshmallow: 6.0 棉花糖:6.0
- Nougat: Android 7.0 牛轧糖:Android 7.0
- Oreo: Android 8.0 奥利奥:Android 8.0
选择活动类型 (Choosing Activity Type)
Choose the activity type from the next screen.
![android add activity](https://i-blog.csdnimg.cn/blog_migrate/80f2c30fb4fd8c36b538e1e4a7c7c421.png)
从下一个屏幕中选择活动类型。
Note: An Activity is whatever you see on a single screen in your application(At least on a high level that’s what it is)