# SelectContact **Repository Path**: harmonyos_codelabs/SelectContact ## Basic Information - **Project Name**: SelectContact - **Description**: 基于Web组件和JSBridge桥接实现H5与ArkTS侧的交互。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 16 - **Forks**: 14 - **Created**: 2024-06-15 - **Last Updated**: 2025-12-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Implementing Interactions Between ArkTS and HTML5 ## Overview This sample focuses on illustrating the interactions between ArkTS and HTML5. It uses the scenario of recharge to show how methods can be called between the ArkTS and HTML5 sides, helping you understand their interactions. ## Preview ![SelectContact](screenshots/device/SelectContact_en.gif) ## How to Use 1. On the home page of the application, touch the button to access the recharge page. 2. Touch the contact icon on the right to display the Contacts screen. Select a contact, and the contact information is returned asynchronously. 3. Select an amount and touch the recharge button at the bottom. A toast is displayed. The ArkTS supports only asynchronous interaction with the H5. ## Project Directory ``` ├──entry/src/main/ets // Code area │ ├──entryability │ │ └──EntryAbility.ets │ ├──entrybackupability │ │ └──EntryBackupAbility.ets │ └──pages │ ├──Index.ets // Home page │ └──SelectContact.ets // Recharge page └──entry/src/main/resources // Application resources ``` ## How to Implement 1. On the ArkTS side, implement the chooseContact method to call the system contact interface to display the contact list and retrieve the selected contact's information. 2. Call javaScriptProxy or registerJavaScriptProxy to register the JS object and the chooseContact method. 3. Call the chooseContact method on the HTML5 side. 4. Implement the recharge method on the HTML5 side. 5. Call runJavaScript on the ArkTS side to invoke the recharge method of the HTML5 side. ## Permissions None. ## Constraints 1. The sample is only supported on Huawei phones with standard systems. 2. The HarmonyOS version must be HarmonyOS 5.0.5 Release or later. 3. The DevEco Studio version must be DevEco Studio 6.0.0 Release or later. 4. The HarmonyOS SDK version must be HarmonyOS 6.0.0 Release SDK or later.