HarmonyOS

Ali Mert Özhayta
Huawei Developers
Published in
10 min readOct 23, 2020

As our first Harmony focused article, we will try to address what HarmonyOS is and the technology behind HarmonyOS that seamlessly connects multiple terminals.

Harmony OS is a distributed operating system oriented to all scenarios and multiple devices. It is mainly designed for smart devices such as wearables, smart screens, vehicles, and IoT devices, and is gradually open-sourced.

For consumers, HarmonyOS forms a “super device” that connects various smart devices and enables them to share data with each other, and facilitates cross-device collaboration. Services can be seamlessly transferred to devices with the most suitable capabilities and best interaction with users.

One OS for All Devices

For developers, HarmonyOS abstracts hardware capabilities, which allows you to develop an app for only once and deploy it across a variety of devices. Your app will cover the most users with the least investment. You can define brand-new software-based product forms, design and develop products with cross-device interactions and improved user experience.

Vendors Committed to Developing New Operating Systems, But Faces with Difficulties and Bottlenecks. Such as on Separated ecosystems PCs, mobile phones, and watches use different Operating Systems. The ecosystem is split, making it difficult to adapt to all scenarios. The architecture is redundant, and the experience is not streamlined.

However on a closed ecosystem, The system is splitting gradually. Multi-device collaboration is limited to self-developed products.

In short, Harmony OS offers a single device to all scenarios that covers various smart devices, separation to collaboration, an isolated ecosystem to a shared ecosystem. That is why Harmony OS is a future oriented OS.

HarmonyOS Offers

More Entrances and Traffic: Expands to more devices and can be invoked by more third parties.

New experiences:

  • Multi-Device Collaboration
  • Super device
  • Software + hardware co-optimization
  • Concurrent channels
  • Brand new interactivity experience
  • Service recommendation
  • Developed once and deployed across multiple devices
  • Seamless all-scenario experience

New Development Mode:

  • Simplified development and shortened Time-To-Market
  • Small-granularity step-by-step delivery
  • Lower requirements on developers
  • Lower maintenance cost
  • High decoupling and quick replacement
  • Narrowed development impact

Hardware Collaboration and Resource Sharing

- Traditional OSs, devices are independent from each other -

In the Android architecture, developers need to encapsulate the service code by themselves. Android Studio does not support one project for multiple devices.

- In HarmonyOS devices collaborate with each other and share resources in the ecosystem -

HarmonyOS breaks the boundaries among traditional hardware devices, defines new, software-based product forms for better user experience, and builds a “super device” that covers all scenarios.

DevEco Studio allows developers to build only one project for various devices. With atomic development of service logics, an app can adapt to different devices. The distributed UX programming framework simplifies the development of the UI that can fit into different devices.

Collaborated devices work as one super device, greatly improving user experience. Smooth cross-device service transfer through activated user entrances with a seamless handover. The new interaction mode activates user entrances, provides optimal user experience, and increases traffic.

HarmonyOS Apps

HarmonyOS apps are developed based on HarmonyOS APIs and can run independently.

A HarmonyOS app software package is published in HUAWEI AppGallery in app pack form, which consists of one or more Feature Abilities (FAs) and Atomic Abilities (AAs).

  • FA is a program entity (with UIs) that invokes the AA to implement complex functionalities.
  • AA is a non-UI program entity developed by a third party to implement a single functionality. AAs are independent from each other and depend on system services only.
  • System services refer to basic software and hardware services provided by an OS platform.

Feature Abilities (FAs) and Atomic Abilities (AAs) are:

  • Huawei-originated distributed services for multiple devices
  • Abstract definition of new app programming framework
  • Features
  • Atomic service-oriented app programming framework
  • Invoked across devices
  • Recovered to the state when the service is handed over (limited to some scenarios)
  • Implementation of different technologies is specific to OS platforms.
  • Abilities that can be implemented is subject to OS platform service capabilities.

Daily Life Use Cases of the power of Harmony

We believe many developers across the world will enrich and make our lives easier with the power of HarmonyOS. Here are the two daily life use-cases that we think you will use every day:

Use your watch to shoot photos remotely on your phone.

Remote Photo Shooting

When taking photos, you may need to ask others for help and also need to design the shooting location and make poses in advance, which is inconvenient and time-consuming.

You can use your watch to remotely take photos and control the focal length anytime and anywhere.

Have an information center on your wrist: mobile phone+watch.

It is inconvenient for you to use your phone when you are walking or riding, so that you may miss your intended turning.

Wrist-worn information center: mobile phone+watch

1. Your watch can send you notifications or vibrate when you are nearing your turn.

2. Your watch can collaborate with your phone and display the navigation prompts on the top layer, allowing you perform interactive operations simply.

HarmonyOS’s Technical Architecture

Let’s have a look at HarmonyOS’s technical background to understand how Harmony can communicate and share resource with multiple terminals.

Harmony supports the running, scheduling, and migration of distributed applications on multiple terminals and provides basic system running capabilities such as distributed soft buses, distributed data and file management, distributed task scheduling, distributed security and privacy protection.

Distributed Technology for Terminal Devices

Distributed technology is a basic concept in software. Its core idea is that a group of independent computers appears to users as a unified whole, like a system. These computers have a shared state and can perform concurrent operations. Failures of a single node do not affect the normal running of the entire system. Based on this idea, Huawei creatively proposes the distributed technology for terminal devices. By connecting multiple devices, various hardware resources on these devices work together, and software services can migrate from one device to another. It provides consumers with a unified “super virtual device” experience. The distributed technology for terminal devices has the following four technical features:

  1. Hardware collaboration and resource sharing;
  2. Multi-device authentication and distributed security;
  3. One-off development for multi-device deployment;
  4. Unified OS and elastic deployment.

HarmonyOS is a smart operating system for all scenarios that fully implements these four distributed technologies.

Distributed Device Virtualization Technology

The distributed device virtualization technology is a key technology that virtualizes the peripherals of a hardware device as resources that can be used on another device. This technology turns hardware devices into multiple peripheral resource pools that can be shared by multiple devices. For example, a mobile phone can use the camera of a smart screen, and the smart screen can use the phone’s AI capabilities. The distributed device virtualization technology includes two key technologies: device virtualization, and audio and video synchronization. Device virtualization allows remote peripheral capabilities to be used like local ones. Audio and video synchronization ensures low latency of audio and video transmissions between two devices.

One-off development for Multi-Device Deployment

Applications on the “super virtual device” require a new development framework. One-off development for multi-device deployment is an integrated application development solution for the distributed device environment. This technology simplifies the workload of cross-device application development. Applications can be seamlessly deployed to multiple running environments after being developed for just once. It consists of the distributed program & Ability framework and the UI framework, which provide system-level distributed capability abstraction based on an application’s service logic and UI logic, achieving hardware collaboration and ecosystem sharing at low costs.

Adaptive UX with One-Off Development for Multi-Device Deployment

The distributed UI framework allows an interface logic to be reused on multiple devices, and adapts the screen shape and size with technologies such as polymorphic control, dynamic layout, and project template. In the multi-device scenario, application developers usually need to develop and adapt code multiple times to suit different displays, platforms, and interaction modes for the sake of user experience. The UI adaptation workload increases with the number of device types. The UX distributed framework, however, abstracts these tasks on the platform. In this way, developers only need to develop once, and the UI can adapt itself to each device, and the information structure can be optimally displayed on different devices.

The distributed UX framework extracts common information structures from different dimensions, such as UI elements, content frameworks, and page frameworks, and abstracts component capabilities at different granularities. It includes three technologies:

Polymorphic control is a basic set of controls extracted from different devices. It is the basic building block, including monolithic controls and composite controls (cards).

Dynamic layout describes the layout relationships of various UI elements, abstracts common layout practices using templates to the maximum extent, and provides common capabilities.

Project template is an out-of-the-box template provided by the IDE for developers. It contains a complete project directory, including source code and project files.

Distributed Data Management

The distributed data management service provides applications with the capability of distributing database data among different devices. By calling the distributed data interface, applications save data to the distributed database. The distributed data service isolates applications by account, application, and database to ensure that data in one application cannot be accessed by another application through the service. The distributed data service supports application data synchronization between trusted and authenticated devices, providing consistent data access experience on multiple devices. In addition, with system-level data synchronization provided by HarmonyOS, application development can be greatly simplified.

Typical application scenarios of distributed data management include the synchronization, sharing, and search of application data between devices, such as galleries, messages, contacts, and file managers.

Distributed Soft Bus Technology

The distributed soft bus is the foundation of “super virtual device” and provides unified distributed communication capabilities for seamless interconnection of “1+8+N” devices. With this technology, devices can be quickly discovered and connected, and programs and data can be efficiently transferred.

“1+ 8 + N” devices : “1” refers to the smartphones, while “8” includes PC, tablet, TV, audio, glasses, watches, locomotives, and headphones. On the other hand, “N” refers to mobile offices, smart homes, sports and health, audio-visual entertainment, and smart travel products.

The distributed bus provides secure and reliable intra-device and inter-device communication capabilities that feature high bandwidth, low latency, low power consumption. The distributed soft bus has three functions: task bus, data bus and bus center. The task bus is responsible for quickly distributing applications on multiple devices. The data bus distributes and synchronizes data among devices with high performance. The bus hub is used for coordination and control, automatic discovery and networking, and maintaining topology relationships between devices. HarmonyOS supports distributed cross-device execution.

Harmony Security Framework

Huawei’s concept of device security is to ensure that the right people use data correctly through the right devices. On a distributed virtual device, the challenge of ensuring the user is the intended one is how to identify and authenticate the “right person” when the identity of a user is extended from one device to multiple devices. To guarantee that the right device is used, the virtual terminal device is required to manage all virtual resources in a unified manner and ensure that the security capabilities of each virtual resource match the sensitivity of the data processed. In terms of using data correctly, the biggest challenge in the distributed scenario is to ensure that all participants understand and execute data security policies in cross-device scenarios in the same way.

Differences between Harmony and EMUI

Invoking EMUI Kit Capabilities on Harmony Applications

Harmony applications cannot directly call Android APIs.

Therefore, the kit capabilities on EMUI cannot be directly called on HarmonyOS. However, as a differentiated competitiveness of Huawei phones, the kits will be made available to applications on the HarmonyOS. Developers can refer to the documentation on Harmony APIs.

The kit capabilities will be made available to developers on both HarmonyOS and EMUI. Apps that have integrated kits on EMUI need to be adapted based on Harmony APIs to call the same capabilities on HarmonyOS.

Open-Source Libraries of Android on HarmonyOS

We are working with open source communities to encourage them to develop libraries that support HarmonyOS either by contributing them or by joint development, so that they can be available soon to developers.

Third or fourth-party libraries of Android cannot be directly invoked for HarmonyOS. Huawei will have technical collaboration with third and four-party libraries to introduce Harmony versions.

Support for Third and Fourth Party Libraries

On app development, not all service code is written from scratch. Instead, a large amount of it comes from third- or fourth-party libraries. When an app is ported to HarmonyOS, not only self-developed code is ported, but also code from third or fourth-party libraries ported as well.

Definition of third-party libraries: library files whose source code is available, such as open-source libraries.

Definition of the fourth-party library: library files (on which the app depends) that are developed by other companies and source code is not available.

Third or fourth party libraries of Android cannot be directly invoked for HarmonyOS. Huawei will conduct technical collaboration with third and four-party libraries to introduce the Harmony version.

Game Engines (such as Unity, Unreal and Cocos) Support

The HarmonyOS supports the built-in 3D rendering engine by default, which can meet the development requirements of small 3D apps, such as AR.

Third-party game engines such as Unity and Unreal do not have Harmony versions for now.

For more information please have a look at the following links

About HarmonyOS : https://device.harmonyos.com/en/docs/start/learn/oem_des_define-0000001055232642

For more detail devices information : https://developer.harmonyos.com/en/docs/documentation/doc-guides/ivi-overview-0000000000030225

For Development HarmonyOS applications(BASE): https://developer.harmonyos.com/en/docs/documentation/doc-guides/start-overview-0000000000029602

For Device Development : https://device.harmonyos.com/en/docs/develop/demo/oem_wifi_sdk_des-0000001050059068

For API references : https://developer.harmonyos.com/en/docs/documentation/doc-references/overview-0000001054518434

For HUAWEI DevEco Studio Introduction : is a one-stop integrated development environment (IDE) powered by the IntelliJ IDEA Community Edition and oriented to HarmonyOS-based devices in all scenarios

https://developer.harmonyos.com/en/docs/documentation/doc-guides/tools_overview-0000001053582387

Documentation : https://developer.harmonyos.com/en/documentation

--

--