Skip to content

Commit 11a4b7e

Browse files
authored
Create README.md
1 parent 8427272 commit 11a4b7e

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SupportedScanSettingsLibrary
2+
An Android Library that implements ScanSettings support for all devices.
3+
4+
## Gradle Dependency
5+
- gradle project level
6+
```gradle
7+
allprojects {
8+
repositories {
9+
// ...
10+
maven { url 'https://jitpack.io' }
11+
}
12+
}
13+
```
14+
- gradle application level
15+
```gradle
16+
dependencies {
17+
implementation 'com.github.Datalux:SupportedScanSettingsLibrary:1.0'
18+
}
19+
```
20+
21+
22+
## Usage
23+
### Default SupportedScanSettings
24+
25+
```kotlin
26+
val supportedScanSettings = SupportedScanSettings().getBuilder(BluetoothAdapter.getDefaultAdapter())
27+
```
28+
29+
### Custom SupportedScanSettings
30+
You can set `ScanMode`, `MatchMode`, `NumOfMatch` or `CallbackType` programmatically using `getBuilder` params.
31+
```kotlin
32+
val supportedScanSettings = SupportedScanSettings().getBuilder(
33+
BluetoothAdapter.getDefaultAdapter(),
34+
scanMode = ScanSettings.SCAN_MODE_BALANCED,
35+
matchMode = ScanSettings.MATCH_MODE_STICKY,
36+
numOfMatch = ScanSettings.MATCH_NUM_FEW_ADVERTISEMENT,
37+
callbackType = ScanSettings.CALLBACK_TYPE_FIRST_MATCH
38+
)
39+
```
40+
41+
42+
#### Params
43+
See https://developer.android.com/reference/kotlin/android/bluetooth/le/ScanSettings

0 commit comments

Comments
 (0)