Browse Source

Fix the problem of incorrect weight data using APP algorithm

master
xing 3 years ago
parent
commit
40afe37592
2 changed files with 6 additions and 5 deletions
  1. 3
    3
      app/build.gradle
  2. 3
    2
      app/src/main/java/aicare/net/cn/iweightdemo/MyActivity.java

+ 3
- 3
app/build.gradle View File

@@ -7,8 +7,8 @@ android {
applicationId "aicare.net.cn.sdk.iweightdemo"
minSdkVersion 18
targetSdkVersion 29
versionCode 12
versionName "1.3.0"
versionCode 13
versionName "1.3.1"
}
buildTypes {
release {
@@ -38,6 +38,6 @@ dependencies {
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
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 View File

@@ -649,6 +649,7 @@ public class MyActivity extends BleProfileServiceReadyActivity implements Device
public void onGetWeightData(final WeightData weightData) {
if (weightData == null)
return;
L.i(TAG,"WeightData:"+weightData.toString());
setWeighDataText(AicareBleConfig.getWeight(weightData.getWeight(), unit, weightData.getDecimalInfo()));
if (weightData.getTemp() != Double.MAX_VALUE) {
tv_temp.setText(getString(R.string.temp, String.valueOf(weightData.getTemp())));
@@ -847,11 +848,11 @@ public class MyActivity extends BleProfileServiceReadyActivity implements Device
showInfo(algorithmStr, true);
if (user != null) {
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());
BodyFatData bodyFatData1 = new BodyFatData();
bodyFatData1.setAge(user.getAge());
bodyFatData1.setWeight(user.getWeight());
bodyFatData1.setWeight(algorithmInfo.getWeight());
bodyFatData1.setSex(user.getSex());
bodyFatData1.setHeight(user.getHeight());
bodyFatData1.setAdc(algorithmInfo.getAdc());

Loading…
Cancel
Save