Name | Date | Size | ||
---|---|---|---|---|
.. | 25-Oct-2024 | 4 KiB | ||
.gitignore | H A D | 25-Oct-2024 | 100 | |
AppScope/ | H | 25-Oct-2024 | 4 KiB | |
build-profile.json5 | H A D | 25-Oct-2024 | 1 KiB | |
entry/ | H | 25-Oct-2024 | 4 KiB | |
hvigor/ | H | 25-Oct-2024 | 4 KiB | |
hvigorfile.js | H A D | 25-Oct-2024 | 168 | |
hvigorw | H A D | 25-Oct-2024 | 2.1 KiB | |
hvigorw.bat | H A D | 25-Oct-2024 | 2 KiB | |
oh-package.json5 | H A D | 25-Oct-2024 | 815 | |
ohosTest.md | H A D | 25-Oct-2024 | 735 | |
README.md | H A D | 25-Oct-2024 | 1.7 KiB | |
README_zh.md | H A D | 25-Oct-2024 | 5.1 KiB | |
screenshots/devices/ | H | 25-Oct-2024 | 4 KiB |
README.md
1# Bluetooth 2 3### Introduction 4 5Bluetooth is a short-range wireless technology used to implement communication between fixed and mobile devices over low-cost short-distance wireless connections. This sample describes how to discover, pair, and unpair Bluetooth devices. The display effect is as follows: 6 7 8 9### Concepts 10 11Bluetooth: The Bluetooth module provides basic classic Bluetooth capabilities. 12 13### Required Permissions 14 15ohos.permission.USE_BLUETOOTH 16 17ohos.permission.LOCATION 18 19ohos.permission.DISCOVER_BLUETOOTH 20 21ohos.permission.MANAGE_BLUETOOTH 22 23ohos.permission.APPROXIMATELY_LOCATION 24 25### Usage 26 271. Start the app. If Bluetooth is enabled, the system searches for nearby devices that can be paired. If Bluetooth is not enabled, enable it. 28 292. After nearby devices are detected, select the device to pair. A dialog box is displayed. Touch **Pair** to set up a connection with this device; touch **Cancel** otherwise. 30 313. To delete a paired device, touch the device in the paired device list. A dialog box is displayed, asking you whether to disconnect from this device. Touch **OK** to disconnect from this device; touch **Cancel** otherwise. 32 33### Constraints 34 35- This sample can only be run on standard-system devices. 36 37- This sample is based on the stage model, which is supported from API version 9. 38 39- This sample requires DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100) to compile and run. 40 41- The ohos.permission.MANAGE_BLUETOOTH permission used in this sample is of the system_basic level. You need to configure a signature for it. For details about the application permission level (APL), see [Permission List](https://gitee.com/openharmony/docs/blob/master/en/application-dev/security/permission-list.md).