On the evening of June 2, 2021, Huawei officially launched HarmonyOS 2 and a number of new HarmonyOS 2 products. As a user of Huawei products, I am very excited to hear this news. We do not lie about hongmeng system. Today I just want to try to run Hello World with Hongmeng system for the first time.

1. Download and install DevEco Studio

IDEA is a commonly used development environment in enterprises. HUAWEI DevEco Studio (DevEco Studio for short) is a one-stop integrated development environment (IDE) for HUAWEI terminals in all scenarios and multiple devices built based on the open source version of IntelliJ IDEA Community. HarmonyOS provides E2E application development services for developers to create, develop, compile, debug, and publish project templates. DevEco Studio is a dedicated platform for hongmeng application development. Click the link on the official website to download Windows or Mac system, and install it step by step as shown below. You can also refer to the official documentation for download and installation

1.1 Download DevEco Studio based on the system

1.2 Click exe to start installation

1.3 Selecting an installation path

1.4 Creating Desktop Shortcuts

1.5 Click Next to start installation

1.6 The development tool is installed successfully

Hongmeng development tool has been installed successfully

2. Install and configure the HarmonyOS SDK

We know that Java development requires JDK, android development requires SDK, and Hongmon application development is no exception. You need to download and configure HarmonyOS SDK. Here is how to install and configure HarmonyOS SDK. You can choose to install the SDK. We won’t go into more details, but here are two ways to install the SDK in common development tools

2.1 Open DevEco Studio development tool Settings

The HarmonyOS SDK option is entered by default:

2.2 The first method of installing the SDK

Configure the installation directory:SDK configuration confirmation information:Accept hongmeng SDK agreement:Start downloading:The first way to download completion:

2.3 Second SDK download method (simpler, suitable for first-time programmers)

3. Create the HarmonyOS project

3.1 Newly-built Hongmeng Project

3.2 Selecting a required engineering template

3.3 Filling in and Configuring Engineering Information

Here we can select the project type, whether it is a business or an application, and the application icon will appear on the desktop after the application runs (see Figure 1).

3.4 Hongmeng Application Project is completed

3.5 Configuring the Hongmeng Application Welcome Page and Application name

HongMeng engineering default is Chinese system, configuration of the Chinese “Hello, World” (see figure 2), you can change the SRC/main/resources/useful/element/string. The json file, display “Hello World”

4. Log in to the Huawei Developer Alliance account

The Hongmeng application runs on the virtual devices provided by Huawei. You can use the virtual devices provided by Huawei only after logging in to the Huawei account

4.1 Choose Tools >Device Manager

4.2 Your virtual appliance

I recommend using Firefox or Internet Explorer for the first time and Google Chrome for the second. Click Login after the jump to computer default browser, the official is recommended to use Google browser, log in for the first time I open the Google browser, and Login authorization according to success, but there is no display the available development tools of virtual devices, tried many times is not successful, I will send the address Login kao to firefox browser Login authorization is successful, it appeared a virtual device, After logging in, it is also possible to log in using Google Chrome

4.3 Scan or Log in to a Huawei Mobile phone using your account or password

If you log in for the first time, you need to authenticate with your real name. It is recommended to use a bank card because it is faster, and you will use a bank card without amount for fear of information security

4.4 Authorize DevEco Studio after login

4.5 Successful Login

4.6 If a virtual device is available, click the Play icon to enable it

4.7 The Virtual Device is started successfully

Here, we just build a good hongmeng application running environment, virtual equipment is also essential to run Hongmeng application

5. Run the Create Harmony application

5.1 Click the play icon in the upper right corner to run the Hongmeng application

5.2 Running Results

The first run is the default Chinese configuration hello, world, can be modified through the steps in the figureAfter modification, play icon in upper right corner to run hongmeng application again:

5.3 Images of Other Virtual Devices running Hongmeng Applications

Wear:

MatePad:

TV:

6. Summary

Step by step, running a Hello World Hongmeng application is not too difficult. There are a few points to note:

2) Configuring THE HONGmeng SDK is an indispensable step for running the Hongmeng application. 3) Running the remote virtual device is not equal to running the Hongmeng application. It is necessary to run the Hongmeng application project after running the remote virtual device