Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/datalux/supportedscansettingslibrary
An Android Library that implements ScanSettings supports for all devices.
https://github.com/datalux/supportedscansettingslibrary
android android-app android-application android-library ble bluetooth bluetooth-le bluetooth-low-energy
Last synced: 19 days ago
JSON representation
An Android Library that implements ScanSettings supports for all devices.
- Host: GitHub
- URL: https://github.com/datalux/supportedscansettingslibrary
- Owner: Datalux
- Created: 2020-05-12T08:47:52.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-12T09:18:35.000Z (almost 5 years ago)
- Last Synced: 2025-01-14T22:51:40.550Z (30 days ago)
- Topics: android, android-app, android-application, android-library, ble, bluetooth, bluetooth-le, bluetooth-low-energy
- Language: Kotlin
- Size: 130 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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