适用于初学者的Android Hello World Kotlin应用程序

本文向初学者介绍了如何使用Kotlin在Android Studio中创建Hello World应用程序。从选择活动类型、理解项目结构到编写基本的Kotlin代码,逐步指导完成简单应用的构建,帮助开发者入门Android开发。
摘要由CSDN通过智能技术生成

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

您需要安装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

从下一个屏幕中选择活动类型。

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)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值