Learning goals

  • Download and install Android Studio
  • Understand the Android Studio development environment
  • Hello World App

Download and install Android Studio

Official website download page:

System requirements:

The official version of Android Studio is 2020.3.1, which can be downloaded from Baidu.com:

Link: pan.baidu.com/s/1KYfgW1x2… Extraction code: JASQ

Once the package is downloaded, you can click Install, and the Android Studio installation process is the same as installing a regular Mac or Windows application.

Related websites

The Android Studio’s official website

Android Studio Project Site

User Guide

Android Studio Chinese Community

Introduced the Android Studio

Setup wizard

When you open Android Studio for the first time, a setup wizard is launched, usually selecting the default options, going Next, and then clicking Finish.

Creating a new project

1. Click open Android Studio and select New Project to create a New Project.

2. In the Phone and Tablet template, select create an Empty screen for Activity (default) and click Next.

3. Fill in basic information of the project. Name indicates the Name of the application, Package Name indicates the Name of the application Package, Save Location indicates the location where the project is saved, and Language indicates the programming Language used. You can choose Java or Kotlin. The Minimum SDK is the Minimum SDK version supported by the application. When complete, click Finish.

4. Wait for the resource download to complete. Once in Android Studio, the project will also need to download some resource files, so it will take a while for the necessary resource downloads to complete.

Interface is introduced

Commonly used Settings

Hello World App

Project Catalog Introduction

The outermost directory is the HelloWorld project directory. A project can have multiple app modules or libary modules. The app module is the application module, which can be run on the phone. For example, build script build.gradle.

The app module stores the files related to the application, SRC stores the source code of the application, and MainActivity is an activity that represents an interface of the application. The AndroidManifest file is an application index file, which configudes the components used by the application, such as activities and services. This is where our MainActivity, MainActivity, is configured. Intent-filter is an enable-filter configuration. When we start an application, we need to confirm which activity to start. Action is the MAIN entry of the application, and category is the LAUNCHER. When the app icon is clicked, it launches a MainActivity.

The res directory stores the resource files of APP module, including pictures, page layout files, string files and so on. Activity_main.xml is the layout file for MainActivity, which is specified by code in mainActivity.java. Activity_main.xml puts a TextView control in the middle of the screen that says “Hello World!” A string. We can see what the interface looks like in the preview on the right.

Creating emulators

We can link the mobile phone through the computer and run the application on the mobile phone. We can also create an Android mobile phone simulator and run the application on the simulator.We can find AVD Manager in the toolbar in the upper right corner and click Start.

Run the Hello World App

In the toolbar, there is a green triangle for the start application button. On the right side of the triangle, you can select running modules and running devices.As shown above, clicking the Apply button will run the app on the emulator named Pixel 2 API 30. The running effect is as follows:

At this point, we have completed the development and running of our first Android App!