| @@ -7,8 +7,8 @@ android { | |||
| applicationId "aicare.net.cn.sdk.ailinksdkdemoandroid" | |||
| minSdkVersion 19 | |||
| targetSdkVersion 29 | |||
| versionCode 4 | |||
| versionName "1.5.4" | |||
| versionCode 5 | |||
| versionName "1.5.5" | |||
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | |||
| } | |||
| buildTypes { | |||
| @@ -35,9 +35,9 @@ dependencies { | |||
| implementation 'androidx.appcompat:appcompat:1.1.0' | |||
| implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | |||
| testImplementation 'junit:junit:4.12' | |||
| implementation 'com.github.elinkthings:AILinkSDKRepositoryAndroid:1.7.4'//蓝牙核心库 | |||
| implementation 'com.github.elinkthings:AILinkSDKOtaLibraryAndroid:1.0.0'//OTA库,需要依赖核心库 | |||
| implementation 'com.github.elinkthings:AILinkSDKParsingLibraryAndroid:1.5.4'//解析库,需要依赖核心库 | |||
| implementation 'com.github.elinkthings:AILinkSDKRepositoryAndroid:1.7.8'//蓝牙核心库 | |||
| implementation 'com.github.elinkthings:AILinkSDKOtaLibraryAndroid:1.0.1'//OTA库,需要依赖核心库 | |||
| implementation 'com.github.elinkthings:AILinkSDKParsingLibraryAndroid:1.5.5'//解析库,需要依赖核心库 | |||
| implementation 'androidx.recyclerview:recyclerview:1.1.0' | |||
| implementation 'com.jakewharton:butterknife:10.2.0' | |||
| annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0' | |||
| @@ -0,0 +1,100 @@ | |||
| package aicare.net.cn.sdk.ailinksdkdemoandroid; | |||
| import com.holtek.libHTBodyfat.HTBodyBasicInfo; | |||
| import com.holtek.libHTBodyfat.HTBodyResultAllBody; | |||
| import java.util.Locale; | |||
| public class EightBodyFatAlgorithms { | |||
| public EightBodyFatAlgorithms() { | |||
| } | |||
| private static class AlgorithmsHolder { | |||
| private static EightBodyFatAlgorithms algorithmsUnit = new EightBodyFatAlgorithms(); | |||
| } | |||
| public static EightBodyFatAlgorithms getInstance() { | |||
| return AlgorithmsHolder.algorithmsUnit; | |||
| } | |||
| public EightBodyFatBean getAlgorithmsData(int algorithms, int sex, int height, float weight_kg, int age, EightBodyfatAdc eightBodyfatAdc) { | |||
| EightBodyFatBean eightBodyFatBean = new EightBodyFatBean(); | |||
| switch (algorithms) { | |||
| //和泰算法 | |||
| case 1: | |||
| default: | |||
| HTBodyBasicInfo basicInfo = new HTBodyBasicInfo(sex, height, weight_kg, age); | |||
| basicInfo.htZAllBodyImpedance = eightBodyfatAdc.getAdcRightBody(); | |||
| basicInfo.htZLeftLegImpedance = eightBodyfatAdc.getAdcLeftFoot(); | |||
| basicInfo.htZRightLegImpedance = eightBodyfatAdc.getAdcRightFoot(); | |||
| basicInfo.htZLeftArmImpedance = eightBodyfatAdc.getAdcLeftHand(); | |||
| basicInfo.htZRightArmImpedance = eightBodyfatAdc.getAdcRightHand(); | |||
| basicInfo.htTwoLegsImpedance = eightBodyfatAdc.getAdcFoot(); | |||
| basicInfo.htTwoArmsImpedance = eightBodyfatAdc.getAdcHand(); | |||
| HTBodyResultAllBody resultTwoLegs = new HTBodyResultAllBody(); | |||
| int errorType = resultTwoLegs.getBodyfatWithBasicInfo(basicInfo); | |||
| if (errorType == HTBodyBasicInfo.ErrorNone) { | |||
| eightBodyFatBean.setBmi(Adecimal(resultTwoLegs.htBMI)); | |||
| eightBodyFatBean.setBmr((float) resultTwoLegs.htBMR); | |||
| eightBodyFatBean.setUvi((float) resultTwoLegs.htVFAL); | |||
| eightBodyFatBean.setBm(String.valueOf((float) resultTwoLegs.htBoneKg)); | |||
| eightBodyFatBean.setBfr(Adecimal(resultTwoLegs.htBodyfatPercentage)); | |||
| eightBodyFatBean.setVwc(Adecimal(resultTwoLegs.htWaterPercentage)); | |||
| eightBodyFatBean.setRom(Adecimal(resultTwoLegs.htMusclePercentage)); | |||
| eightBodyFatBean.setBodyAge(resultTwoLegs.htBodyAge); | |||
| eightBodyFatBean.setPp(Adecimal(resultTwoLegs.htProteinPercentage)); | |||
| eightBodyFatBean.setSfr(Adecimal(resultTwoLegs.htBodyfatSubcut)); | |||
| eightBodyFatBean.setFatMassBody(String.valueOf(resultTwoLegs.htBodyfatKgTrunk)); | |||
| eightBodyFatBean.setFatMassLeftTop(String.valueOf(resultTwoLegs.htBodyfatKgLeftArm)); | |||
| eightBodyFatBean.setFatMassLeftBottom(String.valueOf(resultTwoLegs.htBodyfatKgLeftLeg)); | |||
| eightBodyFatBean.setFatMassRightTop(String.valueOf(resultTwoLegs.htBodyfatKgRightArm)); | |||
| eightBodyFatBean.setFatMassRightBottom(String.valueOf(resultTwoLegs.htBodyfatKgRightLeg)); | |||
| // eightBodyFatBean.setFatMass(resultTwoLegs.htBodyfatKg); | |||
| eightBodyFatBean.setMuscleMassBody(String.valueOf(resultTwoLegs.htMuscleKgTrunk)); | |||
| eightBodyFatBean.setMuscleMassLeftTop(String.valueOf(resultTwoLegs.htMuscleKgLeftArm)); | |||
| eightBodyFatBean.setMuscleMassLeftBottom(String.valueOf(resultTwoLegs.htMuscleKgLeftLeg)); | |||
| eightBodyFatBean.setMuscleMassRightTop(String.valueOf(resultTwoLegs.htMuscleKgRightArm)); | |||
| eightBodyFatBean.setMuscleMassRightBottom(String.valueOf(resultTwoLegs.htMuscleKgRightLeg)); | |||
| // eightBodyFatBean.setMusleMass(resultTwoLegs.htMuscleKg); | |||
| // eightBodyFatBean.setStandardWeight(resultTwoLegs.htIdealWeightKg); | |||
| // eightBodyFatBean.setWeightWithoutFat(resultTwoLegs.htBodyfatFreeMass); | |||
| // eightBodyFatBean.setWeightControl((weight_kg - resultTwoLegs.htIdealWeightKg)); | |||
| // eightBodyFatBean.setFatLevel(HealthyStatusUtil.ObesitylevelsStatus(weight_kg, (float) resultTwoLegs.htIdealWeightKg)); | |||
| // double muscle = (resultTwoLegs.htMuscleKgLeftArm + resultTwoLegs.htMuscleKgLeftLeg + resultTwoLegs.htMuscleKgRightArm + resultTwoLegs.htMuscleKgRightLeg); | |||
| // eightBodyFatBean.setMusleMassLimbs(Adecimal(muscle / (height * height) * 10000)); | |||
| eightBodyFatBean.setAdcFoot((resultTwoLegs.htZLeftLeg + resultTwoLegs.htZRightLeg)); | |||
| eightBodyFatBean.setAdcHand((resultTwoLegs.htZLeftArm + resultTwoLegs.htZRightArm)); | |||
| eightBodyFatBean.setAdcLeftHand(resultTwoLegs.htZLeftArm); | |||
| eightBodyFatBean.setAdcRightHand(resultTwoLegs.htZRightArm); | |||
| eightBodyFatBean.setAdcLeftFoot(resultTwoLegs.htZLeftLeg); | |||
| eightBodyFatBean.setAdcRightFoot(resultTwoLegs.htZRightLeg); | |||
| eightBodyFatBean.setAdcLeftBody(resultTwoLegs.htZAllBody); | |||
| eightBodyFatBean.setAdcRightBody(resultTwoLegs.htZAllBody); | |||
| eightBodyFatBean.setAdcRightHandLeftFoot((resultTwoLegs.htZRightArm + resultTwoLegs.htZLeftLeg)); | |||
| eightBodyFatBean.setAdcLeftHandRightFoot((resultTwoLegs.htZLeftArm + resultTwoLegs.htZRightLeg)); | |||
| eightBodyFatBean.setAdcBody(resultTwoLegs.htZAllBody); | |||
| } | |||
| } | |||
| return eightBodyFatBean; | |||
| } | |||
| private float Adecimal(double data) { | |||
| return Float.parseFloat(String.format(Locale.US, "%.1f", data)); | |||
| } | |||
| } | |||
| @@ -0,0 +1,335 @@ | |||
| package aicare.net.cn.sdk.ailinksdkdemoandroid; | |||
| public class EightBodyFatBean { | |||
| private String weight; //体重, | |||
| private float bmi; //体质指数, | |||
| private float bfr; //体脂率, | |||
| private float sfr; //皮下脂肪率, | |||
| private float uvi; //内脏脂肪率, | |||
| private float rom; //肌肉率, | |||
| private float bmr; //基础代谢率, | |||
| private String bm; //骨骼质量, | |||
| private float vwc; //水含量, | |||
| private int bodyAge; //身体年龄, | |||
| private float pp; //蛋白率, | |||
| private double adcFoot; //双脚阻抗, | |||
| private double adcHand;//双手阻抗 | |||
| private double adcLeftHand; //左手阻抗 | |||
| private double adcRightHand; //右手阻抗 | |||
| private double adcLeftFoot; //左脚阻抗 | |||
| private double adcRightFoot; //右脚阻抗 | |||
| private double adcLeftBody; | |||
| private double adcRightBody; | |||
| private double adcRightHandLeftFoot; | |||
| private double adcLeftHandRightFoot; | |||
| private double adcBody; | |||
| private int arithmetic; | |||
| private int heartRate; | |||
| private String fatMassRightTop; //体脂-右上 | |||
| private String fatMassRightBottom; //体脂-右下 | |||
| private String fatMassLeftTop; //体脂-左上 | |||
| private String fatMassLeftBottom; //体脂-左下 | |||
| private String fatMassBody; //体脂-躯干 | |||
| private String muscleMassRightTop; //肌肉-右上 | |||
| private String muscleMassRightBottom; //肌肉-右下 | |||
| private String muscleMassLeftTop; //肌肉-左上 | |||
| private String muscleMassLeftBottom; //肌肉-左下 | |||
| private String muscleMassBody; //肌肉-躯干 | |||
| private String testAdc; | |||
| public String getTestAdc() { | |||
| return testAdc; | |||
| } | |||
| public void setTestAdc(String testAdc) { | |||
| this.testAdc = testAdc; | |||
| } | |||
| public String getWeight() { | |||
| return weight; | |||
| } | |||
| public void setWeight(String weight) { | |||
| this.weight = weight; | |||
| } | |||
| public float getBmi() { | |||
| return bmi; | |||
| } | |||
| public void setBmi(float bmi) { | |||
| this.bmi = bmi; | |||
| } | |||
| public float getBfr() { | |||
| return bfr; | |||
| } | |||
| public void setBfr(float bfr) { | |||
| this.bfr = bfr; | |||
| } | |||
| public float getSfr() { | |||
| return sfr; | |||
| } | |||
| public void setSfr(float sfr) { | |||
| this.sfr = sfr; | |||
| } | |||
| public float getUvi() { | |||
| return uvi; | |||
| } | |||
| public void setUvi(float uvi) { | |||
| this.uvi = uvi; | |||
| } | |||
| public float getRom() { | |||
| return rom; | |||
| } | |||
| public void setRom(float rom) { | |||
| this.rom = rom; | |||
| } | |||
| public float getBmr() { | |||
| return bmr; | |||
| } | |||
| public void setBmr(float bmr) { | |||
| this.bmr = bmr; | |||
| } | |||
| public String getBm() { | |||
| return bm; | |||
| } | |||
| public void setBm(String bm) { | |||
| this.bm = bm; | |||
| } | |||
| public float getVwc() { | |||
| return vwc; | |||
| } | |||
| public void setVwc(float vwc) { | |||
| this.vwc = vwc; | |||
| } | |||
| public int getBodyAge() { | |||
| return bodyAge; | |||
| } | |||
| public void setBodyAge(int bodyAge) { | |||
| this.bodyAge = bodyAge; | |||
| } | |||
| public float getPp() { | |||
| return pp; | |||
| } | |||
| public void setPp(float pp) { | |||
| this.pp = pp; | |||
| } | |||
| public double getAdcFoot() { | |||
| return adcFoot; | |||
| } | |||
| public void setAdcFoot(double adcFoot) { | |||
| this.adcFoot = adcFoot; | |||
| } | |||
| public double getAdcHand() { | |||
| return adcHand; | |||
| } | |||
| public void setAdcHand(double adcHand) { | |||
| this.adcHand = adcHand; | |||
| } | |||
| public double getAdcLeftHand() { | |||
| return adcLeftHand; | |||
| } | |||
| public void setAdcLeftHand(double adcLeftHand) { | |||
| this.adcLeftHand = adcLeftHand; | |||
| } | |||
| public double getAdcRightHand() { | |||
| return adcRightHand; | |||
| } | |||
| public void setAdcRightHand(double adcRightHand) { | |||
| this.adcRightHand = adcRightHand; | |||
| } | |||
| public double getAdcLeftFoot() { | |||
| return adcLeftFoot; | |||
| } | |||
| public void setAdcLeftFoot(double adcLeftFoot) { | |||
| this.adcLeftFoot = adcLeftFoot; | |||
| } | |||
| public double getAdcRightFoot() { | |||
| return adcRightFoot; | |||
| } | |||
| public void setAdcRightFoot(double adcRightFoot) { | |||
| this.adcRightFoot = adcRightFoot; | |||
| } | |||
| public double getAdcLeftBody() { | |||
| return adcLeftBody; | |||
| } | |||
| public void setAdcLeftBody(double adcLeftBody) { | |||
| this.adcLeftBody = adcLeftBody; | |||
| } | |||
| public double getAdcRightBody() { | |||
| return adcRightBody; | |||
| } | |||
| public void setAdcRightBody(double adcRightBody) { | |||
| this.adcRightBody = adcRightBody; | |||
| } | |||
| public double getAdcRightHandLeftFoot() { | |||
| return adcRightHandLeftFoot; | |||
| } | |||
| public void setAdcRightHandLeftFoot(double adcRightHandLeftFoot) { | |||
| this.adcRightHandLeftFoot = adcRightHandLeftFoot; | |||
| } | |||
| public double getAdcLeftHandRightFoot() { | |||
| return adcLeftHandRightFoot; | |||
| } | |||
| public void setAdcLeftHandRightFoot(double adcLeftHandRightFoot) { | |||
| this.adcLeftHandRightFoot = adcLeftHandRightFoot; | |||
| } | |||
| public double getAdcBody() { | |||
| return adcBody; | |||
| } | |||
| public void setAdcBody(double adcBody) { | |||
| this.adcBody = adcBody; | |||
| } | |||
| public String getFatMassRightTop() { | |||
| return fatMassRightTop; | |||
| } | |||
| public void setFatMassRightTop(String fatMassRightTop) { | |||
| this.fatMassRightTop = fatMassRightTop; | |||
| } | |||
| public String getFatMassRightBottom() { | |||
| return fatMassRightBottom; | |||
| } | |||
| public void setFatMassRightBottom(String fatMassRightBottom) { | |||
| this.fatMassRightBottom = fatMassRightBottom; | |||
| } | |||
| public String getFatMassLeftTop() { | |||
| return fatMassLeftTop; | |||
| } | |||
| public void setFatMassLeftTop(String fatMassLeftTop) { | |||
| this.fatMassLeftTop = fatMassLeftTop; | |||
| } | |||
| public String getFatMassLeftBottom() { | |||
| return fatMassLeftBottom; | |||
| } | |||
| public void setFatMassLeftBottom(String fatMassLeftBottom) { | |||
| this.fatMassLeftBottom = fatMassLeftBottom; | |||
| } | |||
| public String getFatMassBody() { | |||
| return fatMassBody; | |||
| } | |||
| public void setFatMassBody(String fatMassBody) { | |||
| this.fatMassBody = fatMassBody; | |||
| } | |||
| public String getMuscleMassRightTop() { | |||
| return muscleMassRightTop; | |||
| } | |||
| public void setMuscleMassRightTop(String muscleMassRightTop) { | |||
| this.muscleMassRightTop = muscleMassRightTop; | |||
| } | |||
| public String getMuscleMassRightBottom() { | |||
| return muscleMassRightBottom; | |||
| } | |||
| public void setMuscleMassRightBottom(String muscleMassRightBottom) { | |||
| this.muscleMassRightBottom = muscleMassRightBottom; | |||
| } | |||
| public String getMuscleMassLeftTop() { | |||
| return muscleMassLeftTop; | |||
| } | |||
| public void setMuscleMassLeftTop(String muscleMassLeftTop) { | |||
| this.muscleMassLeftTop = muscleMassLeftTop; | |||
| } | |||
| public String getMuscleMassLeftBottom() { | |||
| return muscleMassLeftBottom; | |||
| } | |||
| public void setMuscleMassLeftBottom(String muscleMassLeftBottom) { | |||
| this.muscleMassLeftBottom = muscleMassLeftBottom; | |||
| } | |||
| public String getMuscleMassBody() { | |||
| return muscleMassBody; | |||
| } | |||
| public void setMuscleMassBody(String muscleMassBody) { | |||
| this.muscleMassBody = muscleMassBody; | |||
| } | |||
| public int getArithmetic() { | |||
| return arithmetic; | |||
| } | |||
| public void setArithmetic(int arithmetic) { | |||
| this.arithmetic = arithmetic; | |||
| } | |||
| public void setHeartRate(int heartRate) { | |||
| this.heartRate = heartRate; | |||
| } | |||
| public int getHeartRate() { | |||
| return heartRate; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "EightBodyFatBean{" + "weight='" + weight + '\'' + ", bmi=" + bmi + ", bfr=" + bfr + ", sfr=" + sfr + ", uvi=" + uvi + ", rom=" + rom + ", bmr=" + bmr + ", bm='" + bm + '\'' + ", " + | |||
| "vwc=" + vwc + ", bodyAge=" + bodyAge + ", pp=" + pp + ", adcFoot=" + adcFoot + ", adcHand=" + adcHand + ", adcLeftHand=" + adcLeftHand + ", adcRightHand=" + adcRightHand + ", " + | |||
| "adcLeftFoot=" + adcLeftFoot + ", adcRightFoot=" + adcRightFoot + ", adcLeftBody=" + adcLeftBody + ", adcRightBody=" + adcRightBody + ", adcRightHandLeftFoot=" + adcRightHandLeftFoot + ", adcLeftHandRightFoot=" + adcLeftHandRightFoot + ", adcBody=" + adcBody + ", arithmetic=" + arithmetic + ", heartRate=" + heartRate + ", fatMassRightTop='" + fatMassRightTop + '\'' + ", fatMassRightBottom='" + fatMassRightBottom + '\'' + ", fatMassLeftTop='" + fatMassLeftTop + '\'' + ", fatMassLeftBottom='" + fatMassLeftBottom + '\'' + ", fatMassBody='" + fatMassBody + '\'' + ", muscleMassRightTop='" + muscleMassRightTop + '\'' + ", muscleMassRightBottom='" + muscleMassRightBottom + '\'' + ", muscleMassLeftTop='" + muscleMassLeftTop + '\'' + ", muscleMassLeftBottom='" + muscleMassLeftBottom + '\'' + ", muscleMassBody='" + muscleMassBody + '\'' + ", testAdc='" + testAdc + '\'' + '}'; | |||
| } | |||
| } | |||
| @@ -7,8 +7,6 @@ import android.widget.CompoundButton; | |||
| import android.widget.ListView; | |||
| import android.widget.RadioButton; | |||
| import com.holtek.libHTBodyfat.HTBodyBasicInfo; | |||
| import com.holtek.libHTBodyfat.HTBodyResultAllBody; | |||
| import com.pingwang.bluetoothlib.BleBaseActivity; | |||
| import com.pingwang.bluetoothlib.bean.SupportUnitBean; | |||
| import com.pingwang.bluetoothlib.device.BleDevice; | |||
| @@ -74,6 +72,7 @@ public class EightBodyfatActivity extends BleBaseActivity implements View.OnClic | |||
| } | |||
| }); | |||
| stlb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { | |||
| @Override | |||
| public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { | |||
| if (isChecked) { | |||
| @@ -406,40 +405,12 @@ public class EightBodyfatActivity extends BleBaseActivity implements View.OnClic | |||
| private void kaimengJieMi(EightBodyfatAdc mEightBodyfatAdc) { | |||
| loglist.add(0,mEightBodyfatAdc.toString()); | |||
| HTBodyBasicInfo basicInfo = new HTBodyBasicInfo(1, 170, 65, 25); | |||
| loglist.add(0, "默认传入用户: 性别:男,身高:170,体重 65kg 年龄25"); | |||
| basicInfo.htZAllBodyImpedance = mEightBodyfatAdc.getAdcRightBody(); | |||
| basicInfo.htZLeftLegImpedance = mEightBodyfatAdc.getAdcLeftFoot(); | |||
| basicInfo.htZRightLegImpedance = mEightBodyfatAdc.getAdcRightFoot(); | |||
| basicInfo.htZLeftArmImpedance = mEightBodyfatAdc.getAdcLeftHand(); | |||
| basicInfo.htZRightArmImpedance = mEightBodyfatAdc.getAdcRightHand(); | |||
| basicInfo.htTwoLegsImpedance = mEightBodyfatAdc.getAdcFoot(); | |||
| basicInfo.htTwoArmsImpedance = mEightBodyfatAdc.getAdcHand(); | |||
| HTBodyResultAllBody resultTwoLegs = new HTBodyResultAllBody(); | |||
| int errorType = resultTwoLegs.getBodyfatWithBasicInfo(basicInfo); | |||
| if (errorType == HTBodyBasicInfo.ErrorNone) { | |||
| String jiemi="加密阻抗:" + | |||
| " \n双脚=" + (resultTwoLegs.htZLeftLeg + resultTwoLegs.htZRightLeg) + | |||
| " \n双手=" + (resultTwoLegs.htZLeftArm + resultTwoLegs.htZRightArm) + | |||
| " \n左手=" + resultTwoLegs.htZLeftArm + | |||
| " \n右手=" + resultTwoLegs.htZRightArm + | |||
| " \n左脚=" + resultTwoLegs.htZLeftLeg + | |||
| " \n右脚=" + resultTwoLegs.htZRightLeg + | |||
| " \n左躯干=" + (resultTwoLegs.htZAllBody)+ | |||
| " \n右躯干=" + (resultTwoLegs.htZAllBody)+ | |||
| " \n右手左脚=" + (resultTwoLegs.htZRightArm + resultTwoLegs.htZLeftLeg) + | |||
| " \n左手右脚=" + (resultTwoLegs.htZLeftArm + resultTwoLegs.htZRightLeg) + | |||
| " \n全身=" + resultTwoLegs.htZAllBody; | |||
| loglist.add(0, jiemi); | |||
| } else { | |||
| loglist.add(0, "解析阻抗:错误码:" + errorType + "\n" | |||
| + " ErrorAge = 1 ,ErrorWeight = 2, ErrorHeight = 4, ErrorSex = 8, ErrorImpedance = 16, ErrorImpedanceLeftLeg = 32, ErrorImpedanceRightLeg = 64,ErrorImpedanceLeftArm = 128, ErrorImpedanceRightArm = 256" | |||
| ); | |||
| } | |||
| EightBodyFatBean algorithmsData = EightBodyFatAlgorithms.getInstance().getAlgorithmsData(1, 1, 170, 65, 25, mEightBodyfatAdc); | |||
| loglist.add(0, algorithmsData.toString()); | |||
| } | |||
| } | |||
| @@ -144,7 +144,7 @@ public class MainActivity extends BleAppBaseActivity { | |||
| BleLog.init("", "", BuildConfig.DEBUG); | |||
| String version = getString(R.string.version) + ":" + BuildConfig.VERSION_NAME; | |||
| ((TextView) findViewById(R.id.tv_app_version)).setText(version); | |||
| AILinkSDK.getInstance().init(this);//sdk | |||
| AILinkSDK.getInstance().init(getApplication());//sdk | |||
| SP.init(this); | |||
| } | |||
| @@ -187,7 +187,7 @@ public class TestOtaActivity extends BleBaseActivity implements OnCallbackBle, O | |||
| String byFileName = FileUtils.getByFileName() + mOTAFileName; | |||
| mList.add(TimeUtils.getTime() + "OTA已开始,请耐心等待"); | |||
| mHandler.sendEmptyMessage(REFRESH_DATA); | |||
| mDialogOtaManager= DialogOtaManager.newBuilder().setOnBleOTAListener(this).setFilePath(byFileName).setIcType(icType).build(mBleDevice); | |||
| mDialogOtaManager= DialogOtaManager.newBuilder().setOnBleOTAListener(this).setFile(byFileName).setIcType(icType).build(mBleDevice); | |||
| // mBleDevice.setOnDialogOTAListener(this); | |||
| // mBleDevice.startDialogOta(byFileName, icType,((Boolean) btn_shake_hands.getTag())); | |||
| } | |||
| @@ -117,7 +117,7 @@ public class FindDeviceNewActivity extends BleAppBaseActivity implements View.On | |||
| @Override | |||
| protected void initView() { | |||
| AILinkSDK.getInstance().init(this);//sdk | |||
| AILinkSDK.getInstance().init(getApplication());//sdk | |||
| btn_clear = findViewById(R.id.btn_clear); | |||
| tv_status = findViewById(R.id.tv_status); | |||
| list_view = findViewById(R.id.list_view); | |||