diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..639c779 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..74dd639 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/.~lock.CS_BIAS_V2.3.5标准样本.xlsx# b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/.~lock.CS_BIAS_V2.3.5标准样本.xlsx# new file mode 100644 index 0000000..7052658 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/.~lock.CS_BIAS_V2.3.5标准样本.xlsx# @@ -0,0 +1 @@ +,prathiyuman,csh-machine-2,10.12.2025 12:58,file:///home/prathiyuman/.config/libreoffice/4; \ No newline at end of file diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/CS-BIAS-V2.3.5_1_APP库API使用说明.pdf b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/CS-BIAS-V2.3.5_1_APP库API使用说明.pdf new file mode 100644 index 0000000..94fe595 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/CS-BIAS-V2.3.5_1_APP库API使用说明.pdf differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/CS_BIAS_V2.3.5标准样本.xlsx b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/CS_BIAS_V2.3.5标准样本.xlsx new file mode 100644 index 0000000..9a52b23 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/CS_BIAS_V2.3.5标准样本.xlsx differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/CS_BIAS_V2.3.5算法用户手册.pdf b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/CS_BIAS_V2.3.5算法用户手册.pdf new file mode 100644 index 0000000..15b4c70 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/CS_BIAS_V2.3.5算法用户手册.pdf differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/OKOK健康最新指标标准 (已经旧了,可参考).pdf b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/OKOK健康最新指标标准 (已经旧了,可参考).pdf new file mode 100644 index 0000000..845bb03 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/OKOK健康最新指标标准 (已经旧了,可参考).pdf differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android.zip b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android.zip new file mode 100644 index 0000000..357bea4 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android.zip differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.gitignore b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.gitignore new file mode 100644 index 0000000..fd45b12 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.gitignore @@ -0,0 +1,11 @@ +*.iml +.gradle +/local.properties +/.idea/caches/build_file_checksums.ser +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/codeStyles/Project.xml b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..30aa626 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/codeStyles/Project.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/gradle.xml b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/gradle.xml new file mode 100644 index 0000000..7ac24c7 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/misc.xml b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/misc.xml new file mode 100644 index 0000000..b0c7b20 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/misc.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/runConfigurations.xml b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/.gitignore b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/build.gradle b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/build.gradle new file mode 100644 index 0000000..0feed7e --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 28 + defaultConfig { + applicationId "com.example.chipsea.demo235_android" + minSdkVersion 15 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + + sourceSets { + main { + jniLibs.srcDirs = ['libs'] + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support.constraint:constraint-layout:1.1.3' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/arm64-v8a/libchipsea_bias_v235.so b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/arm64-v8a/libchipsea_bias_v235.so new file mode 100644 index 0000000..92b23a3 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/arm64-v8a/libchipsea_bias_v235.so differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/armeabi-v7a/libchipsea_bias_v235.so b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/armeabi-v7a/libchipsea_bias_v235.so new file mode 100644 index 0000000..9502a24 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/armeabi-v7a/libchipsea_bias_v235.so differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/armeabi/libchipsea_bias_v235.so b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/armeabi/libchipsea_bias_v235.so new file mode 100644 index 0000000..55f1639 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/armeabi/libchipsea_bias_v235.so differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/mips/libchipsea_bias_v235.so b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/mips/libchipsea_bias_v235.so new file mode 100644 index 0000000..76f8e8d Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/mips/libchipsea_bias_v235.so differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/mips64/libchipsea_bias_v235.so b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/mips64/libchipsea_bias_v235.so new file mode 100644 index 0000000..5363dd2 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/mips64/libchipsea_bias_v235.so differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/x86/libchipsea_bias_v235.so b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/x86/libchipsea_bias_v235.so new file mode 100644 index 0000000..29d7b4e Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/x86/libchipsea_bias_v235.so differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/x86_64/libchipsea_bias_v235.so b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/x86_64/libchipsea_bias_v235.so new file mode 100644 index 0000000..ca35c74 Binary files /dev/null and b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/libs/x86_64/libchipsea_bias_v235.so differ diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/proguard-rules.pro b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/androidTest/java/com/example/chipsea/demo235_android/ExampleInstrumentedTest.java b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/androidTest/java/com/example/chipsea/demo235_android/ExampleInstrumentedTest.java new file mode 100644 index 0000000..f504fa9 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/androidTest/java/com/example/chipsea/demo235_android/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.chipsea.demo235_android; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.example.chipsea.demo235_android", appContext.getPackageName()); + } +} diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/AndroidManifest.xml b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..927865f --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/java/chipsea/bias/v235/CSBiasAPI.java b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/java/chipsea/bias/v235/CSBiasAPI.java new file mode 100644 index 0000000..f4e1d91 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/java/chipsea/bias/v235/CSBiasAPI.java @@ -0,0 +1,119 @@ +package chipsea.bias.v235; + +/** + * Created by liangyc + * Time :2018/11/26 + * Des: + */ + +/* +测试数据 +身高, 体重,阻抗,性别, 年龄 +{170, 500, 4080, 1, 30}, +{170, 1000, 4280, 1, 30}, +{170, 1500, 4480, 1, 30}, +{170, 500, 4080, 0, 30}, +{170, 1000, 4280, 0, 30}, +{170, 1500, 4480, 0, 30}, +{170, 509, 4547, 1, 28}, +{164, 790, 3797, 1, 28}, +{174, 669, 4221, 1, 24}, +{158, 603, 4388, 0, 21}, +{163, 474, 4759, 0, 22}, +{160, 553, 4549, 1, 26}, +*/ +/* +测试结果 +BFP SLM BWP BMC VFR PP SMM BMR BMI SBW MC WC FC age score +5.0 45.3 62.9 2.2 1.0 27.7 26.0 1324 17.3 62.3 4.2 12.3 8.1 15 60 +33.0 64.8 50.2 2.3 20.5 14.5 34.8 1981 34.6 62.3 - 15.3 - 37.7 - 22.4 56 50 +42.7 84.2 46.0 1.7 41.5 10.1 43.5 2639 51.9 62.3 - 34.2 - 87.7 - 53.5 80 50 +15.3 40.4 55.6 1.9 1.0 25.3 23.6 1239 17.3 60.4 3.0 10.4 7.4 15 66 +45.0 51.0 42.6 4.0 13.5 8.4 32.3 1737 34.6 60.4 - 9.7 - 39.6 - 29.9 80 49 +45.0 78.5 38.3 4.0 26.5 14.0 41.1 2235 51.9 60.4 - 37.2 - 89.5 - 52.4 80 50 +6.1 44.7 61.4 3.1 1 26.5 24.9 1318 17.6 62.3 3.9 11.4 7.5 15 63 +27 55.7 53.5 1.9 12 17.1 30.7 1692 29.4 58 - 9.5 - 21 - 11.5 37 56 +16.6 53.1 57 2.7 5 22.4 29.9 1598 22.1 65.3 - 1.6 - 1.6 0 21 86 +32.4 38.2 48.8 2.6 4.5 14.5 21.7 1269 24.2 52.2 - 1.6 - 8.1 - 6.5 33 68 +18.4 36.3 54 2.3 1 22.6 19.5 1153 17.8 55.6 3 8.2 5.2 15 70 +*/ + +public class CSBiasAPI { + + public static final int CSBIAS_OK = 0; + public static final int CSBIAS_ERR_WEIGTH = -2; + public static final int CSBIAS_ERR_HEIGHT = -3; + public static final int CSBIAS_ERR_AGE = -4; + public static final int CSBIAS_ERR_SEX = -5; + public static final int CSBIAS_ERR_IMPEDANCE = -6; + public static final int CSBIAS_ERR_MODE = -7; + public static final int CSBIAS_ERR_VCODE = -8; + + static { + System.loadLibrary("chipsea_bias_v235"); + } + + /* + 人体成分算法 + - mode 模式,默认为0 + - sex 性别, 1男, 0女 + - age 年龄,取值在18 ~ 99岁之间 + - height 身高, 取值在90 ~ 220之间,表示90 ~ 220厘米. + - weight 体重,取值在200 ~ 1500之间,表示20公斤~150公斤. + - impedance 阻抗值, 取值在2000 ~ 15000. + - vkeyCode 指纹验证中的验证码 + */ + public static native CSBiasV235Resp cs_bias_v235(int mode, int sex, int age, int height, int weight, int impedance, int vkeyCode); + + /** + * Created by liangyc + * Time :2018/11/26 + * Des: + */ + public static class CSBiasDataV235 { + //体脂率 + public double BFP; + //肌肉量 + public double SLM; + //骨盐量 + public double BMC; + //体水分率 + public double BWP; + //蛋白质率 + public double PP; + //骨骼肌量 + public double SMM; + //内脏脂肪等级 + public double VFR; + //身体质量指数 + public double BMI; + //标准体重 + public double SBW; + //肌肉控制 + public double MC; + //体重控制 + public double WC; + //脂肪控制 + public double FC; + //基础代谢率 + public int BMR; + //身体年龄 + public int MA; + //身体得分 + public int SBC; + + } + + /** + * Created by liangyc + * Time :2018/11/26 + * Des: + */ + public static class CSBiasV235Resp { + public int result; + + public CSBiasDataV235 data; + + + } +} diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/java/com/example/chipsea/demo235_android/MainActivity.java b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/java/com/example/chipsea/demo235_android/MainActivity.java new file mode 100644 index 0000000..2cb9b13 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/java/com/example/chipsea/demo235_android/MainActivity.java @@ -0,0 +1,119 @@ +package com.example.chipsea.demo235_android; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.widget.EditText; +import android.widget.RadioButton; +import android.widget.TextView; +import com.example.chipsea.demo235_android.R; +import chipsea.bias.v235.CSBiasAPI; + + +/* +测试数据 +身高, 体重,阻抗,性别, 年龄 +{170, 500, 4080, 1, 30}, +{170, 1000, 4280, 1, 30}, +{170, 1500, 4480, 1, 30}, +{170, 500, 4080, 0, 30}, +{170, 1000, 4280, 0, 30}, +{170, 1500, 4480, 0, 30}, +{170, 509, 4547, 1, 28}, +{164, 790, 3797, 1, 28}, +{174, 669, 4221, 1, 24}, +{158, 603, 4388, 0, 21}, +{163, 474, 4759, 0, 22}, +{160, 553, 4549, 1, 26}, +*/ +/* +测试结果 +BFP SLM BWP BMC VFR PP SMM BMR BMI SBW MC WC FC age score +5.0 45.3 62.9 2.2 1.0 27.7 26.0 1324 17.3 62.3 4.2 12.3 8.1 15 60 +33.0 64.8 50.2 2.3 20.5 14.5 34.8 1981 34.6 62.3 - 15.3 - 37.7 - 22.4 56 50 +42.7 84.2 46.0 1.7 41.5 10.1 43.5 2639 51.9 62.3 - 34.2 - 87.7 - 53.5 80 50 +15.3 40.4 55.6 1.9 1.0 25.3 23.6 1239 17.3 60.4 3.0 10.4 7.4 15 66 +45.0 51.0 42.6 4.0 13.5 8.4 32.3 1737 34.6 60.4 - 9.7 - 39.6 - 29.9 80 49 +45.0 78.5 38.3 4.0 26.5 14.0 41.1 2235 51.9 60.4 - 37.2 - 89.5 - 52.4 80 50 +6.1 44.7 61.4 3.1 1 26.5 24.9 1318 17.6 62.3 3.9 11.4 7.5 15 63 +27 55.7 53.5 1.9 12 17.1 30.7 1692 29.4 58 - 9.5 - 21 - 11.5 37 56 +16.6 53.1 57 2.7 5 22.4 29.9 1598 22.1 65.3 - 1.6 - 1.6 0 21 86 +32.4 38.2 48.8 2.6 4.5 14.5 21.7 1269 24.2 52.2 - 1.6 - 8.1 - 6.5 33 68 +18.4 36.3 54 2.3 1 22.6 19.5 1153 17.8 55.6 3 8.2 5.2 15 70 +*/ +public class MainActivity extends AppCompatActivity { + + private EditText txtHeight, txtAge, txtWeight, txtR; + private RadioButton radioMale; + private TextView txtTest; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + txtHeight = (EditText) findViewById(R.id.txtHeight); + txtAge = (EditText) findViewById(R.id.txtAge); + txtWeight = (EditText) findViewById(R.id.txtWeight); + txtR = (EditText) findViewById(R.id.txtR); + radioMale = (RadioButton) findViewById(R.id.radioMale); + txtTest=findViewById(R.id.txtTest); + + } + + + public void newClick(View view) { + float height = Float.parseFloat(txtHeight.getText().toString()); + int age = Integer.parseInt(txtAge.getText().toString()); + float weight = Float.parseFloat(txtWeight.getText().toString()); + float r = Float.parseFloat(txtR.getText().toString()); + byte sex = 0; + if (radioMale.isChecked()) { + sex = 1; + } + + CSBiasAPI.CSBiasV235Resp cSBiasV235Resp = CSBiasAPI.cs_bias_v235(0, sex, age, + (int) height, (int) (weight*10), (int) (r*10), 2018); + + StringBuilder sb = new StringBuilder(); + + if (cSBiasV235Resp.result == CSBiasAPI.CSBIAS_OK) { + //计算 + try { + sb.append("输入\r\n"); + sb.append("性别:" + sex + " 身高:" + height + " 年龄:" + age + " 电阻:" + r + " 体重:" + weight + "\r\n"); + sb.append("**************************************\r\n"); + sb.append("**************************************\r\n"); + sb.append("脂肪率%:" + cSBiasV235Resp.data.BFP + "\r\n"); + sb.append("肌肉重kg:" + cSBiasV235Resp.data.SLM + "\r\n"); + sb.append("水含量%:" + cSBiasV235Resp.data.BWP + "\r\n"); + sb.append("骨盐量:" + cSBiasV235Resp.data.BMC + "\r\n"); + sb.append("内脏脂肪等级:" + cSBiasV235Resp.data.VFR + "\r\n"); + sb.append("蛋白质%:" + cSBiasV235Resp.data.PP+ "\r\n"); + sb.append("骨骼肌kg:" + cSBiasV235Resp.data.SMM+ "\r\n"); + sb.append("基础代谢:" + cSBiasV235Resp.data.BMR + "\r\n"); + sb.append("身体质量指数:" + cSBiasV235Resp.data.BMI + "\r\n"); + sb.append("标准体重kg:" + cSBiasV235Resp.data.SBW + "\r\n"); + sb.append("肌肉控制:" + cSBiasV235Resp.data.MC + "\r\n"); + sb.append("体重控制:" + cSBiasV235Resp.data.WC + "\r\n"); + sb.append("脂肪控制:" + cSBiasV235Resp.data.FC + "\r\n"); + sb.append("身体年龄:" + cSBiasV235Resp.data.MA + "\r\n"); + sb.append("评分:" + cSBiasV235Resp.data.SBC + "\r\n"); + + +// sb.append("脂肪重:" + builderEx.getFM() +"\r\n"); +// sb.append("瘦体重kg:" + builderEx.getLBM() + "\r\n"); +// sb.append("水重kg:" + builderEx.getTF() + "\r\n"); +// sb.append("肥胖度:" + builderEx.getOD() + "\r\n"); + sb.append("**************************************\r\n"); + +// sb.append("反查电阻:" + CsAlgoBuilderEx.getResistance(100f,(byte)0,38.0f,18,20.2f)); + } catch (Exception ex) { + sb.append("输入错误,错误码:" + ex.getLocalizedMessage()); + } + } else { + sb.append("输入错误,错误码:" + cSBiasV235Resp.result); + } + txtTest.setText(sb.toString()); + } +} diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..1f6bb29 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/res/drawable/ic_launcher_background.xml b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/res/layout/activity_main.xml b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..f862c5a --- /dev/null +++ b/app/2406 - Ivy SDK for EBS7007E/2406 - Ivy SDK for EBS7007E/android/Demo_Android/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +