Android Quick Integration
Integration
- Add jitpack support in the root build.gradle file of your project
allprojects {
repositories {
// Other repository configurations
maven { url 'https://jitpack.io' }
}
}
- Add dependencies in the build.gradle file of your module check the latest version here
<!--Here, the version number, x.x.x, can be specified as any release version-->
dependencies {
...
implementation 'com.github.YolandaQingniu:qnscalesdkX:x.x.x'
}
Permissions
If your app's targetSdk > 30 and the Android version of the device is Android 12 or higher, the following permissions are required:
- android.permission.BLUETOOTH_ADVERTISE
- android.permission.BLUETOOTH_SCAN
- android.permission.BLUETOOTH_CONNECT
Otherwise, the following permissions are required:
- android.permission.BLUETOOTH
- android.permission.BLUETOOTH_ADMIN
- android.permission.ACCESS_COARSE_LOCATION
- android.permission.ACCESS_FINE_LOCATION
Refer to Google's official adaptation documentation for more details: Bluetooth Permissions
Proguard Configuration (proguard-rules)
-keep class com.qingniu.scale.model.BleScaleData{*;}
Other
The integration method of configuration files can refer to the demo. Place it in the assets
directory, and then use "file:///android_asset/file_name.qn" to pass the file path during initialization.