wangjiawen 5 gadi atpakaļ
revīzija
b217b34de2
41 mainītis faili ar 4928 papildinājumiem un 0 dzēšanām
  1. 55 0
      .gitignore
  2. BIN
      .idea/caches/build_file_checksums.ser
  3. 29 0
      .idea/codeStyles/Project.xml
  4. 44 0
      .idea/misc.xml
  5. 10 0
      .idea/modules.xml
  6. 9 0
      android-smartband-sdk-sxrblejy2aidlclient/.classpath
  7. 55 0
      android-smartband-sdk-sxrblejy2aidlclient/.gitignore
  8. 33 0
      android-smartband-sdk-sxrblejy2aidlclient/.project
  9. 3 0
      android-smartband-sdk-sxrblejy2aidlclient/.settings/org.eclipse.core.resources.prefs
  10. 12 0
      android-smartband-sdk-sxrblejy2aidlclient/.settings/org.eclipse.jdt.core.prefs
  11. 73 0
      android-smartband-sdk-sxrblejy2aidlclient/AndroidManifest.xml
  12. 6 0
      android-smartband-sdk-sxrblejy2aidlclient/assets/JySDK.xml
  13. 44 0
      android-smartband-sdk-sxrblejy2aidlclient/build.gradle
  14. BIN
      android-smartband-sdk-sxrblejy2aidlclient/libs/android-smartband-sdk-sxrblejy2aidl-release.aar
  15. BIN
      android-smartband-sdk-sxrblejy2aidlclient/libs/android-smartband-sdk-sxrblejy2library-release.aar
  16. 16 0
      android-smartband-sdk-sxrblejy2aidlclient/project.properties
  17. 188 0
      android-smartband-sdk-sxrblejy2aidlclient/res/layout/activity_gyee.xml
  18. 427 0
      android-smartband-sdk-sxrblejy2aidlclient/res/layout/activity_main.xml
  19. 49 0
      android-smartband-sdk-sxrblejy2aidlclient/res/layout/device_listitem_text.xml
  20. 18 0
      android-smartband-sdk-sxrblejy2aidlclient/res/layout/popwindow_devicelist.xml
  21. BIN
      android-smartband-sdk-sxrblejy2aidlclient/res/mipmap-xxhdpi/ic_launcher.png
  22. 7 0
      android-smartband-sdk-sxrblejy2aidlclient/res/values/colors.xml
  23. 3 0
      android-smartband-sdk-sxrblejy2aidlclient/res/values/dimens.xml
  24. 30 0
      android-smartband-sdk-sxrblejy2aidlclient/res/values/strings.xml
  25. 21 0
      android-smartband-sdk-sxrblejy2aidlclient/res/values/styles.xml
  26. 70 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/BleDeviceItem.java
  27. 24 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/ComparatorBleDeviceItem.java
  28. 33 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/GeneralTsData.java
  29. 1675 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/GyeeActivity.java
  30. 1485 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/MainActivity.java
  31. 14 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/ReportData.java
  32. 92 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/RestService.java
  33. 9 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/SampleBleService.java
  34. 93 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/SysUtils.java
  35. 23 0
      android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/TsPointData.java
  36. 17 0
      build.gradle
  37. BIN
      gradle/wrapper/gradle-wrapper.jar
  38. 6 0
      gradle/wrapper/gradle-wrapper.properties
  39. 164 0
      gradlew
  40. 90 0
      gradlew.bat
  41. 1 0
      settings.gradle

+ 55 - 0
.gitignore

@@ -0,0 +1,55 @@
+# Built application files
+*.apk
+*.ap_
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# Intellij
+*.iml
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/gradle.xml
+.idea/dictionaries
+.idea/libraries
+
+# Keystore files
+*.jks
+
+# External native build folder generated in Android Studio 2.2 and later
+.externalNativeBuild
+
+# Google Services (e.g. APIs or Firebase)
+google-services.json
+
+# Freeline
+freeline.py
+freeline/
+freeline_project_description.json

BIN
.idea/caches/build_file_checksums.ser


+ 29 - 0
.idea/codeStyles/Project.xml

@@ -0,0 +1,29 @@
+<component name="ProjectCodeStyleConfiguration">
+  <code_scheme name="Project" version="173">
+    <Objective-C-extensions>
+      <file>
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
+      </file>
+      <class>
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
+      </class>
+      <extensions>
+        <pair source="cpp" header="h" fileNamingConvention="NONE" />
+        <pair source="c" header="h" fileNamingConvention="NONE" />
+      </extensions>
+    </Objective-C-extensions>
+  </code_scheme>
+</component>

+ 44 - 0
.idea/misc.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="NullableNotNullManager">
+    <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
+    <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
+    <option name="myNullables">
+      <value>
+        <list size="10">
+          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
+          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
+          <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
+          <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
+          <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+          <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
+          <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
+          <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
+          <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
+          <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
+        </list>
+      </value>
+    </option>
+    <option name="myNotNulls">
+      <value>
+        <list size="9">
+          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
+          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
+          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
+          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
+          <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
+          <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
+          <item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
+          <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
+          <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
+        </list>
+      </value>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/build/classes" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="Android" />
+  </component>
+</project>

+ 10 - 0
.idea/modules.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/android-smartband-sdk-sxrblejy2.iml" filepath="$PROJECT_DIR$/android-smartband-sdk-sxrblejy2.iml" />
+      <module fileurl="file://$PROJECT_DIR$/android-smartband-sdk-sxrblejy2aidlclient/android-smartband-sdk-sxrblejy2aidlclient.iml" filepath="$PROJECT_DIR$/android-smartband-sdk-sxrblejy2aidlclient/android-smartband-sdk-sxrblejy2aidlclient.iml" />
+      <module fileurl="file://$PROJECT_DIR$/bracelet_app.iml" filepath="$PROJECT_DIR$/bracelet_app.iml" />
+    </modules>
+  </component>
+</project>

+ 9 - 0
android-smartband-sdk-sxrblejy2aidlclient/.classpath

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+	<classpathentry kind="output" path="bin/classes"/>
+</classpath>

+ 55 - 0
android-smartband-sdk-sxrblejy2aidlclient/.gitignore

@@ -0,0 +1,55 @@
+# Built application files
+*.apk
+*.ap_
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# Intellij
+*.iml
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/gradle.xml
+.idea/dictionaries
+.idea/libraries
+
+# Keystore files
+*.jks
+
+# External native build folder generated in Android Studio 2.2 and later
+.externalNativeBuild
+
+# Google Services (e.g. APIs or Firebase)
+google-services.json
+
+# Freeline
+freeline.py
+freeline/
+freeline_project_description.json

+ 33 - 0
android-smartband-sdk-sxrblejy2aidlclient/.project

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>SXRBleKeepFitAIDLClient</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

+ 3 - 0
android-smartband-sdk-sxrblejy2aidlclient/.settings/org.eclipse.core.resources.prefs

@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+encoding//src/com/sxr/sdk/ble/keepfit/client/MainActivity.java=UTF-8
+encoding/<project>=UTF-8

+ 12 - 0
android-smartband-sdk-sxrblejy2aidlclient/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,12 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7

+ 73 - 0
android-smartband-sdk-sxrblejy2aidlclient/AndroidManifest.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.sxr.sdk.ble.keepfit.client"
+    android:versionCode="2"
+    android:versionName="1.0.1">
+
+    <uses-sdk android:targetSdkVersion="19" />
+    
+    <uses-permission android:name="android.permission.BLUETOOTH" />
+    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
+    <uses-permission android:name="android.permission.RECEIVE_SMS" />
+    <uses-permission android:name="android.permission.READ_SMS" />
+    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+     
+    <!-- 调用相机权限 -->
+    <uses-permission android:name="android.permission.CAMERA" />
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+
+    <uses-feature android:name="android.hardware.camera" />
+    <uses-feature android:name="android.hardware.camera.autofocus" />
+    <uses-feature android:name="android.hardware.microphone" />
+
+    <uses-permission android:name="android.permission.READ_CALL_LOG"/>
+
+    <!-- 获取运营商信息,用于支持提供运营商信息相关的接口-->
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
+    <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位-->
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
+    <!-- 用于读取手机当前的状态-->
+    <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
+    <!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据-->
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
+    <!-- 访问网络,网络定位需要上网-->
+    <uses-permission android:name="android.permission.INTERNET" />
+    <!-- SD卡读取权限,用户写入离线定位数据-->
+    <!-- 粗略的位置权限 -->
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
+    <!-- 精确的位置权限 -->
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
+
+    <uses-feature
+        android:name="android.hardware.bluetooth_le"
+        android:required="true" />
+    
+    <application
+        android:allowBackup="false"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:theme="@style/AppTheme" >
+        
+        <service
+            android:name="com.sxr.sdk.ble.keepfit.client.SampleBleService"
+            android:enabled="true"
+            android:process="com.sxr.sdk.ble.keepfit.client.SampleBleService"
+            android:exported="true" >
+
+            <intent-filter>
+                <action android:name="com.sxr.sdk.ble.BluetoothLeService.SampleBleService" />
+            </intent-filter>
+        </service>
+        
+        <activity
+            android:name="com.sxr.sdk.ble.keepfit.client.GyeeActivity"
+            android:label="@string/app_name" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>

+ 6 - 0
android-smartband-sdk-sxrblejy2aidlclient/assets/JySDK.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sdk>
+       <vid>000001001101</vid>
+       <appid>HUNEPX60P3KIDYH</appid>
+       <secret>b8FXJMzfELLOTM6BgGsFXmieePgqx1Ya50gPEUur</secret>
+</sdk>

+ 44 - 0
android-smartband-sdk-sxrblejy2aidlclient/build.gradle

@@ -0,0 +1,44 @@
+apply plugin: 'com.android.application'
+
+dependencies {
+    implementation fileTree(dir: 'libs', include: '*.jar')
+    implementation(name: 'android-smartband-sdk-sxrblejy2library-release', ext: 'aar')
+    implementation(name: 'android-smartband-sdk-sxrblejy2aidl-release', ext: 'aar')
+}
+
+android {
+    compileSdkVersion 21
+    buildToolsVersion '28.0.2'
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_7
+        targetCompatibility JavaVersion.VERSION_1_7
+    }
+
+    sourceSets {
+        main {
+            manifest.srcFile 'AndroidManifest.xml'
+            java.srcDirs = ['src']
+            resources.srcDirs = ['src']
+            aidl.srcDirs = ['src']
+            renderscript.srcDirs = ['src']
+            res.srcDirs = ['res']
+            assets.srcDirs = ['assets']
+        }
+
+        // Move the tests to tests/java, tests/res, etc...
+        androidTest.setRoot('tests')
+
+        // Move the build types to build-types/<type>
+        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
+        // This moves them out of them default location under src/<type>/... which would
+        // conflict with src/ being used by the main source set.
+        // Adding new build types or product flavors should be accompanied
+        // by a similar customization.
+        debug.setRoot('build-types/debug')
+        release.setRoot('build-types/release')
+    }
+    defaultConfig {
+        minSdkVersion = 18
+    }
+}

BIN
android-smartband-sdk-sxrblejy2aidlclient/libs/android-smartband-sdk-sxrblejy2aidl-release.aar


BIN
android-smartband-sdk-sxrblejy2aidlclient/libs/android-smartband-sdk-sxrblejy2library-release.aar


+ 16 - 0
android-smartband-sdk-sxrblejy2aidlclient/project.properties

@@ -0,0 +1,16 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-21
+android.library.reference.1=../android-smartband-sdk-sxrblejy2aidl
+android.library.reference.2=../android-smartband-sdk-sxrblejy2library

+ 188 - 0
android-smartband-sdk-sxrblejy2aidlclient/res/layout/activity_gyee.xml

@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:padding="8dp">
+
+    <TextView
+        android:id="@+id/data_text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text=""
+        android:textColor="@android:color/holo_green_dark" />
+
+    <ScrollView
+        android:id="@+id/svLog"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:visibility="gone">
+
+        <TextView
+            android:id="@+id/tvSync"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:visibility="visible" />
+    </ScrollView>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:focusable="true"
+        android:focusableInTouchMode="true">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+
+
+            <EditText
+                    android:id="@+id/phone_number"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:ems="10"
+                    android:hint="请输入手机号码"
+                    android:inputType="number"
+                    android:visibility="gone"
+                    tools:layout_editor_absoluteX="72dp"
+                    tools:layout_editor_absoluteY="147dp" />
+
+        </LinearLayout>
+
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+
+            <Button
+                android:id="@+id/bind"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="@string/bind" />
+
+            <Button
+                android:id="@+id/unbind"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:enabled="false"
+                android:text="@string/unbind" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+
+            <Button
+                android:id="@+id/scan"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:enabled="false"
+                android:text="@string/scan" />
+
+            <Button
+                android:id="@+id/connect"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:enabled="false"
+                android:text="@string/connect"
+                android:visibility="gone" />
+
+            <Button
+                android:id="@+id/disconnect"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:enabled="false"
+                android:text="@string/disconnect" />
+        </LinearLayout>
+
+        <ScrollView
+            android:id="@+id/svDevice"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <LinearLayout
+                android:id="@+id/llConnect"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:visibility="gone">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/set_vir"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_vir" />
+
+                    <Button
+                        android:id="@+id/getcursportdata"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/sync_time" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/read_fw"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/read_deviceinfo" />
+
+                    <Button
+                        android:id="@+id/read_batery"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/read_batery" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/bt_open_blood"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="开始测量" />
+
+                    <Button
+                        android:id="@+id/bt_close_blood"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="关闭测量" />
+
+                </LinearLayout>
+
+
+            </LinearLayout>
+        </ScrollView>
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 427 - 0
android-smartband-sdk-sxrblejy2aidlclient/res/layout/activity_main.xml

@@ -0,0 +1,427 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:padding="8dp">
+
+    <TextView
+        android:id="@+id/data_text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text=""
+        android:textColor="@android:color/holo_green_dark" />
+
+    <ScrollView
+        android:id="@+id/svLog"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:visibility="gone">
+
+        <TextView
+            android:id="@+id/tvSync"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:visibility="visible" />
+    </ScrollView>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:focusable="true"
+        android:focusableInTouchMode="true">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+
+            <Button
+                android:id="@+id/bind"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="@string/bind" />
+
+            <Button
+                android:id="@+id/unbind"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:enabled="false"
+                android:text="@string/unbind" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+
+            <Button
+                android:id="@+id/scan"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:enabled="false"
+                android:text="@string/scan" />
+
+            <Button
+                android:id="@+id/connect"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:enabled="false"
+                android:text="@string/connect"
+                android:visibility="gone" />
+
+            <Button
+                android:id="@+id/disconnect"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:enabled="false"
+                android:text="@string/disconnect" />
+        </LinearLayout>
+
+        <ScrollView
+            android:id="@+id/svDevice"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <LinearLayout
+                android:id="@+id/llConnect"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:visibility="gone">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/set_time"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_time" />
+
+                    <Button
+                        android:id="@+id/getcursportdata"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/sync_time" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/set_userinfo"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_userinfo" />
+
+                    <Button
+                        android:id="@+id/set_vir"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_vir" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/set_photo"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_photo" />
+
+                    <Button
+                        android:id="@+id/set_idletime"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_idletime" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/set_sleep"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_sleep" />
+
+                    <Button
+                        android:id="@+id/read_batery"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/read_batery" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/read_fw"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/read_deviceinfo" />
+
+                    <Button
+                        android:id="@+id/set_alarm"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_alarm" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/openheart"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/openheart" />
+
+                    <Button
+                        android:id="@+id/closeheart"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/closeheart" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/send_msg"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/send_msg" />
+
+                    <Button
+                        android:id="@+id/set_autoheart"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_autoheart" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/set_fuzhu"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_fuzhu" />
+
+                    <Button
+                        android:id="@+id/set_showmode"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_showmode" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <EditText
+                        android:id="@+id/et_getdata"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:gravity="center"
+                        android:inputType="number"
+                        android:text="1" />
+
+
+                    <EditText
+                        android:id="@+id/et_getday"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:gravity="center"
+                        android:inputType="number"
+                        android:text="0" />
+
+                    <Button
+                        android:id="@+id/getdata"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="2"
+                        android:text="@string/getdata" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/bt_setHeartRateArea"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="设置心率区间" />
+
+                    <Button
+                        android:id="@+id/set_parameters"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_parameters" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:visibility="visible">
+
+
+                    <EditText
+                        android:id="@+id/etName"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:hint="name"
+                        android:text="name" />
+
+                    <EditText
+                        android:id="@+id/etContent"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:hint="content"
+                        android:text="content" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:visibility="visible">
+
+                    <EditText
+                        android:id="@+id/etType"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:hint="type"
+                        android:inputType="number"
+                        android:text="3" />
+
+                    <Button
+                        android:id="@+id/bNotify"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/send_call_notificatioin" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+
+                    <Button
+                        android:id="@+id/setLanguage"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="设置系统语言" />
+
+                    <Button
+                        android:id="@+id/send_weather"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="发送天气信息" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/bt_open_blood"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="打开血压" />
+
+                    <Button
+                        android:id="@+id/bt_close_blood"
+                        android:layout_width="0dip"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="关闭血压" />
+
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <Button
+                        android:id="@+id/bSetDeviceCode"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/set_device_code" />
+
+                    <Button
+                        android:id="@+id/bGetDeviceCode"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="@string/get_device_code" />
+                </LinearLayout>
+
+            </LinearLayout>
+        </ScrollView>
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 49 - 0
android-smartband-sdk-sxrblejy2aidlclient/res/layout/device_listitem_text.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>  
+<LinearLayout   
+        android:layout_width="fill_parent"   
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_height="wrap_content"   
+        android:id="@+id/MyListItem"
+	  	android:orientation="horizontal" >
+	  	
+		<LinearLayout   
+		        android:layout_width="wrap_content"  
+		        android:layout_height="wrap_content"  
+			  	android:orientation="vertical" >
+	
+	        <TextView   
+	                android:layout_height="wrap_content"   
+	                android:layout_width="wrap_content"   
+	                android:id="@+id/ItemRssi"   
+	                android:textSize="14sp"
+	        		android:gravity="center"
+	                android:textColor="@color/white" >  
+	        </TextView>
+		</LinearLayout>  
+        
+		<LinearLayout   
+		        android:layout_width="wrap_content"  
+		        android:layout_height="wrap_content"   
+		        android:paddingLeft="10dp"
+		        android:layout_weight="1"
+			  	android:orientation="vertical" >
+	        <TextView   
+	                android:layout_height="wrap_content"   
+	                android:layout_width="wrap_content"   
+	                android:id="@+id/ItemTitle"   
+	                android:textSize="20sp"
+	        		android:gravity="left"
+	                android:textColor="@color/white" >  
+	        </TextView>
+	
+	        <TextView   
+	                android:layout_height="wrap_content"   
+	                android:layout_width="wrap_content"   
+	                android:id="@+id/ItemDate"   
+	                android:textSize="14sp"
+	        		android:gravity="left"
+	                android:textColor="@color/white" >  
+	        </TextView>
+		</LinearLayout>  
+        
+</LinearLayout>  

+ 18 - 0
android-smartband-sdk-sxrblejy2aidlclient/res/layout/popwindow_devicelist.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:background="@color/pop_window_bg"
+    android:orientation="vertical" >
+
+    <ListView
+        android:id="@+id/nearby_device_listView"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent" 
+	    android:padding="8dip"
+        android:divider="#ffffff"   
+		android:dividerHeight="8dp" >
+    </ListView>
+    
+</LinearLayout>

BIN
android-smartband-sdk-sxrblejy2aidlclient/res/mipmap-xxhdpi/ic_launcher.png


+ 7 - 0
android-smartband-sdk-sxrblejy2aidlclient/res/values/colors.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    
+    <color name="white">#ffffff</color>
+    <color name="pop_window_bg">#a0000000</color>
+        
+</resources>

+ 3 - 0
android-smartband-sdk-sxrblejy2aidlclient/res/values/dimens.xml

@@ -0,0 +1,3 @@
+<resources>
+    <!-- Default screen margins, per the Android Design guidelines. -->
+</resources>

+ 30 - 0
android-smartband-sdk-sxrblejy2aidlclient/res/values/strings.xml

@@ -0,0 +1,30 @@
+<resources>
+    <string name="app_name">手环采集</string>
+
+    <string name="bind">绑定服务</string>
+    <string name="unbind">解绑服务</string>
+    <string name="scan">扫描</string>
+    <string name="connect">连接</string>
+    <string name="disconnect">断连</string>
+    <string name="send_call_notificatioin">发送提醒</string>
+    <string name="sync_time">获取当前运动数据</string>
+    <string name="set_time">设置设备时间</string>
+    <string name="set_parameters">设置设备参数</string>
+    <string name="set_userinfo">设置个人信息</string>
+    <string name="set_vir">手环振动</string>
+    <string name="set_photo">拍照模式</string>
+    <string name="set_idletime">久坐提醒时间</string>
+    <string name="set_sleep">设置睡眠时间段</string>
+    <string name="read_batery">读取设备电量</string>
+    <string name="read_deviceinfo">读取手环信息</string>
+    <string name="set_alarm">设置闹钟</string>
+    <string name="send_msg">固件升级</string>
+    <string name="openheart">开启测试心率</string>
+    <string name="closeheart">关闭测试心率</string>
+    <string name="set_autoheart">自动测试心率</string>
+    <string name="set_fuzhu">特殊模式</string>
+    <string name="set_showmode">设置显示模式</string>
+    <string name="getdata">获取历史数据</string>
+    <string name="set_device_code">设置机器串码</string>
+    <string name="get_device_code">获取机器串码</string>
+</resources>

+ 21 - 0
android-smartband-sdk-sxrblejy2aidlclient/res/values/styles.xml

@@ -0,0 +1,21 @@
+<resources>
+
+    <!--
+        Base application theme, dependent on API level. This theme is replaced
+        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.NoActionBar">
+        <!--
+            Theme customizations available in newer API levels can go in
+            res/values-vXX/styles.xml, while customizations related to
+            backward-compatibility can go here.
+        -->
+    </style>
+
+    <!-- Application theme. -->
+    <style name="AppTheme" parent="AppBaseTheme">
+        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
+        <item name="android:textSize">14sp</item>
+    </style>
+
+</resources>

+ 70 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/BleDeviceItem.java

@@ -0,0 +1,70 @@
+package com.sxr.sdk.ble.keepfit.client;
+
+public class BleDeviceItem {
+	private String bleDeviceName;
+	private String bleDeviceAddress;
+	private String nickname;
+	private String bindedDate;
+	private int rssi;
+	private String type;
+
+	public BleDeviceItem() {
+	}
+	
+	public BleDeviceItem(String deviceName, String deviceAddress, String nickname, String bindedDate, int rssi, String type) {
+		setBleDeviceName(deviceName);
+		setBleDeviceAddress(deviceAddress);
+		setNickname(nickname);
+		setBindedDate(bindedDate);
+		setRssi(rssi);
+		setType(type);
+	}
+	
+	public String getBleDeviceName() {
+		return bleDeviceName;
+	}
+	public void setBleDeviceName(String bleDeviceName) {
+		this.bleDeviceName = bleDeviceName;
+	}
+
+	public String getBleDeviceAddress() {
+		return bleDeviceAddress;
+	}
+
+	public void setBleDeviceAddress(String bleDeviceAddress) {
+		this.bleDeviceAddress = bleDeviceAddress;
+	}
+
+	public int getRssi() {
+		return rssi;
+	}
+
+	public void setRssi(int rssi) {
+		this.rssi = rssi;
+	}
+
+	public String getNickname() {
+		return nickname;
+	}
+
+	public void setNickname(String nickname) {
+		this.nickname = nickname;
+	}
+
+	public String getBindedDate() {
+		return bindedDate;
+	}
+
+	public void setBindedDate(String bindedDate) {
+		this.bindedDate = bindedDate;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+}

+ 24 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/ComparatorBleDeviceItem.java

@@ -0,0 +1,24 @@
+package com.sxr.sdk.ble.keepfit.client;
+
+import java.util.Comparator;
+
+public class ComparatorBleDeviceItem implements Comparator<BleDeviceItem>{
+
+	@Override
+	public int compare(BleDeviceItem arg0, BleDeviceItem arg1) {
+		int rssi0 = arg0.getRssi();
+		int rssi1 = arg1.getRssi();
+        int result = 0;
+        if(rssi0 < rssi1)
+        {
+            result=1;
+        }
+        if(rssi0 > rssi1)
+        {
+            result=-1;
+        }
+        
+        return result;
+	}
+
+}

+ 33 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/GeneralTsData.java

@@ -0,0 +1,33 @@
+package com.sxr.sdk.ble.keepfit.client;
+
+
+public class GeneralTsData {
+
+    private long ts;
+    private short status;
+    private double doubleValue;
+
+    public long getTs() {
+        return ts;
+    }
+
+    public void setTs(long ts) {
+        this.ts = ts;
+    }
+
+    public short getStatus() {
+        return status;
+    }
+
+    public void setStatus(short status) {
+        this.status = status;
+    }
+
+    public double getDoubleValue() {
+        return doubleValue;
+    }
+
+    public void setDoubleValue(double doubleValue) {
+        this.doubleValue = doubleValue;
+    }
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1675 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/GyeeActivity.java


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1485 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/MainActivity.java


+ 14 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/ReportData.java

@@ -0,0 +1,14 @@
+package com.sxr.sdk.ble.keepfit.client;
+
+public class  ReportData {
+    public String phoneNumber;
+    public String pld;//疲劳度
+    public String ssxy;//收缩血压
+    public String szxy;//舒张血压
+    public  String xtpl;//心跳频率
+    public String xynd;//血氧浓度
+    public String bs;//步数
+    public String lng;//经度
+    public String lat;//纬度
+
+}

+ 92 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/RestService.java

@@ -0,0 +1,92 @@
+package com.sxr.sdk.ble.keepfit.client;
+
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.protocol.HTTP;
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+//接口地址:
+//
+//        192.168.1.107:8087/shbruser/insertBraceletUserInfo
+//        请求方式:post
+//
+//        String mobile,    /**手机号*/
+//        double pld,      /**疲劳度*/
+//        double ssxy,   /**收缩血压*/
+//        double szxy;      /**舒张血压*/
+//        double xtpl;       /**心跳频率*/
+//        double xynd;     /**血压*/
+//        long bs;      /**步数*/
+//        double lng;  /**经度*/
+//        double lat; /**纬度*/
+//
+//
+//        {
+//        "success": true,
+//        "status": 20000,
+//        "count": 1,
+//        "msg": "上传数据成功",
+//        "data": "BraceletuserVo(pld=38.9, ssxy=180.8, szxy=120.4, xtpl=85.0, xynd=140.3, bs=20000, lng=38.5, lat=106.78)"
+//        }
+
+public class RestService {
+
+    public static String baseURL = "http://192.168.1.104:8087";
+
+    public static void  Post(ReportData reportData) {
+        String url = baseURL + "/shbruser/insertBraceletUserInfo";
+        try
+        {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("mobile", reportData.phoneNumber);
+            jsonObject.put("pld", reportData.pld);
+            jsonObject.put("ssxy", reportData.ssxy);
+            jsonObject.put("szxy", reportData.szxy);
+            jsonObject.put("xtpl", reportData.xtpl);
+            jsonObject.put("xynd", reportData.xynd);
+            jsonObject.put("bs", reportData.bs);
+            jsonObject.put("lng", reportData.lng);
+            jsonObject.put("lat", reportData.lat);
+
+
+            StringEntity entity = new StringEntity(jsonObject.toString(), HTTP.UTF_8);
+
+            entity.setContentType("application/json");
+
+            // URL使用基本URL即可,其中不需要加参数
+            HttpPost httpPost = new HttpPost(url);
+            // 将请求体内容加入请求中
+
+            httpPost.setEntity(entity);
+
+            HttpClient httpClient = new DefaultHttpClient();
+            // 发送请求
+            HttpResponse response = httpClient.execute(httpPost);
+            // 显示响应
+            //showResponseResult(response);
+
+            System.out.println(response.getStatusLine());
+
+
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+}

+ 9 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/SampleBleService.java

@@ -0,0 +1,9 @@
+package com.sxr.sdk.ble.keepfit.client;
+
+import com.sxr.sdk.ble.keepfit.service.BluetoothLeService;
+public class SampleBleService extends BluetoothLeService {
+    @Override
+    public void onCreate() {
+        super.onCreate();
+    }
+}

+ 93 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/SysUtils.java

@@ -0,0 +1,93 @@
+package com.sxr.sdk.ble.keepfit.client;
+
+
+import android.os.Environment;
+import android.util.Log;
+
+import java.io.File;
+import java.io.RandomAccessFile;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+public class SysUtils {
+
+	// 将字符串写入到文本文件中
+	public static void writeTxtToFile(String strcontent, String filePath, String fileName) {
+	     //生成文件夹之后,再生成文件,不然会出错
+		File sdcardDir = Environment.getExternalStorageDirectory();
+		String path = sdcardDir.getPath() + filePath;
+		Calendar today = Calendar.getInstance();
+		fileName = today.get(Calendar.YEAR) + "-" + (today.get(Calendar.MONTH) + 1) + "-" + today.get(Calendar.DAY_OF_MONTH) + "-" + fileName;
+	    makeFilePath(path, fileName);
+	     
+	     String strFilePath = path + fileName;
+	     // 每次写入时,都换行写
+	     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+	     String now = sdf.format(new Date());
+	    String strContent = now + ":" + strcontent + "\r\n";
+	     try {
+	         File file = new File(strFilePath);
+	         if (!file.exists()) {
+	             Log.d("TestFile", "Create the file:" + strFilePath);
+	             file.getParentFile().mkdirs();
+	             file.createNewFile();
+	         }
+	         RandomAccessFile raf = new RandomAccessFile(file, "rwd");
+	         raf.seek(file.length());
+	         raf.write(strContent.getBytes());
+	         raf.close();
+	     } catch (Exception e) {
+	         Log.e("TestFile", "Error on write File:" + e);
+	     }
+	 }
+	  
+	 // 生成文件
+	public static File makeFilePath(String filePath, String fileName) {
+	     File file = null;
+	     makeRootDirectory(filePath);
+	     try {
+	         file = new File(filePath + fileName);
+	         if (!file.exists()) {
+	             file.createNewFile();
+	         }
+	     } catch (Exception e) {
+	         e.printStackTrace();
+	     }
+	     return file;
+	 }
+
+	 // 生成文件夹
+	public static void makeRootDirectory(String filePath) {
+	     File file = null;
+	     try {
+	         file = new File(filePath);
+	         if (!file.exists()) {
+	             file.mkdir();
+	         }
+	     } catch (Exception e) {
+	         Log.i("error:", e+"");
+	     }
+	}
+
+	public static String printHexString( byte[] b) {
+		if(b == null) {
+			return "";
+		}
+		
+		String hexString = "";
+	   for (int i = 0; i < b.length; i++) { 
+	     String hex = Integer.toHexString(b[i] & 0xFF); 
+	     if (hex.length() == 1) { 
+	       hex = '0' + hex; 
+	     } 
+	     hexString += hex.toUpperCase() + " "; 
+	   }
+
+	   return hexString;
+	}
+	
+
+
+}
+

+ 23 - 0
android-smartband-sdk-sxrblejy2aidlclient/src/com/sxr/sdk/ble/keepfit/client/TsPointData.java

@@ -0,0 +1,23 @@
+package com.sxr.sdk.ble.keepfit.client;
+
+public class TsPointData {
+    private String tagName;
+
+    private GeneralTsData tsData;
+
+    public String getTagName() {
+        return tagName;
+    }
+
+    public void setTagName(String tagName) {
+        this.tagName = tagName;
+    }
+
+    public GeneralTsData getTsData() {
+        return tsData;
+    }
+
+    public void setTsData(GeneralTsData tsData) {
+        this.tsData = tsData;
+    }
+}

+ 17 - 0
build.gradle

@@ -0,0 +1,17 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+    repositories {
+        jcenter()
+        google()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:3.2.0'
+    }
+}
+allprojects {
+    repositories {
+        jcenter()
+        google()
+        flatDir { dirs 'libs' }
+    }
+}

BIN
gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Tue Feb 26 10:12:12 CST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

+ 164 - 0
gradlew

@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+    echo "$*"
+}
+
+die ( ) {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+    JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

+ 90 - 0
gradlew.bat

@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 1 - 0
settings.gradle

@@ -0,0 +1 @@
+include ':android-smartband-sdk-sxrblejy2aidlclient'