Positioning system

HarmonyOS is a “future-oriented” distributed operating system for all scenarios (mobile office, sports and health, social communications, media and entertainment, etc.). Based on the capabilities of a traditional single-device system, HarmonyOS has developed a distributed concept that supports multiple terminals based on the capabilities of a single system that can accommodate multiple terminal configurations.

  • For consumers, HarmonyOS is designed to integrate the capabilities of devices across a variety of life scenarios. It allows for rapid connectivity, interoperability, and resource sharing among devices, matching the right devices, and providing a smooth, full-scene experience.
  • For application developers, HarmonyOS uses a variety of distributed technologies that allow applications to be developed regardless of the shape of the different end devices. This allows developers to focus on upper-level business logic, making it easier and more efficient to develop applications.
  • For device developers, HarmonyOS uses a componentized design that can be tailored to meet the requirements of different terminal configurations based on the device’s resource capabilities and business characteristics.

HarmonyOS code development supports multiple languages, These include Java, XML (Extensible Markup Language), C/C++, JS (JavaScript), CSS (Cascading Style Sheets), and HML (HarmonyOS Markup) Language).

Video link

https://mos-vod-drcn.dbankcdn.cn/P_VT/video_injection/A91343E9D/v3/9AB0A7921049102362779584128/MP4Mix_H.264_1920x1080_60 00_HEAAC1_PVC_NoCut.mp4Copy the code

Experience HarmonyOS

HUAWEI DevEco Studio

It is a one-stop distributed application development platform for huawei terminals in all scenarios and multiple devices. It supports distributed multi-end development, distributed multi-end commissioning, and multi-end simulation, and provides all-around quality and security assurance.

1. Download the link

https://developer.harmonyos.com/cn/develop/deveco-studio#download
Copy the code

Click the download link to access the Huawei account registration page. Enter the account to register and log in.

Once logged in, the download page is displayed. Select your own system, download and decompress the installation package.

2. Configure software

After opening the software, the following window will be displayed. Just click OK here.

Check it and click Agree.

Click Next.

Select Accept, and click Next.

Wait to install the SDK.

When the installation is complete, click Finish.

3. Create a project

Click Create HarmonyOS Project.

If you select TV, Empty Freature Ability(JS) will be selected by default. Click Next.

Set project parameters, and customize the project name, dependency name, and project path. Select SDK:API Version 3 by default. Click Finish when the Settings are complete.

Open the file directory shown in the following figure. Sometimes this error occurs. Java.io.IOException: Cannot run program “node” : error=2, No such file or directory. You need to symlink the nodeJS executable to Node. Under the Terminal TAB, enter the command:

sudo ln -s "$(which nodejs)" /usr/local/bin/node
Copy the code

Select HVD Manager under the Tools TAB to launch the emulator preview project.

When clicked, the browser will jump to an authorization window. Just hit allow.

When allowed, the following window will pop up. Click the little triangle under the TV Actions and you are ready to run.

You will see the following screen, indicating that you have started the simulator successfully.

The emulator window may not feel comfortable nested inside the editor, so you can click on the pinion at the top right of the preview window. Select the Window option under View Mode.

The following is a separate window, looking comfortable. The note here is that the emulator is remotely connected to another server, so the picture is not very clear. Also, each startup has a time limit (60 minutes), and the project needs to be restarted when the time is up.

Click on the small triangle shown in the image below to run the project.

Click OK.

The following screen appears, which proves that the simulator has started successfully.

4. Development projects

I see what I saw before hello, world. So let’s go ahead and do a Demo. Our several operations are in index. HML, index. CSS, index.js. In these files.

First, let’s edit the following code in the index.hml file.

<div class="container">
    <text class="filter" for="{{filter in filters}}" tid="{{$idx}}">
        {{filter}}{{title}}
    </text>
    <div class="todo-item" for="{{todo in todos}}" tid="id">
        <input type="checkbox" />
        <text>{{todo.content}}</text>
    </div>
</div>
Copy the code

Then, edit the following in the index.js file.

export default {
    data: {
        title: "demo".filters: ["All"."Done"."Unfinished"].todos: [{id: 1.content: "To do 1"}, {id: 2.content: "To do 2"}]}}Copy the code

We’re done, so let’s restart the project and have a look at the simulator. Click the button with the Run ‘entry’ logo as shown in the image below.

Click Stop and Rerun.

Click OK.

The operation succeeds, as shown in the following figure.

5. Develop documentation

We see the above demo code may be for learning wechat small program and vue. js and other MVVM framework friends feel very familiar, you can develop the following link to continue to learn.

https://developer.harmonyos.com/cn/docs/documentation/doc-references/js-apis-overview-0000001056361791
Copy the code

  • Welcome to pay attention to my public number front-end calendar road
  • Reply to the keyword e-book, you can get 12 front end popular e-books.
  • Reply to the keyword Little Red Book 4th edition, you can get the latest “JavaScript Advanced Programming” (4th edition) ebook.
  • After paying attention to the public account, click the menu below to add my wechat, I drew a lot of IT leaders, created a technical exchange, article sharing group, looking forward to your joining.