Name Date Size

..25-Oct-20244 KiB

.gitignoreH A D25-Oct-2024100

AppScope/H25-Oct-20244 KiB

build-profile.json5H A D25-Oct-20241 KiB

entry/H25-Oct-20244 KiB

hvigor/H25-Oct-20244 KiB

hvigorfile.jsH A D25-Oct-2024168

hvigorwH A D25-Oct-20242.1 KiB

hvigorw.batH A D25-Oct-20242 KiB

oh-package.json5H A D25-Oct-2024815

ohosTest.mdH A D25-Oct-2024735

README.mdH A D25-Oct-20241.7 KiB

README_zh.mdH A D25-Oct-20245.1 KiB

screenshots/devices/H25-Oct-20244 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![](screenshots/devices/list_en.png)
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).