harmony 鸿蒙Creating an Application Multi-Instance
Creating an Application Multi-Instance
Multi-instance allows an application to run on multiple pages so that a user can log in multiple accounts and run the application at the same time without affecting each other. For example, a user can run several social accounts, or primary and secondary game accounts simultaneously without frequent log-in and log-out.
Multiple application process pages on the home screen are independent in terms of the running, notification, and more. Instances share data with each other and can be switched using accounts.
Relationship between multiple application instances: - The application icons of multiple instances are the same. - Instances share data and can be switched using accounts.
Constraints
Application multi-instance can run on only 2-in-1 devices.
How to Develop
Configure the multi-instance.
Configure the multiAppMode field in the App/app.json5 configuration file in the project. The code snippet is as follows:
{ "app": { "multiAppMode": { "multiAppModeType": "multiInstance", "maxCount": 5 } } }
Create a multi-instance.
Build and package the configured project and install it on the device.
Right-click an application icon on the home screen to open an application process. Then right-click the application icon again and choose Open. In this case, two application process pages of a same application are displayed on the home screen.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Creating an Application Clone
harmony 鸿蒙app.json5 Configuration File
harmony 鸿蒙Structure of the app Tag
harmony 鸿蒙Overview of Application Configuration Files in FA Model
harmony 鸿蒙Overview of Application Configuration Files in Stage Model
harmony 鸿蒙Application Installation, Uninstall, and Update
harmony 鸿蒙Application Package Overview
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦