Android SBeacon Framework Installation - scopetech/Mobile-Public GitHub Wiki
SBeacon SDK v1.6.13
This guide covers SDK installation, dependency configuration, and required permissions.
| Requirement | Version |
|---|---|
| Android SDK | 27+ (Android 8.1) |
| Kotlin | 1.8+ |
| Android Studio | Ladybug 2024.2.1+ |
| Device | Physical device with BLE |
The SBeacon SDK is hosted on GitHub Packages. Add your credentials to ~/.gradle/gradle.properties (in your home directory, not the project):
github_username=YOUR_GITHUB_USERNAME
github_key=YOUR_GITHUB_PERSONAL_ACCESS_TOKENNote: Your GitHub token requires the
read:packagesscope.
In your project's settings.gradle.kts, add the GitHub Packages repository:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
// GitHub Packages repository for SBeacon SDK
maven {
url = uri("https://maven.pkg.github.com/scopetech/Frameworks-Mobile")
credentials {
username = providers.gradleProperty("github_username").get()
password = providers.gradleProperty("github_key").get()
}
}
}
}In your app's build.gradle.kts:
dependencies {
// SBeacon SDK
implementation("com.scopetechnology:ble:1.6.13")
// Required dependencies
implementation("com.jakewharton.timber:timber:5.0.1") // Logging (recommended)
implementation("joda-time:joda-time:2.12.5") // Date/time handling
// Jetpack libraries (if not already included)
implementation("androidx.lifecycle:lifecycle-process:2.8.7")
}Add all required permissions to your AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Runtime permissions - must be granted at runtime -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<!-- Android 12+ Bluetooth permissions -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<!-- Android 13+ notifications -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application
android:name=".MyApp"
...>
<!-- Your activities -->
</application>
</manifest>| Permission | Required For | Android Version |
|---|---|---|
ACCESS_FINE_LOCATION |
BLE scanning (Android considers BLE location-sensitive) | All |
ACCESS_BACKGROUND_LOCATION |
BLE scanning when app is backgrounded | 10+ |
BLUETOOTH_SCAN |
Scanning for BLE devices | 12+ |
BLUETOOTH_CONNECT |
Connecting to BLE devices | 12+ |
POST_NOTIFICATIONS |
Foreground service notification | 13+ |
- Location permissions
- Bluetooth SCAN and CONNECT permissions
- Background location (separate request)
- POST_NOTIFICATIONS permission
- Location permissions
- Bluetooth SCAN and CONNECT permissions
- Background location (separate request)
- Fine location permission
- Background location (must be requested separately after fine location)
- Fine location and background location (can be requested together)
- Fine location permission only
- Initialization - Configure the SDK in your Application class
- Event Handling - Subscribe to SDK events