Hello, everyone. I am Pongo, a code farmer with ten years of working experience. I am dedicated to the pursuit of technology.

I have more than 10 years of development experience since I graduated in 2010. I have learned many languages in college, such as Java, Android, C and C ++, but I really mastered almost nothing when I graduated. After graduation, I found a job in Java development with great effort.

Later on, the business needs to switch back and forth between Android and Java. In fact, a lot of people ask me why I don’t switch to administration.

After several years of work, I have been engaged in management. I have led many teams and worked on many types of projects. However, I found that I prefer to work on technology, and I am not used to the intrigue of management and back-and-forth disputes with customers.

I started to contact Hongmeng Development in 2020, which made me feel different, not only because it was the development of domestic system, but also because many concepts and scenes in it made me recognize that Hongmeng Development would be a trend in the future.

Write this column is also for, want to learn Hongmeng but do not have a system data, also do not know so learning partners.

Let’s go on our journey together!

Introduction to the

Huawei HongMeng system (English: huaweiHarmonyOS, HongmengOS). On August 9, 2019, Huawei held the Huawei Developer Conference in Dongguan, and officially released the operating system, HongMeng OS, which version is 1.0.

Hongmeng OS is a “future-oriented” operating system, a distributed operating system based on the microkernel for the whole scene. It has been adapted to the smart screen. In the future, it will be adapted to mobile phones, tablets, computers, smart cars, wearable devices and other multi-terminal devices.

On September 10, 2020, HUAWEI Hongmeng System was upgraded to HUAWEI Hongmeng System 2.0.

Yu said a beta version of HM2.0 will be available to developers in December 2020

In August 2019, HongMeng OS 1.0 was released, but no development documents were released. Those who were interested in it did not know how to start, but just knew the concept. After that, HongMeng OS was not considered good for a long time, and some people even thought it was a hoax.

September 10, 2020 18:18 Hongmeng OS code officially open, the corresponding also opened the relevant documents, development tools and so on, with these developers can demo development.

The Huawei Hongmeng Harmonyos App Development Online Experience website was launched on April 22, 2021. On May 18, Huawei announced that Huawei Hilink will be unified with Harmony OS into Hongmeng ZhiLian.

On the evening of June 2, 2021, Huawei officially launched Harmonyos 2 and a number of new Harmonyos 2 products (including, Band, Phone, Smart Screen).

Open source data

Analyze several essential data for development:

As a developer, I have always been concerned about Hongmeng when he appeared. I began to read relevant materials when I really started open source development, and tried to realize the development of an application side demo.

  1. Development of HongMeng OS API: https://developer.harmonyos.c…
  2. Warehouse HongMeng OS code: https://openharmony.gitee.com/
  3. The developer center: https://developer.harmonyos.c…
  4. Development and application of tools download address: https://developer.harmonyos.c… The development tool has been updated to the Release version from June 2, 2021, and it was all the BAATE version before. The current version number: DevEco Studio 2.1 Release 6, developers BBS: (1) https://developer.huawei.com/… (2) https://harmonyos.51cto.com/s…

After doing the development of Hongmeng APP, I would like to talk about my feelings:

1. The development tools are basically the same as Android. The development tools are very suitable for developers, including configuration items, SDK, JDK and so on.


2. There are three main ways to develop the technology stack of code: one is Java technology stack, the other is JavaScript + HML + CSS, and the last is native.


3, for developers, simple, low development cost, can be Java, can also be JS.

Environment set up

Before the development must build the environment, do Java development all know, install the development environment, the main is the need for JDK installation, HongMeng development environment is relatively simple, in the installation of development tools for automatic installation of JDK.

If you’ve done Java before, JDK installs are not affected, and those not installed will be automatically installed when you install the developer tools.

One thing to note is that Node.js is required for development, which is also necessary for development of the JS technology stack.

The development tools

HongMeng application development has its own development tools: development tools download address: https://developer.harmonyos.c…

Deveco Studio 2.1 Release is available for download

1. You need to enter Huawei authorization when you click to download. Please prepare your Huawei account in advance. 2. Currently, there are two versions 3 for Windows and Mac. Click to download directly.

​​

After unzipping the file, there is an installation file as follows, followed by a fool install (double-click install).

Tool installation -SDK installation configuration

Installation is a fool to try installation, basically the same as IDEA:

  1. The installation directory is best customized
  2. You need to download the SDK during installation, and you will be prompted to download the SKD directory. Or go to the start page and set up the update SDK. Settings -> Search SDK -> Homonyos SDK

Manually update SDK renderings after installation:

The SDK information

The current SDK versions are: API Version5, 2.1.1.21.

What is the information in the SDK?

  1. SDK configuration updates include: SDK Platforms and SDK Tools

Below is an SDK Platforms:

Description: The Harmonyos SDK is categorized by language, including Java, JavaScript, and Native. They allow you to develop applications in Java, JavaScript, and C/C++. SDKs of the same API version are compatible with each other.

Here is the SDK Tools:

Description: A set of Harmonyos application development tools, including packaging, signing, and previewing

Note that both of the above images need to be fully downloaded when updating the SDK, otherwise the build project will fail.

To this development tool in accordance with the good, can enter the project to create.

Create a project

  1. Click Create Harmonyos Project to Create a Project. Click Open Project to Open an existing Project

  1. Click Create Harmonyos Project from the previous step and the next step is the Project selection

1, the first option is the JS project project, of course, you can change the configuration to Java project, also can conduct JS interaction


2. The second option is the Java project


3. Selecting each one will prompt which devices are suitable for, which is very humanized.

We are working on a Java project, so choose the second option.

  1. Add a name and create a directory

1. Project name


2. Apps or services, we choose apps


3. Package name, which can be modified by itself or by default


4. Project storage directory


5. Select the latest version of SDK


6. To develop devices, choose Phone (you can choose other devices, currently we are developing mobile devices)

  1. Project build Gradle

Why Gradle, the entire project is built on it, this configuration is downloaded after the project is created.

Here to remind a developer partner, if you encounter the download of other people’s projects, it is recommended to delete these configurations and download again, so that the construction project is not likely to run problems.

5. Gradle is updated after the project is created

At present, the default is to update Gradle-6.3 version. This update may be slow sometimes. If it fails to download, it is recommended to try it several times, or use the current download. Sometimes the server download too many people, or network problems.

6. Build. Gradle for the entire application

Some of the added configuration is almost the same as Android. After all, the tools are the same, which makes development faster. Tools are for developers. Keep it as simple as possible.

The main change is that the Maven repositories have been changed to Hongmong exclusive repositories, which can be added if you use some third party repositories or open source repositories.

7. App (demo entry) Build. Gradle configuration

Gradle configuration in the app is also similar to Android, and has added some additional configuration

References to development libraries and unit test libraries

Introduce references to JAR packages and unit tests.

Download Simulator

Click Tools-> Device Manager in the head of the development tool and you will first enter the simulator classification interface. You need to log in to the Huawei development platform and prepare the required account in advance.

After logging in, you need to authenticate the developer. You can choose ID card authentication or bank card authentication.

(1) ID card certification after the need to audit 1-2 days audit period. (2) The bank card can be approved after authentication.

After successful authentication, click Tools-> Device Manager to enter the login account. After successful login, a pop-up box of authorization consent will be displayed on the browser interface.

After clicking Allow, the simulator will be updated automatically. The interface is as follows:

Type of Simulator: mobile phone, smart screen, bracelet. Run a mobile emulator effect:

The current simulator or online version, there is a time limit, speed and network related. – Hongmeng will update the offline version later, when the emulator will be faster.

Run the project

When everything is ready, the performance is poor, because the project is created with an empty default screen, so only a HelloWord is displayed.

Running is very simple, click the triangle on the head is started, bug icon is debug run.

Running results:

The latest version runs: Hello, World. This also shows that Hongmeng has big ambitions, not just in one area.

Well, a complete introduction to the development of the end of the Hongmeng, there are questions or private messages I.

Original is not easy, useful attention. If it helps you, I’ll give you a third company. Thanks for your support.

If you think it’s good, remember to give me a “like” and follow me ~**

Author: code worker, a work experience of more than 10 years, dedicated to the technical programmer.

Any questions can leave a message, private messages, you can also pay attention to the public number: WeChat search: programmers gabble programming, access to more free learning materials.