瀏覽代碼

Fix the problem of incorrect weight data using APP algorithm

master
xing 3 年之前
父節點
當前提交
40afe37592
共有 2 個文件被更改,包括 6 次插入5 次删除
  1. 3
    3
      app/build.gradle
  2. 3
    2
      app/src/main/java/aicare/net/cn/iweightdemo/MyActivity.java

+ 3
- 3
app/build.gradle 查看文件

applicationId "aicare.net.cn.sdk.iweightdemo" applicationId "aicare.net.cn.sdk.iweightdemo"
minSdkVersion 18 minSdkVersion 18
targetSdkVersion 29 targetSdkVersion 29
versionCode 12
versionName "1.3.0"
versionCode 13
versionName "1.3.1"
} }
buildTypes { buildTypes {
release { release {
implementation 'com.google.android.material:material:1.1.0' implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
implementation 'com.github.elinkthings:BodyFatScaleSDKRepositoryAndroid:1.3.0'
implementation 'com.github.elinkthings:BodyFatScaleSDKRepositoryAndroid:1.3.1'


} }

+ 3
- 2
app/src/main/java/aicare/net/cn/iweightdemo/MyActivity.java 查看文件

public void onGetWeightData(final WeightData weightData) { public void onGetWeightData(final WeightData weightData) {
if (weightData == null) if (weightData == null)
return; return;
L.i(TAG,"WeightData:"+weightData.toString());
setWeighDataText(AicareBleConfig.getWeight(weightData.getWeight(), unit, weightData.getDecimalInfo())); setWeighDataText(AicareBleConfig.getWeight(weightData.getWeight(), unit, weightData.getDecimalInfo()));
if (weightData.getTemp() != Double.MAX_VALUE) { if (weightData.getTemp() != Double.MAX_VALUE) {
tv_temp.setText(getString(R.string.temp, String.valueOf(weightData.getTemp()))); tv_temp.setText(getString(R.string.temp, String.valueOf(weightData.getTemp())));
showInfo(algorithmStr, true); showInfo(algorithmStr, true);
if (user != null) { if (user != null) {
cn.net.aicare.algorithmutil.BodyFatData bodyFatData = AicareBleConfig cn.net.aicare.algorithmutil.BodyFatData bodyFatData = AicareBleConfig
.getBodyFatData(algorithmInfo.getAlgorithmId(), user.getSex(), user.getAge(), Double.valueOf(ParseData.getKgWeight(user.getWeight(), algorithmInfo.getDecimalInfo())), user
.getBodyFatData(algorithmInfo.getAlgorithmId(), user.getSex(), user.getAge(), Double.parseDouble(ParseData.getKgWeight(algorithmInfo.getWeight(), algorithmInfo.getDecimalInfo())), user
.getHeight(), algorithmInfo.getAdc()); .getHeight(), algorithmInfo.getAdc());
BodyFatData bodyFatData1 = new BodyFatData(); BodyFatData bodyFatData1 = new BodyFatData();
bodyFatData1.setAge(user.getAge()); bodyFatData1.setAge(user.getAge());
bodyFatData1.setWeight(user.getWeight());
bodyFatData1.setWeight(algorithmInfo.getWeight());
bodyFatData1.setSex(user.getSex()); bodyFatData1.setSex(user.getSex());
bodyFatData1.setHeight(user.getHeight()); bodyFatData1.setHeight(user.getHeight());
bodyFatData1.setAdc(algorithmInfo.getAdc()); bodyFatData1.setAdc(algorithmInfo.getAdc());

Loading…
取消
儲存