User Applications
A user application, also known as an application or app, runs on the operating system of devices and provides particular services for users.
Applications running on HarmonyOS are classified into the following forms:
- Applications installed in a conventional manner
- Installation-free applications (namely, Atomic Services) that provide specific functions
Unless otherwise specified, applications in HarmonyOS documentation refer to the preceding two forms.
User Application Package Structure
The user application package of HarmonyOS is released as an App Pack, suffixed with .app. It consists of one or more HarmonyOS Ability Package (HAP) files and the pack.info file that describes the attributes of each HAP file. The HAP files are used to deploy abilities, based on which you will code your HarmonyOS application.
One HAP file is a module package consisting of code, resources, third-party libraries, and an application configuration file. HAP files can be classified into Entry and Feature modules. Figure 1 shows the logical view of an application.
- Entry: main module of the application. In an application, there may be one or more HAPs of the entry type for the same device type, to support specific devices of different specifications (such as the API version and screen specifications). If there are multiple entry modules for a device type, distroFilter (distribution rules) must be configured. This setting allows precise app distribution to devices of the same type but with different specifications when apps are distributed on HUAWEI AppGallery.
- Feature: dynamic feature module of the application. Each application can have more than one Feature.hap file or have none. Only the Feature.hap files that contain abilities can run independently.
Figure 1 Logical view of an application
Ability
An ability is an abstraction of a functionality that an application can provide. One application can contain one or more abilities. Abilities are classified into Feature Abilities (FAs) and Particle Abilities (PAs). FAs and PAs are the basic units of applications to implement specific application functionalities. Their difference lies in that an FA has a UI but a PA does not.
Library Files
Library files are third-party code files on which applications depend. They are binary files, such as .so, .jar, .bin, and .har, stored in the libs directory.
Resource Files
The application resource files, such as strings, images, and audio files, are stored in the resources directory, allowing you to easily access, use, and maintain them. For details, see Resource File Categories.
Configuration File
config.json is the configuration file of an application. It is used to declare the abilities of the application and the permissions required by the application. For details, see Application Configuration File.
pack.info
This file describes the attributes of each HAP file in the application package. It is compiled and generated by the integrated development environment (IDE). With this file, the application market will unpack the package and store the HAP files by category. A HAP file has the following attributes:
- delivery-with-install: specifies whether the HAP file can be installed during application installation. The value true indicates that the HAP file can be installed during application installation, and false indicates the opposite.
- name: indicates the name of the HAP file.
- module-type: indicates the module type. The value can be entry or feature.
- device-type: indicates the type of the device that supports the HAP file.
HAR
HarmonyOS Ability Resources (HAR) provides all content required for building an application, including the source code, resource files, and config.json file. However, HAR cannot be independently installed on a device like a HAP file. Instead, it can be referenced only as the dependency of an application module.
source : https://developer.harmonyos.com/en/docs/documentation/doc-guides/basic-fundamentals-0000000000041611