Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Datalux authored May 12, 2020
1 parent 8427272 commit 11a4b7e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SupportedScanSettingsLibrary
An Android Library that implements ScanSettings support for all devices.

## Gradle Dependency
- gradle project level
```gradle
allprojects {
repositories {
// ...
maven { url 'https://jitpack.io' }
}
}
```
- gradle application level
```gradle
dependencies {
implementation 'com.github.Datalux:SupportedScanSettingsLibrary:1.0'
}
```


## Usage
### Default SupportedScanSettings

```kotlin
val supportedScanSettings = SupportedScanSettings().getBuilder(BluetoothAdapter.getDefaultAdapter())
```

### Custom SupportedScanSettings
You can set `ScanMode`, `MatchMode`, `NumOfMatch` or `CallbackType` programmatically using `getBuilder` params.
```kotlin
val supportedScanSettings = SupportedScanSettings().getBuilder(
BluetoothAdapter.getDefaultAdapter(),
scanMode = ScanSettings.SCAN_MODE_BALANCED,
matchMode = ScanSettings.MATCH_MODE_STICKY,
numOfMatch = ScanSettings.MATCH_NUM_FEW_ADVERTISEMENT,
callbackType = ScanSettings.CALLBACK_TYPE_FIRST_MATCH
)
```


#### Params
See https://developer.android.com/reference/kotlin/android/bluetooth/le/ScanSettings

0 comments on commit 11a4b7e

Please sign in to comment.