Getting Started with Hongmeng Development: Overview of Application Configuration Files (FA Model)

Application Profile Overview (FA Model)

Each application project must add configuration files in the project's code directory. These configuration files will provide basic information describing the application to the HarmonyOS compilation tool, HarmonyOS operating system and application market.

The application configuration file must declare the following:

  • The application's package name, application developer, version number and other basic configuration information of the application are required to be set under the app field.
  • Basic information about the components of the application, including all capabilities, device types, component types, and the syntax type used by the current component.
  • Configuration information of the application on a specific device. This information will affect the specific functions of the application on the device.

During the application development process of the FA model, the application package structure needs to be declared in the config.json configuration file.

The internal structure of the configuration file

config.json consists of three parts: app, deviceConfig and module, all of which are indispensable.

Property name meaning type of data Whether it can be defaulted
app Identifies the global configuration information of the application. The app configurations of different HAPs for the same application must be consistent. object Cannot be defaulted.
deviceConfig Identifies the configuration information applied to a specific device. object Cannot be defaulted.
module Identifies the configuration information of HAP. The configuration under this label only takes effect for the current HAP. object Cannot be defaulted.

config.json example:

{  "app": {    "vendor": "example",    "bundleName": "com.example.demo",    "version": {      "code": 1000000,      "name": "1.0.0"    }  },  "deviceConfig": {  },  "module": {    "mainAbility": ".MainAbility_entry",    "deviceType": [      "tablet"    ],    "commonEvents": [      {        "name": ".MainAbility",        "permission": "ohos.permission.GET_BUNDLE_INFO",        "data": [          "com.example.demo",          "100"        ],        "events": [          "install",          "update"        ]      }    ],    "abilities": [      {        "skills": [          {            "entities": [              "entity.system.home"            ],            "actions": [              "action.system.home"            ]          }        ],        "orientation": "unspecified",        "visible": true,        "srcPath": "MainAbility_entry",        "name": ".MainAbility_entry",        "srcLanguage": "ets",        "icon": "$media:icon",        // $string:MainAbility_entry_desc为资源索引        "description": "$string:MainAbility_entry_desc",        "formsEnabled": false,        // $string:MainAbility_entry_label为资源索引        "label": "$string:MainAbility_entry_label",        "type": "page",        "launchType": "standard"      }    ],    "distro": {      "moduleType": "entry",      "installationFree": false,      "deliveryWithInstall": true,      "moduleName": "myapplication"    },    "package": "com.example.myapplication",    "srcPath": "",    "name": ".myapplication",    "js": [      {        "mode": {          "syntax": "ets",          "type": "pageAbility"        },        "pages": [          "pages/index"        ],        "name": ".MainAbility_entry",        "window": {          "designWidth": 720,          "autoDesignWidth": false        }      }    ]  }}

at last

Here is a "Hongmeng Zero Basics Beginner's Study Guide", hoping to provide some help to those who want to learn Hongmeng but have no direction. This document is suitable for beginners in HarmonyOS application development (due to the excessive content of the document, in order to avoid affecting everyone’s reading experience, only part of the content is shown in screenshots. There is a free way to obtain the detailed full version at the end of the article!)

"Hongmeng Zero Basics Beginner's Study Guide"

Table of contents

Insert image description here

1. Quick Start

Suitable for beginners in HarmonyOS application development. By building a simple application with page jump/return function, you can quickly understand the main files of the project directory and become familiar with the HarmonyOS application development process.

  • Development preparation
    • basic concept
    • Tool preparation
  • Building the first ArkTS application (Stage model)
  • Build the first ArkTS application (FA model)
  • Build the first JS application (FA model)

Insert image description here

2. Development of basic knowledge

  • Application package basics
    • Application package overview
    • Application package structure
    • Application package multi-HAP mechanism
    • Application package installation and uninstallation process
    • Application package update process
    • Shared package
    • Application package quick fix
  • Application configuration file (Stage model)
    • Application Profile Overview (Stage Model)
    • app.json5 configuration file
    • module.json5 configuration file
  • Application Profile Overview (FA Model)
    • Application Profile Overview (FA Model)
    • app object internal structure
    • deviceConfig internal structure
    • module object internal structure

Insert image description here

3. Resource classification and access

During application development, resources such as colors, fonts, spacing, and pictures are often used. The values ​​of these resources may be different in different devices or configurations.

  • Resource classification and access
    • Resource classification
    • Resource directory
    • Resource group directory
  • Create resource directories and resource files
    • Create resource directories and resource files
    • Create resource directory
    • Create resource files
  • resource access
    • Application resources
    • system resource
    • Resource matching
      Insert image description here

4. Learn ArkTs language

ArkTS is the preferred main application development language of HarmonyOS. ArkTS has further expanded on the TypeScript (referred to as TS) ecosystem around application development. It inherits all the features of TS and is a superset of TS. Therefore, before learning the ArkTS language, it is recommended that developers have TS language development capabilities.

  • First introduction to ArkTS language
  • basic grammar
    • Basic syntax overview
    • Declarative UI description
    • Custom component
  • Status management
  • Other status management
    • Additional state management overview
    • @Watch decorator: state variable change notification
    • $$ syntax: two-way synchronization of built-in components
  • Rendering controls
    • Rendering controls overview
    • if/else: conditional rendering
    • ForEach: Loop rendering
    • LazyForEach: Lazy loading of data

Insert image description here

Scan the QR code below to get free "Hongmeng 5.0 Zero Basics Beginner's Study Guide"

Guess you like

Origin blog.csdn.net/Android23333/article/details/134993407