This topic describes how to start a system application. It also lists the supported redirection capabilities of system applications.
In addition to the methods described in the preceding topics (for example, using openLink to start a specified application or using startAbilityByType to specify an application of the specified type), you can use the following methods to start a system application:
Using Picker Components
System applications like Camera, Files, and Contacts provide Picker components, which allow your application to leverage their common functions without applying for permissions, for example, accessing resource files of users.
An application starts a system-level Picker component (such as DocumentViewPicker, PhotoViewPicker, or ContactsPicker). The user selects files, photos, or contacts on the component, and the application obtains the result returned by the component. For example, an audio player can obtain the path of the audio file selected by the user via AudioViewPicker, and play the audio clip.
The system-level Picker components have been pre-authorized. When using such a component, you can temporarily access the corresponding resources without requesting the permissions. For example, before accessing a user's image, an application normally needs to request user authorization. However, by using PhotoViewPicker, the application can directly access the image selected by the user.
A system-level Picker component is implemented by an independent system process.
Using Specific APIs
System applications like Settings, Phone, and Calendar provide certain APIs, through which your application can directly redirect users to them.
Currently, the following screens in Settings can be directly opened:
Permission setting: When an application uses requestPermissionsFromUser() to display a dialog box to request certain permissions from the user and the user rejects the request, the application cannot use this API to open the dialog box again. However, it can call requestPermissionOnSetting to display a permission setting dialog box.
For details about how to display the permission setting dialog box, see Requesting User Authorization for the Second Time. The sample code in this topic applies to all permissions in the application's permission groups. You only need to replace the corresponding permission names. Here are some common scenarios:
Notification management: When an application uses requestEnableNotification() to display a dialog box for notification authorization and the user rejects the authorization, the application cannot use this API to open the dialog box again. However, it can call openNotificationSettings() to display a notification management dialog box.
Network management: When an application needs to connect to a network through WLAN, it can call openNetworkManagerSettings() to display a WLAN settings dialog box.
AppGallery Kit allows you to open an application details page through the loadProduct() API, App Linking, and other methods. For details, please refer to Displaying the App Details Page.
Payment Kit provides the requestPayment API to implement one-off payment and payment with contract signing.
Telephony Kit provides makeCall(), which allows users to jump to the dialing screen, where the number to dial is displayed.
Contacts Kit provides the Contacts Picker, which is used to start the Contacts application and read contact data. For details, see Contact Selection.
Map Kit provides the map picker, which supports place details display, location selection, and administrative division selection.
Core File Kit provides the DocumentViewPicker and AudioViewPicker.
Media Library Kit provides the PhotoViewPicker for accessing and saving images or video files in the public directory. For details, see Selecting Media Assets Using Picker and Creating a Media Asset Using SaveButton.