App (file format)

Last updated
APP
HMOS Logo Icon.svg
Filename extension
.app,.hap
Developed by Huawei
Type of format Package format
Container for
Extended from JAR

The HarmonyOS App Pack or the App file, identified with the file extension ".app", serves as the file format used by the HarmonyOS operating system. It functions as a native HarmonyOS app for distribution and installation through Huawei AppGallery, [1] or for distribution through Huawei Ability Gallery in respect of installation-free apps under both current classic dual-framework and HarmonyOS NEXT system. The App file is also used by a number of other open source HarmonyOS-based operating systems such as OpenHarmony and Oniro OS-based operating systems for distribution and installation of applications, video games and middleware. Including non OpenHarmony-based operating systems, such as GNU Linux-based Unity Operating System that supports the app file format. [2] [3] [4] [5] [6]

Contents

Each HarmonyOS app contains one or more HarmonyOS Ability Package (HAP) files with the file extension ".hap", [7] and the pack.info file that describes the attributes of the App file. [8]

Most HarmonyOS apps contain at least one HAP file of the entry type, which is the main module of the app, and additional HAP files of the feature type, which is used to implement a specific app feature. [8]

The package management subsystem within OpenHarmony for handling app installation packages. When considering a PC environment. Installation and Update function allows users to install or update applications by interacting with the package manager through a graphical user interface or command-line interface. Query and Uninstallation function enable users to query installed packages and uninstall unwanted ones using similar interfaces. Also, storage where Package information would be stored in a database or configuration files on the PC. The package management subsystem ensures frictionless management of app packages, regardless of the device form. [9]

Overview

App Pack and HAP files

HarmonyOS apps are distributed as a software package file known as the App Pack or the App file, suffixed with .app, which is analogous to other software packages such as apk used by the Android operating system, appx in Microsoft Windows, or a Debian package in Debian-based operating systems.

To make a HarmonyOS app, a software development tool such as DevEco Studio is required to code and pack HarmonyOS Ability Package (HAP) and associated files into an app package. [10]

The HAP files may consist of resources, third-party libraries and configuration files. They are classified into two types of modules, i.e., entry and feature. The entry type of the HAP files is the main module and must be included into an app package, while the feature type of the HAP files is additional modules for implementing the features of the apps.

Moreover, an App file that contains different builds and specifications optimized for the various devices may contain more than one HAP file of the entry type. [3]

Historically, the development of the HAP format has gone through two phases. The first stage, after decompression, there was a non-executable APK as the program entrance to connect with AOSP file libraries of binaries to interact with AOSP base of HarmonyOS 2.0 API 6, which is caused by the imperfect ecology of the early development of the new app file format during dual framework of OpenHarmony L3-L5 that consists of EMUI Android base convergence. During early app development, third party developers facilitated development for mixed packaging of APK and HAP. [11] Since introduction of HAR on HarmonyOS 3.1 API 9 with ArkUI declarative programming framework and ArkTS evolved from eTS on 3.0, as primary programming language replacing Java binaries in the second stage of HAP, APKs was eliminated after decompression, and HAP cannot be converted into APKs by simple unpacking and packaging, therefore HAP file format is not a casing of the APK.

Prior to packing into an App Pack, HAP files are allowed to run directly on a real device or an emulator for developers to debug and verify the apps during the development phase. [12]

After development, the apps containing signature information can be distributed to different devices with AppGallery Connect, a tool kit of services for creation, development, distribution and maintenance of an app. [13]

Shared packages

HarmonyOS Shared Packages HarmonyOS Shared Packages.png
HarmonyOS Shared Packages

For sharing code and resources in an App Pack, the operating system offers two kinds of shared packages: Harmony Archive (HAR), which is a static shared package, and Harmony Shared Package (HSP), which is a dynamic shared package. [14]

Both HAR and HSP enable sharing of code, C++ libraries, resources, and configuration files. In HAR, the code and resources are compiled together with invoking modules, possibly resulting in multiple copies of the same code and resources. In contrast, HSP allows independent compilation, leading to only one copy of code and resources in the build product. [14]

When multiple HAPs reference the same HAR, the HSP can be used instead to share some state variables and reduce the size of an App Pack. However, the HSP has some restrictions; for example, it does not support the declaration of abilities in its configuration file and its invoking modules must be in the same stage model as with the HSP. [14]

On OpenHarmony 4.1 API 11 improvements with System-level HSP that supports OTA upgrades within the App Package Management system. Also, the API 11 upgrade under Public Basic Class Library supports the creation of Workers within HSP and HAR that is something a user give a task and continue in the process, while the worker, or multiple workers also known as Thread pools, process the task on a different thread. A call back method is initiated when a special method provided on the initial call gets called. [15]

App file structure

The structure of the App file after built and packaged in a stage model usually contains the following files and folders. [8]

See also

Related Research Articles

<span class="mw-page-title-main">Configuration file</span> Software file used to configure the initial settings for a computer program

In computing, configuration files are files used to configure the parameters and initial settings for some computer programs or applications, server processes and operating system settings.

These tables provide a comparison of operating systems, of computer devices, as listing general and technical information for a number of widely used and currently available PC or handheld operating systems. The article "Usage share of operating systems" provides a broader, and more general, comparison of operating systems that includes servers, mainframes and supercomputers.

The Android SDK is a software development kit for the Android software ecosystem that includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. The SDK is part of the official Android Studio IDE but its various tools and resources can be used independently.

The Android Package with the file extension apk is the file format used by the Android operating system, and a number of other Android-based operating systems for distribution and installation of mobile apps, mobile games and middleware. A file using this format can be built from source code written in either Java or Kotlin.

This is a comparison of mobile operating systems. Only the latest versions are shown in the table below, even though older versions may still be marketed.

<span class="mw-page-title-main">Google App Runtime for Chrome</span> Compatibility layer and sandboxing technology

Android Runtime for Chrome (ARC) is a compatibility layer and sandboxing technology for running Android applications on desktop and laptop computers in an isolated environment. It allows applications to be safely run from a web browser, independent of user operating system, at near-native speeds.

<span class="mw-page-title-main">EMUI</span> Mobile operating system by Huawei

EMUI (formerly known as Emotion UI, and also known as MagicOS is a HarmonyOS/Android mobile operating system developed by Chinese technology company Huawei. It is used on the company's smartphones and tablet computers.

<span class="mw-page-title-main">Android 10</span> Tenth major version of the Android mobile operating system

Android 10 is the tenth major release and the 17th version of the Android mobile operating system. It was first released as a developer preview on March 13, 2019, and was released publicly on September 3, 2019.

HarmonyOS (HMOS) is a distributed operating system developed by Huawei for smartphones, tablets, smart TVs, smart watches, personal computers and other smart devices. It has a multikernel design with dual frameworks: the operating system selects suitable kernels from the abstraction layer in the case of devices that use diverse resources. The operating system was officially launched by Huawei in August 2019.

Android devices have the ability to run virtual machines or emulate other operating systems. It does this either via desktop virtualization, platform virtualization, or emulation via compatibility layer.

<span class="mw-page-title-main">Huawei Mobile Services</span> Proprietary software service

Huawei Mobile Services (HMS) is a collection of proprietary services and high level application programming interfaces (APIs) developed by Huawei Technologies Co., Ltd. Its hub known as HMS Core serves as a toolkit for app development on Huawei devices. HMS is typically installed on Huawei devices on top of running dual-framework HarmonyOS operating system, and on its earlier devices running the Android operating system with EMUI including devices already distributed with Google Mobile Services. Alongside, HMS Core Wear Engine for Android phones with lightweight based LiteOS wearable middleware app framework integration connectivity like notifications, status etc.

Android App Bundle is the Android application publishing file format. The App Bundle must include the application's compiled code and resources, which allows for the signing and generation of APK files to be deferred to the app store, reducing the initial download size of the app. The file extension used for this format is ".aab".

<span class="mw-page-title-main">DevEco Studio</span> Integrated development environment for the HarmonyOS platform

DevEco Studio is the official integrated development environment (IDE) for Huawei's HarmonyOS operating system, built on JetBrains' IntelliJ IDEA software and Huawei's SmartAssist designed specifically for HarmonyOS development. It is available for download on Microsoft Windows and macOS based operating systems.

The version history of the HarmonyOS distributed operating system began with the public release of the HarmonyOS 1.0 for Honor Vision smart TVs on August 9, 2019. The first expanded commercial version of the Embedded, IoT AI, Edge computing based operating system, HarmonyOS 2.0, was released on June 2, 2021 for phones, tablets, smartwatches, smart speakers, routers, and internet of things. Beforehand, DevEco Studio, the HarmonyOS app development IDE, was released in September 2020 together with the HarmonyOS 2.0 Beta. HarmonyOS is developed by Huawei. New major releases are announced at the Huawei Developers Conference (HDC) in the fourth quarter of each year together with the first public beta version of the operating system's next major version. The next major stable version is then released in the third to fourth quarter of the following year.

<span class="mw-page-title-main">OpenHarmony</span> Family of open-source operating systems based on OpenHarmony

OpenAtom OpenHarmony, or abbreviated as OpenHarmony (OHOS), is a family of open-source operating systems based on HarmonyOS derived from LiteOS, donated the L0-L2 branch source code by Huawei to the OpenAtom Foundation. Similar to HarmonyOS, the open-source distributed operating system is designed with a layered architecture, which consists of four layers from the bottom to the top, i.e., the kernel layer, system service layer, framework layer, and application layer.

HarmonyOS NEXT is a proprietary distributed operating system and an iteration of HarmonyOS, developed by Huawei to support only HarmonyOS native apps. The operating system is primarily aimed at software and hardware developers that deal directly with Huawei. It does not include Android's AOSP core and is incompatible with Android applications.

Ark Compiler, also known as ArkCompiler, is a unified compilation and runtime platform that supports joint compilation and running across programming languages and chip platforms, also operating systems of open-source OpenHarmony, Oniro OS, alongside proprietary HarmonyOS with single core system HarmonyOS NEXT included on native APP in Event-driven programming in a unified development environment and formerly built for Android-based EMUI for Huawei smartphones and tablets with HMS-enabled apk apps on AppGallery that improves app performance. It supports a variety of dynamic and static programming languages such as JS, TS, and ArkTS. It is the compilation and runtime base that enables OpenHarmony, Oniro OS alongside HarmonyOS NEXT to run on multiple device forms such as smart devices, mobile phones, PCs, tablets, TVs, automobiles, and wearables. ArkCompiler consists of two parts, compiler toolchain and runtime.

ArkTS is a high-level general-purpose, multi-paradigm, compiled programming language developed by Huawei which is a superset of open-source TypeScript, in turn a superset of JavaScript formerly used in July 2022 HarmonyOS 3.0 version, alongside its evolved percussor, extended TypeScript (eTS) built for HarmonyOS development as a shift towards Declarative programming. ArkTS compiles to machine code via it's Ahead-of-time compilation Ark Compiler. ArkTS was first released in September 30, 2021 on OpenHarmony, and the ArkTS toolchain has shipped in DevEco Studio since version 3.1, released in 2022. Since, OpenHarmony 4.0 release on October 26, 2023, ArkTS APIs has been added to the open source community to contribute.

References

  1. "HarmonyOS Project Overview". developer.harmonyos.com. Retrieved 2023-08-23.
  2. "UOS could support HarmonyOS hap app format". HC Newsroom. Retrieved 15 January 2024.
  3. 1 2 "Application Fundamentals". developer.harmonyos.com. Retrieved 2023-08-20.
  4. "What Is an Atomic Service". developer.harmonyos.com. Retrieved 2023-08-20.
  5. Li, Deng (2022-11-28). "Orange Pi OS launched, based on Huawei HarmonyOS". Huawei Central. Retrieved 2023-11-30.
  6. Anand, Abhinav (2023-11-13). "Huawei ditches Android with HarmonyOS Next". Android Headlines. Retrieved 2023-12-09.
  7. "HAP File - What is a .hap file and how do I open it?". fileinfo.com. Retrieved 2023-08-20.
  8. 1 2 3 "Application Package Structure in Stage Model". developer.harmonyos.com. Retrieved 2023-08-20.
  9. "Package management subsystem". Gitee. Retrieved 13 April 2023.
  10. "Huawei DevEco Studio - HUAWEI HarmonyOS APP". developer.harmonyos.com. Retrieved 2023-08-20.
  11. Khalsa, Bhamini. "Youku Hongmon Development Practice | Youku Android and HarmonyOS Hap hybrid packaging". Mo4Tech. Retrieved 24 March 2024.
  12. "Overview - Building Your App". developer.harmonyos.com. Retrieved 2023-08-20.
  13. "Overview - AppGallery Connect". developer.huawei.com. Retrieved 2023-08-20.
  14. 1 2 3 "Shared Package Overview". developer.harmonyos.com. Retrieved 2023-09-27.
  15. Bates, Kryzt. "OpenHarmony 4.1 Release Now Available With Over 4,000 New APIs". GAMINGDEPUTY. GAMINGDEPUTY. Retrieved 16 April 2024.
  16. "Application Configuration File Overview (Stage Model)". developer.harmonyos.com. Retrieved 2023-08-21.