98.FAQ - htangsmart/FitCloudPro-SDK-Android GitHub Wiki
1.Proguard
-keep class com.polidea.rxandroidble3.internal.RxBleLog{*;}
-keep class com.alibaba.aliagentsdk.** { *; }
-keep class com.fd.aliiot.core.entity.** { *; }
-keep class com.tenmeter.smlibrary.** { *; }
-keep class fi.iki.elonen.** { *; }
2.How to determine if it is a FitCloud device during scanning?
FcScanner has the function of filtering FitCloud devices. If you use other scanning way, you can use companyId to determine.
The companyId of FitCloud devices may be one of the following: 0x5448,0x4254,0x5A54
The method to obtain companyId is as follows:
val companyId = result.scanRecord.manufacturerSpecificData?.takeIf { it.size() > 0 }?.keyAt(0) ?: 0
3.connector.close() blocking issue
For example, you want unbind user and than close the connection.
Never do this:
fun unbind(): Completable {
return connector.settingsFeature().unbindUser().ignoreElement().onErrorComplete()
.andThen(closeTest())
}
private fun closeTest(): Completable {
connector.close()
return Completable.complete()
}
Instead of:
fun unbind(): Completable {
return connector.settingsFeature().unbindUser().ignoreElement().onErrorComplete()
.andThen(closeTest())
}
private fun closeTest(): Completable {
return Completable.fromAction {
connector.close()
}
}
4.How to integrate snapshot versions?
Add maven url in your setting.gradle
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
...
maven {
url = uri("http://120.78.153.20:8081/repository/maven-public/")
allowInsecureProtocol = true
}
}
Config snapshot version in you app.gradle
android{
...
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
...
}
dependencies {
def weakit_version = "3.0.1-SNAPSHOT"
implementation("com.topstep.wearkit:sdk-base:$weakit_version") { changing = true }
implementation("com.topstep.wearkit:sdk-fitcloud:$weakit_version") { changing = true }
}