My Hongmeng started-development environment setup

This article will introduce the following 7 aspects

1. Download and install the development tool
2. Start the development tool, the SDK will be downloaded by default
3. Log in to the real-name certified developer account
4. Install the development language (Java will be installed by default, if you want JS development, you need to manually install Node.js)
5. Install the SDK that is not installed by default (currently the SDK has JS, Java, Native)
6. Create a project
7. Start the simulator
My other articles, you can click on my avatar to view the
original text, you can go to Yuque to search: Hongmeng, the search results row First (currently), the author: chatterzhao is the source of this article, you can also search with the account: chatterzhao
, there are some other tutorials in the document over there.

Some links in the article cannot be opened directly, you can right-click to open them.

1. Preparation

Development environment

Note: •The current IDE development is divided into device development and application development. Pay attention to the distinction when downloading. •Currently only the
Windows version, macOS version is in preparation, as of 2020.9.10, IDE version: application development is 2.0beta, device development is 1.0 beta1
•You need an account when downloading. If it’s a Huawei phone, open the phone’s settings, the account has a scan code, scan it to log in, if you have not registered a developer account, please register and real-name authentication (download IDE requires an account, To start the simulator during development, you must log in to a real-name account, and the registration entry will pop up by the way). For more installation related tutorials, please see: https://developer.harmonyos.com/cn/docs/documentation/doc-guides/software_install-0000001053582415

1. Install IDE

The DevEco in the IDE's name seems to read: Wear a button, for reference only

Device development IDE: HUAWEI DevEco Device Tool

Download link: https://device.harmonyos.com/cn/ide#download One-stop integrated development environment for smart devices (hardware), supports
on-demand customization of HarmonyOS components, one-click compilation and burning, visual debugging, and distributed capabilities Integration, etc., to help developers efficiently develop and innovate new hardware

Application development IDE: HUAWEI DevEco Studio

Download link: https://developer.harmonyos.com/cn/develop/deveco-studio#download
HUAWEI DevEco Studio (hereafter referred to as DevEco Studio) is based on the IntelliJ IDEA
Community open source version and is a one-stop site for Huawei terminals with multiple devices The integrated development environment (IDE) provides developers with E2E HarmonyOS application development services such as project template creation, development, compilation, debugging, and release. By using DevEco
Studio, developers can more efficiently develop applications with HarmonyOS distributed capabilities, thereby improving innovation efficiency.

2. Install the language according to the development language

Development languages ​​currently supported by Hongmeng platform applications: JS, JAVA, C/C++, Java language has been installed with IDE by default, if you want to use JS language for development, you need to manually install Node.js, otherwise you don't need it.

Node.js official website: https://nodejs.org/zh-cn/, it is recommended to download the long-term support version, the installation is very simple and not to mention. JS
development? Like me, everyone may have a big question mark. Here is a link to clarify a little bit: https://www.yuque.com/chatterzhao/harmony/mkhygd

The application development IDE is installed as follows:

Insert picture description here

3. SDK installation

Install the corresponding SDK if you need to develop in any language. If you want to develop with JS, in order to download the JS SDK faster, you can execute it on the command line: npm config set
registry https://mirrors.huaweicloud.com/repository/npm/

Insert picture description here
Insert picture description here

4. Log in to the developer account

Debugging: previewer, simulator, remote virtual device
• Previewer menu: View -> Tool Windows -> Previewer (To enter the specific page to edit the code, click the menu to display Previewer
• Simulator menu: Entry 1: Run- >
Debug'entry', entry 2: View -> Tool Windows -> Simulator (only available when entry 1 is successfully executed once)
• Remote virtual device menu: Tools -> HVD Manager (requires login to the real-named account, pay attention to the use time limit ) Click the HVD Manager in the screenshot below.
If you are not logged in, you will use the default browser to open the login URL or click DevEco Login to start the login, as shown below

Start login from IDE
Insert picture description here
Allow IDE login

Agree to the agreement

Insert picture description here

5. Set the IDE skin

Set to dark mode here: file->Settings…->Appearance & Behavior->Appearance->Theme->HuaWei Dark Theme

6. Set the IDE's font

The font of the IDE software itself, the following font sizes are personal preference

Enable the specified font as Constantia, font size 14: file->Settings…->Appearance & Behavior->Appearance->check Use custom font->font setting: Constantia, font size setting: 14

7. Set the font of the IDE editor

Code font, the following font size is personal preference

The specified font is enabled here as Consolas, font size 16: file->Settings…->Editor->Font->Font->Font setting: Consolas, font size setting: 16 (for English font)
Fallback font (candidate font), this I set Monospaced (for Chinese fonts)

8. IDE Chinese

Many people say
why the IDE, which was born with Hongmeng, has a development tool in English. I feel so upset. I think it can be understood in the early stage. Huawei itself is in a hurry. We developers write code in English. The world is the same. English can be used universally. In the future, each country can deal with it according to its own language, even if there is no such relationship, it can be understood in English.

Note that it is developed based on IntellJ, and it may be possible to Chineseize DevEco Studio by Chineseizing IntellJ

Sinicization reference link: https://developer.huawei.com/consumer/cn/forum/topicview?fid=0101303901040230869&tid=0203356660849910794

Two, official documents

IDE installation/environment configuration/getting started/API-UI corresponding to each development language, etc., there are official documents

Hongmeng official website: https://www.harmonyos.com/cn/home/

Where everything started, Baidu can’t find the official website yet, so everyone remembers: Hongmeng OS.com, the domain name is in English: harmonyos.com
pronunciation: harmony English [ˈhɑːməni] America [ˈhɑːrməni]
n.
Harmony; Harmony; Harmony ; Harmony; coordination

Development documentation: https://developer.harmonyos.com/cn/documentation

For more installation and configuration related tutorials in the development environment, please see: https://developer.harmonyos.com/cn/docs/documentation/doc-guides/software_install-0000001053582415. The
tutorial says that JS SDK is not installed by default, but it is actually installed. Note: Currently, it supports JS, JAVA, C/C++ development languages ​​for development. JS
development? Like me, everyone may have a big question mark. Here is a link to clarify a little bit: https://www.yuque.com/chatterzhao/harmony/mkhygd , for more information, please go here: https:// developer.harmonyos.com/cn/docs/documentation/doc-references/js-framework-file-0000000000611396

1. Java API, Native API, JS API document address

https://developer.harmonyos.com/cn/docs/documentation/doc-references/js-framework-file-0000000000611396

2. Java UI, JS UI document address

https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ui-java-overview-0000000000500404

3. Community

•51CTO: https://harmonyos.51cto.com/
•Electronic enthusiasts (hardware): https://bbs.elecfans.com/harmonyos
•Huawei Developer Alliance: https://developer.huawei.com/consumer/cn /forum/blockdisplay?fid=0101303901040230869

Fourth, create a project

Now you can create applications for TVs and wearable devices. Here I create an empty project for TVs. This is the first option. I choose the JS language.

Create HarmonyOS Project 1:

Insert picture description here

Create HarmonyOS Project 2:

Insert picture description here

Create HarmonyOS Project 3:

Insert picture description here

Create HarmonyOS Project 4:

Insert picture description here

Five, debugging

Previewer, simulator, remote virtual device•Previewer menu: View -> Tool Windows ->
Previewer (you must enter the specific page to edit the code, and then click the menu to display Previewer)

• Simulator menu: Entry 1: Run -> Debug'entry', such as port 2: View -> Tool Windows ->
Simulator (you need entry 1 to execute successfully once)

•Remote virtual device menu: Tools -> HVD Manager (you need to log in to the real-named account, pay attention to the use time limit)

Insert picture description here

Start remote device for simulation test

To start the remote device, you need to log in to the real-named developer account (if you are not logged in, the login page will automatically open in the default browser. If you log in with an account without a real-name, you cannot log in successfully)

Some things need to be downloaded for the first startup, which will be slower

As of 2010.9.10, only TV and wearable are external

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
TV mode, the remote virtual device window is not enough to display, you can click the settings to modify the display (click the red circle)


HarmonyOS official developer forum:
https://developer.huawei.com/consumer/cn/forum/blockdisplay?fid=0101303901040230869

Original link: https://developer.huawei.com/consumer/cn/forum/topicview?tid=0202355439466190732&fid=0101303901040230869

Author: chatterzhao

Guess you like

Origin blog.csdn.net/weixin_44708240/article/details/108773369