HarmonyOS for Android Developers — Part 1

Mobile devices such as smartphones and tablets run the Android operating system, which is developed under an open-source and Linux-based model. The Android platform enables developers to develop on a unified platform for developing applications for mobile devices, so their applications are likely to run on different Android-powered devices.

Whereas on the other hand, a microkernel-based operating system, such as HarmonyOS, is considered to be safer and more efficient than hybrid kernel-based operating systems.

In order to successfully connect with other platforms on its devices, Huawei developed a multi-cloud platform operating system called HarmonyOS.

In its inception, HarmonyOS has been called an embedded operating system, and is meant for industrial applications or devices that are part of the Internet of Things.

In addition to being multiplatform operating systems and created by two leading technology companies, Android and HarmonyOS share numerous similarities. In reality, these two platforms are very different.

HarmonyOS comes with Linux Kernel, Micro Kernel, and Lite OS. The OS consists of multiple kernels to select an appropriate kernel for devices of varying resource capabilities.

Let us see the architectural diagrams of Android and HarmonyOS:

Android Architecture Diagram

Based on the architecture diagram below, Android consists of a stack of software components that are roughly divided into five sections and four layers.

Android Libraries

Libraries that are specifically designed for Android usage can be found in this category.

The following is a summary of some of the key Android libraries available to developers:

Android. app − This is the kernel of all Android applications and provides access to the application model.

Android. content − Enables applications to access, publish, and message content.

Android. database − Contains an SQLite database and management classes where users can access the content.

android.OpenGL − API for rendering 3D graphics using OpenGL ES.

Android. os − Contains standard operating system services, such as message access, network access, and inter-process communication.

Android. text − Renders text and manipulates it on a display device.

Android. view − User interface components that make up an application.

Android. widget — A component for designing graphical user interfaces that includes elements such as buttons, labels, list views, layout managers, and radio buttons.

android.WebKit − Provides a way to incorporate web-browsing functionality into applications.

The Java-based Android runtime libraries are now covered, and we’ll be looking at the C/C++-based libraries in this layer of the Android stack.

Android Runtime

Located on bottom of the second layer, this is the third section in the architecture. It provides a key component called Dalvik Virtual Machine, an Android-specific Java Virtual Machine.

As part of the Android runtime, developers can also use standard Java programming languages to write Android applications.

Application Framework

As a result of the Application Framework layer, there are many higher-level services available to applications. These services are available to application developers.

Below is a list of key services provided by the Android framework:

Activity Manager − Manages the lifecycle and stack of activities for the application.

Content Providers − Publishes and shares data among applications.

Resource Manager − Accesses embedded non-code resources such as strings, colors, and user interface layouts.

Notifications Manager − Shows alerts and notifications when an application is running.

View System − A user interface created by extending view classes.

Applications

In the top layer, you’ll find all the Android apps. This layer will be the only one on which you will install your application. Contacts Books, Browsers, Games, etc. are some examples.

HarmonyOS Architecture Diagram

HarmonyOS consists of four layers.

· Kernel Layer

· System Service Layer

· Framework Layer

· Application Layer

Kernel Layer

Kernels are foundational layers of operating systems. With HarmonyOS, multiple kernels can be selected for devices with different resource limits. The kernel abstraction layer (KAL) shields differences in Kernel implementations and provides the upper layer with kernel functionality such as management of processes, threads, memory, and file systems, as well as peripheral management.

System Service Layer

System services enable HarmonyOS to provide applications with services through its framework layer.

Basic Software Service

The HarmonyOS provides common and universal features, including events, notifications, and telephony, design, and more In addition to Mobile Sensing Development Platform (MSDP) & Device Virtualization (DV) for X(DFX).

Enhanced Software Service

Integrates a variety of hardware and software services for HarmonyOS, including those devoted to smart TVs, wearables, and IoT devices.

Hardware Service

Delivers hardware services aimed at wearables and IoT devices, such as geolocation and biometric recognition.

Framework Layer

There are two types of applications in this layer: system applications and third-party applications.

Web browsers and email clients are examples of software that forms the Application layer. It provides protocols that allow software to receive and send data and present information to users.

The HarmonyOS app benefits from its own set of Feature Abilities (FAs) and Particle Abilities (PAs).

FAs provide a UI for interacting with users.

Unlike a UI, PAs process background tasks and provide data access from the background.

Applications developed based on FAs and PAs are specifically tailored for business characteristics and can schedule and distribute across devices, providing users with a consistent and efficient experience.

Issues with the current operating system

· Provide seamless user experience.

· The seamless integration of AI.

· OS challenges.

· There are over a million lines of codes.

· Security concerns arise from the interconnection of multiple devices.

· Close coupling prevents the sharing of ecosystems.

Say you are listening to music on your phone, but you can use a speaker in the same room that is more powerful. The same music file can also be played on your phone with better audio quality capabilities. You are not prompted to utilize the best resources on your mobile device. The aim is to integrate devices seamlessly.

Write applications that are not tailored to a single device, but instead take advantage of virtual devices or virtual resources.

As HarmonyOS grows, it will benefit consumers, developers, and equipment vendors. With its cutting-edge OS, HarmonyOS powers the next generation of smartphones and IoT (Internet of Things) applications. HarmonyOS offers users an engaging, diverse, and rich experience. Our goal is to build out this new ecosystem by inviting developers from around the world. Our goal is to provide consumers with intelligent experiences wherever they may be.

Complexity of Code Management

The above figure shows the complexity of code management for different devices code base. Developers have to maintain multiple code base for multiple IOT devices.

OneHop network connection between Other OS vs Harmony OS

With other OSs it is difficult in configuring networks for IoT devices due to complex steps and different entries. But with HarmonyOS OneHop network connection this will help in automatic configuration as shown in figure.

Customers, equipment manufacturers, and developers will all reap benefits from HarmonyOS. For next-generation smartphones and internet-of-things (IOT) applications, HarmonyOS is the most advanced OS.

HarmonyOS aims to provide an engaging and diverse experience to its users. As a result, developers all over the world are encouraged to join and participate in this new ecosystem. Together, these technologies will deliver a seamless consumer experience in all situations.

Until now we have seen the importance of HarmonyOS and in Part 2 which is a continuation we will see the What does HarmonyOS have to offer for Android Developers?

Check the next part here

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store