liumingming

first commit

Showing 49 changed files with 1811 additions and 0 deletions
  1 +# Built application files
  2 +*.apk
  3 +*.aar
  4 +*.ap_
  5 +*.aab
  6 +
  7 +# Files for the ART/Dalvik VM
  8 +*.dex
  9 +
  10 +# Java class files
  11 +*.class
  12 +
  13 +# Generated files
  14 +bin/
  15 +gen/
  16 +out/
  17 +# Uncomment the following line in case you need and you don't have the release build type files in your app
  18 +# release/
  19 +
  20 +# Gradle files
  21 +.gradle/
  22 +build/
  23 +
  24 +# Local configuration file (sdk path, etc)
  25 +local.properties
  26 +
  27 +# Proguard folder generated by Eclipse
  28 +proguard/
  29 +
  30 +# Log Files
  31 +*.log
  32 +
  33 +# Android Studio Navigation editor temp files
  34 +.navigation/
  35 +
  36 +# Android Studio captures folder
  37 +captures/
  38 +
  39 +# IntelliJ
  40 +*.iml
  41 +.idea/workspace.xml
  42 +.idea/tasks.xml
  43 +.idea/gradle.xml
  44 +.idea/assetWizardSettings.xml
  45 +.idea/dictionaries
  46 +.idea/libraries
  47 +# Android Studio 3 in .gitignore file.
  48 +.idea/caches
  49 +.idea/modules.xml
  50 +# Comment next line if keeping position of elements in Navigation Editor is relevant for you
  51 +.idea/navEditor.xml
  52 +
  53 +# Keystore files
  54 +# Uncomment the following lines if you do not want to check your keystore files in.
  55 +#*.jks
  56 +#*.keystore
  57 +
  58 +# External native build folder generated in Android Studio 2.2 and later
  59 +.externalNativeBuild
  60 +.cxx/
  61 +
  62 +# Google Services (e.g. APIs or Firebase)
  63 +# google-services.json
  64 +
  65 +# Freeline
  66 +freeline.py
  67 +freeline/
  68 +freeline_project_description.json
  69 +
  70 +# fastlane
  71 +fastlane/report.xml
  72 +fastlane/Preview.html
  73 +fastlane/screenshots
  74 +fastlane/test_output
  75 +fastlane/readme.md
  76 +
  77 +# Version control
  78 +vcs.xml
  79 +
  80 +# lint
  81 +lint/intermediates/
  82 +lint/generated/
  83 +lint/outputs/
  84 +lint/tmp/
  85 +# lint/reports/
  1 +# Default ignored files
  2 +/shelf/
  3 +/workspace.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="CompilerConfiguration">
  4 + <bytecodeTargetLevel target="1.8" />
  5 + </component>
  6 +</project>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="RemoteRepositoriesConfiguration">
  4 + <remote-repository>
  5 + <option name="id" value="central" />
  6 + <option name="name" value="Maven Central repository" />
  7 + <option name="url" value="https://repo1.maven.org/maven2" />
  8 + </remote-repository>
  9 + <remote-repository>
  10 + <option name="id" value="jboss.community" />
  11 + <option name="name" value="JBoss Community repository" />
  12 + <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
  13 + </remote-repository>
  14 + <remote-repository>
  15 + <option name="id" value="BintrayJCenter" />
  16 + <option name="name" value="BintrayJCenter" />
  17 + <option name="url" value="https://jcenter.bintray.com/" />
  18 + </remote-repository>
  19 + <remote-repository>
  20 + <option name="id" value="Google" />
  21 + <option name="name" value="Google" />
  22 + <option name="url" value="https://dl.google.com/dl/android/maven2/" />
  23 + </remote-repository>
  24 + <remote-repository>
  25 + <option name="id" value="MavenRepo" />
  26 + <option name="name" value="MavenRepo" />
  27 + <option name="url" value="https://repo.maven.apache.org/maven2/" />
  28 + </remote-repository>
  29 + </component>
  30 +</project>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
  4 + <output url="file://$PROJECT_DIR$/build/classes" />
  5 + </component>
  6 + <component name="ProjectType">
  7 + <option name="id" value="Android" />
  8 + </component>
  9 +</project>
  1 + Apache License
  2 + Version 2.0, January 2004
  3 + http://www.apache.org/licenses/
  4 +
  5 + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  6 +
  7 + 1. Definitions.
  8 +
  9 + "License" shall mean the terms and conditions for use, reproduction,
  10 + and distribution as defined by Sections 1 through 9 of this document.
  11 +
  12 + "Licensor" shall mean the copyright owner or entity authorized by
  13 + the copyright owner that is granting the License.
  14 +
  15 + "Legal Entity" shall mean the union of the acting entity and all
  16 + other entities that control, are controlled by, or are under common
  17 + control with that entity. For the purposes of this definition,
  18 + "control" means (i) the power, direct or indirect, to cause the
  19 + direction or management of such entity, whether by contract or
  20 + otherwise, or (ii) ownership of fifty percent (50%) or more of the
  21 + outstanding shares, or (iii) beneficial ownership of such entity.
  22 +
  23 + "You" (or "Your") shall mean an individual or Legal Entity
  24 + exercising permissions granted by this License.
  25 +
  26 + "Source" form shall mean the preferred form for making modifications,
  27 + including but not limited to software source code, documentation
  28 + source, and configuration files.
  29 +
  30 + "Object" form shall mean any form resulting from mechanical
  31 + transformation or translation of a Source form, including but
  32 + not limited to compiled object code, generated documentation,
  33 + and conversions to other media types.
  34 +
  35 + "Work" shall mean the work of authorship, whether in Source or
  36 + Object form, made available under the License, as indicated by a
  37 + copyright notice that is included in or attached to the work
  38 + (an example is provided in the Appendix below).
  39 +
  40 + "Derivative Works" shall mean any work, whether in Source or Object
  41 + form, that is based on (or derived from) the Work and for which the
  42 + editorial revisions, annotations, elaborations, or other modifications
  43 + represent, as a whole, an original work of authorship. For the purposes
  44 + of this License, Derivative Works shall not include works that remain
  45 + separable from, or merely link (or bind by name) to the interfaces of,
  46 + the Work and Derivative Works thereof.
  47 +
  48 + "Contribution" shall mean any work of authorship, including
  49 + the original version of the Work and any modifications or additions
  50 + to that Work or Derivative Works thereof, that is intentionally
  51 + submitted to Licensor for inclusion in the Work by the copyright owner
  52 + or by an individual or Legal Entity authorized to submit on behalf of
  53 + the copyright owner. For the purposes of this definition, "submitted"
  54 + means any form of electronic, verbal, or written communication sent
  55 + to the Licensor or its representatives, including but not limited to
  56 + communication on electronic mailing lists, source code control systems,
  57 + and issue tracking systems that are managed by, or on behalf of, the
  58 + Licensor for the purpose of discussing and improving the Work, but
  59 + excluding communication that is conspicuously marked or otherwise
  60 + designated in writing by the copyright owner as "Not a Contribution."
  61 +
  62 + "Contributor" shall mean Licensor and any individual or Legal Entity
  63 + on behalf of whom a Contribution has been received by Licensor and
  64 + subsequently incorporated within the Work.
  65 +
  66 + 2. Grant of Copyright License. Subject to the terms and conditions of
  67 + this License, each Contributor hereby grants to You a perpetual,
  68 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  69 + copyright license to reproduce, prepare Derivative Works of,
  70 + publicly display, publicly perform, sublicense, and distribute the
  71 + Work and such Derivative Works in Source or Object form.
  72 +
  73 + 3. Grant of Patent License. Subject to the terms and conditions of
  74 + this License, each Contributor hereby grants to You a perpetual,
  75 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  76 + (except as stated in this section) patent license to make, have made,
  77 + use, offer to sell, sell, import, and otherwise transfer the Work,
  78 + where such license applies only to those patent claims licensable
  79 + by such Contributor that are necessarily infringed by their
  80 + Contribution(s) alone or by combination of their Contribution(s)
  81 + with the Work to which such Contribution(s) was submitted. If You
  82 + institute patent litigation against any entity (including a
  83 + cross-claim or counterclaim in a lawsuit) alleging that the Work
  84 + or a Contribution incorporated within the Work constitutes direct
  85 + or contributory patent infringement, then any patent licenses
  86 + granted to You under this License for that Work shall terminate
  87 + as of the date such litigation is filed.
  88 +
  89 + 4. Redistribution. You may reproduce and distribute copies of the
  90 + Work or Derivative Works thereof in any medium, with or without
  91 + modifications, and in Source or Object form, provided that You
  92 + meet the following conditions:
  93 +
  94 + (a) You must give any other recipients of the Work or
  95 + Derivative Works a copy of this License; and
  96 +
  97 + (b) You must cause any modified files to carry prominent notices
  98 + stating that You changed the files; and
  99 +
  100 + (c) You must retain, in the Source form of any Derivative Works
  101 + that You distribute, all copyright, patent, trademark, and
  102 + attribution notices from the Source form of the Work,
  103 + excluding those notices that do not pertain to any part of
  104 + the Derivative Works; and
  105 +
  106 + (d) If the Work includes a "NOTICE" text file as part of its
  107 + distribution, then any Derivative Works that You distribute must
  108 + include a readable copy of the attribution notices contained
  109 + within such NOTICE file, excluding those notices that do not
  110 + pertain to any part of the Derivative Works, in at least one
  111 + of the following places: within a NOTICE text file distributed
  112 + as part of the Derivative Works; within the Source form or
  113 + documentation, if provided along with the Derivative Works; or,
  114 + within a display generated by the Derivative Works, if and
  115 + wherever such third-party notices normally appear. The contents
  116 + of the NOTICE file are for informational purposes only and
  117 + do not modify the License. You may add Your own attribution
  118 + notices within Derivative Works that You distribute, alongside
  119 + or as an addendum to the NOTICE text from the Work, provided
  120 + that such additional attribution notices cannot be construed
  121 + as modifying the License.
  122 +
  123 + You may add Your own copyright statement to Your modifications and
  124 + may provide additional or different license terms and conditions
  125 + for use, reproduction, or distribution of Your modifications, or
  126 + for any such Derivative Works as a whole, provided Your use,
  127 + reproduction, and distribution of the Work otherwise complies with
  128 + the conditions stated in this License.
  129 +
  130 + 5. Submission of Contributions. Unless You explicitly state otherwise,
  131 + any Contribution intentionally submitted for inclusion in the Work
  132 + by You to the Licensor shall be under the terms and conditions of
  133 + this License, without any additional terms or conditions.
  134 + Notwithstanding the above, nothing herein shall supersede or modify
  135 + the terms of any separate license agreement you may have executed
  136 + with Licensor regarding such Contributions.
  137 +
  138 + 6. Trademarks. This License does not grant permission to use the trade
  139 + names, trademarks, service marks, or product names of the Licensor,
  140 + except as required for reasonable and customary use in describing the
  141 + origin of the Work and reproducing the content of the NOTICE file.
  142 +
  143 + 7. Disclaimer of Warranty. Unless required by applicable law or
  144 + agreed to in writing, Licensor provides the Work (and each
  145 + Contributor provides its Contributions) on an "AS IS" BASIS,
  146 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  147 + implied, including, without limitation, any warranties or conditions
  148 + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
  149 + PARTICULAR PURPOSE. You are solely responsible for determining the
  150 + appropriateness of using or redistributing the Work and assume any
  151 + risks associated with Your exercise of permissions under this License.
  152 +
  153 + 8. Limitation of Liability. In no event and under no legal theory,
  154 + whether in tort (including negligence), contract, or otherwise,
  155 + unless required by applicable law (such as deliberate and grossly
  156 + negligent acts) or agreed to in writing, shall any Contributor be
  157 + liable to You for damages, including any direct, indirect, special,
  158 + incidental, or consequential damages of any character arising as a
  159 + result of this License or out of the use or inability to use the
  160 + Work (including but not limited to damages for loss of goodwill,
  161 + work stoppage, computer failure or malfunction, or any and all
  162 + other commercial damages or losses), even if such Contributor
  163 + has been advised of the possibility of such damages.
  164 +
  165 + 9. Accepting Warranty or Additional Liability. While redistributing
  166 + the Work or Derivative Works thereof, You may choose to offer,
  167 + and charge a fee for, acceptance of support, warranty, indemnity,
  168 + or other liability obligations and/or rights consistent with this
  169 + License. However, in accepting such obligations, You may act only
  170 + on Your own behalf and on Your sole responsibility, not on behalf
  171 + of any other Contributor, and only if You agree to indemnify,
  172 + defend, and hold each Contributor harmless for any liability
  173 + incurred by, or claims asserted against, such Contributor by reason
  174 + of your accepting any such warranty or additional liability.
  175 +
  176 + END OF TERMS AND CONDITIONS
  177 +
  178 + APPENDIX: How to apply the Apache License to your work.
  179 +
  180 + To apply the Apache License to your work, attach the following
  181 + boilerplate notice, with the fields enclosed by brackets "[]"
  182 + replaced with your own identifying information. (Don't include
  183 + the brackets!) The text should be enclosed in the appropriate
  184 + comment syntax for the file format. We also recommend that a
  185 + file or class name and description of purpose be included on the
  186 + same "printed page" as the copyright notice for easier
  187 + identification within third-party archives.
  188 +
  189 + Copyright [yyyy] [name of copyright owner]
  190 +
  191 + Licensed under the Apache License, Version 2.0 (the "License");
  192 + you may not use this file except in compliance with the License.
  193 + You may obtain a copy of the License at
  194 +
  195 + http://www.apache.org/licenses/LICENSE-2.0
  196 +
  197 + Unless required by applicable law or agreed to in writing, software
  198 + distributed under the License is distributed on an "AS IS" BASIS,
  199 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  200 + See the License for the specific language governing permissions and
  201 + limitations under the License.
  1 +## 和缓视频医生Android SDK接入文档 3.1.0.08031427
  2 +
  3 +#### 一、 Android工程引入和缓视频医生SDK
  4 +
  5 +##### 1. 在project的build.gradle文件中增加mavenCentral仓库的引用,如果已经引用可忽略这一步骤,引入方式如下:
  6 +
  7 +```
  8 +allprojects {
  9 + repositories {
  10 + mavenCentral()
  11 + ...
  12 + }
  13 +}
  14 +
  15 +```
  16 +
  17 +##### 2. 在需要接入和缓视频医生SDK的moudle中的build.gradle文件中引入和缓视频医生SDK,引用方式如下:
  18 +
  19 +```
  20 +implementation 'com.hh-medic.android.sdk:hh_doctor:3.1.0.08031427'
  21 +```
  22 +
  23 +##### 3. 第三方引用
  24 +注:这些库必须添加到引用当中
  25 +```
  26 + implementation 'com.google.code.gson:gson:2.8.0'
  27 + implementation 'com.squareup.okhttp3:okhttp:3.12.1'
  28 + implementation "com.tencent.liteav:LiteAVSDK_TRTC:8.2.9809"
  29 +```
  30 +
  31 +#### 二、 使用和缓视频医生SDK
  32 +
  33 +##### 1. 初始化SDK(初始化方法需要在使用SDK其他部分之前做就可以)
  34 +
  35 +```java
  36 +HHSDKOptions options = new HHSDKOptions("sdkProductId",true,new GlideImageLoader());
  37 +HHDoctor.init(context,options);
  38 +```
  39 +
  40 +HHSDKOptions参数说明:
  41 +
  42 +| 参数定义 | 说明 |
  43 +| --- | --- |
  44 +|sdkProductId|由和缓分配的标识产品的ID|
  45 +|isDevelop|是否测试环境|
  46 +|imageEngine|辅助SDK内部用到图片资源的图片加载引擎|
  47 +
  48 +HHDoctor.init 参数说明
  49 +
  50 +| 参数定义 | 说明 |
  51 +| --- | --- |
  52 +|context|上下文|
  53 +|options|初始化必备参数|
  54 +
  55 +
  56 +其中GldieImageLoader是实现和缓视频SDK中HHImageEngine用来实现部分SDK图片的加载引擎,实现示例使用了Glide加载方式如下:
  57 +```java
  58 +public class GlideImageLoader implements HHImageEngine {
  59 + @Override
  60 + public void loadImage(Context context, int placeHolder, String url, ImageView imageView) {
  61 + Glide.with(context).load(url).apply(new RequestOptions()).placeholder(placeHolder).into(imageView);
  62 + }
  63 +}
  64 +```
  65 +
  66 +##### 2. 登录和缓视频医生SDK
  67 +
  68 +```java
  69 +HHDoctor.login(context, "userToken", new HHLoginListener() {
  70 + @Override
  71 + public void onSuccess() {
  72 +
  73 + }
  74 +
  75 + @Override
  76 + public void onError(String s) {
  77 +
  78 + }
  79 +});
  80 +```
  81 +
  82 +HHDoctor.login参数说明
  83 +
  84 +| 参数定义 | 说明 |
  85 +| --- | --- |
  86 +|context|上下文|
  87 +|userToken|和缓用户唯一标识|
  88 +|loginListener|登录状态回调|
  89 +
  90 +##### 3. 登出和缓视频医生SDK(切换账号或登出账号的时候调用)
  91 +
  92 +```java
  93 +HHDoctor.logOut(context);
  94 +```
  95 +
  96 +| 参数定义 | 说明 |
  97 +| --- | --- |
  98 +|context|上下文|
  99 +
  100 +
  101 +##### 4. 是否登录和缓视频医生SDK
  102 +
  103 +```java
  104 +HHDoctor.isLoggedIn(context)
  105 +```
  106 +| 参数定义 | 说明 |
  107 +| --- | --- |
  108 +|context|上下文|
  109 +
  110 +##### 5. 设置呼叫附加参数
  111 +
  112 +```java
  113 +HHDoctor.setCallExtension("ext");
  114 +```
  115 +
  116 +| 参数定义 | 说明 |
  117 +| --- | --- |
  118 +|ext|呼叫附加参数|
  119 +
  120 +##### 6. 呼叫视频医生
  121 +
  122 +```java
  123 +HHDoctor.call(context, "userToken", new HHCallListener() {
  124 + @Override
  125 + public void onStart(String s) {
  126 +
  127 + }
  128 +
  129 + @Override
  130 + public void onFinish(long l) {
  131 +
  132 + }
  133 +
  134 + @Override
  135 + public void onCallSuccess() {
  136 +
  137 + }
  138 +
  139 + @Override
  140 + public void onFail(int i) {
  141 +
  142 + }
  143 +
  144 + @Override
  145 + public void onCancel() {
  146 +
  147 + }
  148 +});
  149 +```
  150 +
  151 +参数说明:
  152 +
  153 +| 参数定义 | 说明 |
  154 +| --- | --- |
  155 +|context|上下文|
  156 +|userToken|请传咨询人信息,例如给本人看就传本人的userToken,给家庭成员看就传家庭成员userToken|
  157 +|callListener|呼叫状态回调|
  158 +
  159 +
  160 +##### 7. 获取病历详情地址
  161 +
  162 +```java
  163 +HHDoctor.getMedicDetailUrl("medicId","userToken","patientUserToken");
  164 +```
  165 +
  166 +参数说明:
  167 +
  168 +| 参数定义 | 说明 |
  169 +| --- | --- |
  170 +|medicId|病历id|
  171 +|userToken|登录帐号userToken|
  172 +|patientUserToken|真实患者userToken|
  173 +
  1 +/build
  1 +import java.text.SimpleDateFormat
  2 +
  3 +plugins {
  4 + id 'com.android.application'
  5 +}
  6 +
  7 +static def increasedVersionCode() {
  8 + return (int) (System.currentTimeMillis() / 1000 / 60)
  9 +}
  10 +
  11 +static def buildTime() {
  12 + def df = new SimpleDateFormat("MMddHH")
  13 + return df.format(new Date())
  14 +}
  15 +
  16 +def baseVersion = "3.1.0"
  17 +
  18 +android {
  19 + compileSdkVersion 30
  20 + buildToolsVersion "30.0.2"
  21 +
  22 + defaultConfig {
  23 + applicationId "com.hhmedic.demo.trtc.meituan"
  24 + minSdkVersion 21
  25 + targetSdkVersion 30
  26 + versionCode increasedVersionCode()
  27 + versionName "$baseVersion.${buildTime()}"
  28 + multiDexEnabled true
  29 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  30 + }
  31 +
  32 + buildTypes {
  33 + release {
  34 + minifyEnabled true
  35 + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  36 + }
  37 + }
  38 + compileOptions {
  39 + sourceCompatibility JavaVersion.VERSION_1_8
  40 + targetCompatibility JavaVersion.VERSION_1_8
  41 + }
  42 +
  43 + buildFeatures {
  44 + dataBinding = true
  45 + }
  46 +
  47 + android.applicationVariants.all { variant ->
  48 +
  49 + variant.outputs.all {
  50 +
  51 + outputFileName = "hh_android_trtc_meituan_demo_${defaultConfig.versionName}.apk"
  52 +
  53 + }
  54 + }
  55 +}
  56 +
  57 +dependencies {
  58 +
  59 + implementation 'androidx.appcompat:appcompat:1.1.0'
  60 + implementation 'com.google.android.material:material:1.1.0'
  61 + implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  62 +
  63 +
  64 + implementation 'com.google.code.gson:gson:2.8.0'
  65 + implementation 'com.squareup.okhttp3:okhttp:3.12.1'
  66 + implementation "com.tencent.liteav:LiteAVSDK_TRTC:8.2.9809"
  67 + implementation 'com.github.bumptech.glide:glide:4.9.0'
  68 +
  69 +// implementation 'com.hh-medic.android.sdk:hh_doctor_mini_dev:3.1.0.02151924'
  70 +// implementation 'com.hh-medic.android.sdk:hh_doctor:3.1.0.02171016'
  71 + implementation 'com.hh-medic.android.sdk:hh_doctor:3.1.0.03242028'
  72 +
  73 +
  74 + testImplementation 'junit:junit:4.+'
  75 + androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  76 + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  77 +}
  1 +# Add project specific ProGuard rules here.
  2 +# You can control the set of applied configuration files using the
  3 +# proguardFiles setting in build.gradle.
  4 +#
  5 +# For more details, see
  6 +# http://developer.android.com/guide/developing/tools/proguard.html
  7 +
  8 +# If your project uses WebView with JS, uncomment the following
  9 +# and specify the fully qualified class name to the JavaScript interface
  10 +# class:
  11 +#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  12 +# public *;
  13 +#}
  14 +
  15 +# Uncomment this to preserve the line number information for
  16 +# debugging stack traces.
  17 +#-keepattributes SourceFile,LineNumberTable
  18 +
  19 +# If you keep the line number information, uncomment this to
  20 +# hide the original source file name.
  21 +#-renamesourcefileattribute SourceFile
  22 +
  23 +
  24 +#-keep class com.hhmedic.android.sdk.** {*;}
  25 +#-keep class com.tencent.** { *; }
  1 +package com.hhmedic.sdk.demo;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import androidx.test.platform.app.InstrumentationRegistry;
  6 +import androidx.test.ext.junit.runners.AndroidJUnit4;
  7 +
  8 +import org.junit.Test;
  9 +import org.junit.runner.RunWith;
  10 +
  11 +import static org.junit.Assert.*;
  12 +
  13 +/**
  14 + * Instrumented test, which will execute on an Android device.
  15 + *
  16 + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
  17 + */
  18 +@RunWith(AndroidJUnit4.class)
  19 +public class ExampleInstrumentedTest {
  20 + @Test
  21 + public void useAppContext() {
  22 + // Context of the app under test.
  23 + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
  24 + assertEquals("com.hhmedic.sdk.demo", appContext.getPackageName());
  25 + }
  26 +}
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3 + package="com.hhmedic.sdk.demo">
  4 +
  5 + <application
  6 + android:name=".DemoApp"
  7 + android:allowBackup="true"
  8 + android:icon="@mipmap/ic_launcher"
  9 + android:label="@string/app_name"
  10 + android:roundIcon="@mipmap/ic_launcher_round"
  11 + android:supportsRtl="true"
  12 + android:theme="@style/HHAppTheme">
  13 + <activity android:name=".CallAct"></activity>
  14 + <activity android:name=".MainActivity">
  15 + <intent-filter>
  16 + <action android:name="android.intent.action.MAIN" />
  17 +
  18 + <category android:name="android.intent.category.LAUNCHER" />
  19 + </intent-filter>
  20 + </activity>
  21 + </application>
  22 +
  23 +</manifest>
  1 +package com.hhmedic.sdk.demo;
  2 +
  3 +import android.os.Build;
  4 +import android.view.MenuItem;
  5 +
  6 +import androidx.annotation.NonNull;
  7 +import androidx.appcompat.app.AppCompatActivity;
  8 +import androidx.appcompat.widget.Toolbar;
  9 +
  10 +public class BaseAct extends AppCompatActivity {
  11 +
  12 + public void initActionBar(Toolbar toolbar) {
  13 + if (toolbar == null) {
  14 + return;
  15 + }
  16 + setSupportActionBar(toolbar);
  17 + initActionBar();
  18 + }
  19 +
  20 + private void initActionBar() {
  21 + if (getSupportActionBar() == null) {
  22 + return;
  23 + }
  24 +
  25 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  26 + getSupportActionBar().setElevation(0f);
  27 + }
  28 + getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  29 + }
  30 +
  31 + public void hideBack() {
  32 + if (getSupportActionBar() != null) {
  33 + getSupportActionBar().setDisplayHomeAsUpEnabled(false);
  34 + }
  35 + }
  36 +
  37 + @Override
  38 + public boolean onOptionsItemSelected(@NonNull MenuItem item) {
  39 + if (item.getItemId() == android.R.id.home) {
  40 + finish();
  41 + return true;
  42 + }
  43 + return super.onOptionsItemSelected(item);
  44 + }
  45 +}
  1 +package com.hhmedic.sdk.demo;
  2 +
  3 +import android.content.Context;
  4 +
  5 +public class BaseConfig {
  6 +
  7 + public static String DefaultUserToken = "B0E86BAB0AF0F9E08B8A02969FD7CB553F0D04F68EA2608F6783B874E4F50EEF";//"B0E86BAB0AF0F9E08B8A02969FD7CB553F0D04F68EA2608F6783B874E4F50EEF";
  8 +
  9 + public static String IsDevelopKey = "isDevelop";
  10 +
  11 + public static String KeyUserToken = "userToken";
  12 +
  13 + public static String DefaultSDKProductId = "10350";
  14 +
  15 + public static String DefaultMedicId = "1625120849154";
  16 +
  17 + public static String DefaultForwardUserToken = "D768BC785EEA5B9A629470218973DF1D61DD1A68EED4C46CF57BB2FB029350D4";
  18 +
  19 + public static void setDevelop(Context context, boolean develop) {
  20 + SharedPreferenceUtils.setValue(context,IsDevelopKey,develop);
  21 + }
  22 +
  23 + public static boolean isDevelop(Context context) {
  24 + return SharedPreferenceUtils.getBooleanValue(context,IsDevelopKey,true);
  25 + }
  26 +
  27 +}
  1 +package com.hhmedic.sdk.demo;
  2 +
  3 +import androidx.databinding.DataBindingUtil;
  4 +
  5 +import android.os.Bundle;
  6 +import android.text.TextUtils;
  7 +import android.view.View;
  8 +import android.widget.Toast;
  9 +
  10 +import com.hhmedic.android.sdk.HHDoctor;
  11 +import com.hhmedic.android.sdk.listener.HHCallListener;
  12 +import com.hhmedic.sdk.demo.databinding.ActivityCallBinding;
  13 +
  14 +public class CallAct extends BaseAct {
  15 +
  16 + private ActivityCallBinding callBinding;
  17 +
  18 + private String mainUserToken;
  19 +
  20 + @Override
  21 + protected void onCreate(Bundle savedInstanceState) {
  22 + super.onCreate(savedInstanceState);
  23 + callBinding = DataBindingUtil.setContentView(this,R.layout.activity_call);
  24 + mainUserToken = getIntent().getStringExtra(BaseConfig.KeyUserToken);
  25 + initUI();
  26 + }
  27 +
  28 + private void initUI() {
  29 +
  30 + initActionBar(callBinding.toolbar);
  31 +
  32 + callBinding.editMedicId.setText(BaseConfig.DefaultMedicId);
  33 + callBinding.editForwardUserToken.setText(BaseConfig.DefaultForwardUserToken);
  34 +
  35 + callBinding.buttonSetExt.setOnClickListener(view -> HHDoctor.setCallExtension(callBinding.editExt.getText().toString()));
  36 +
  37 + callBinding.buttonCall.setOnClickListener(view -> {
  38 + call();
  39 + });
  40 + callBinding.buttonGetMedic.setOnClickListener(new View.OnClickListener() {
  41 + @Override
  42 + public void onClick(View view) {
  43 + getMedicUrl();
  44 + }
  45 + });
  46 + }
  47 +
  48 + private void getMedicUrl() {
  49 + String medicId = callBinding.editMedicId.getText().toString().trim();
  50 + String forwardUserToken = callBinding.editForwardUserToken.getText().toString();
  51 + if (TextUtils.isEmpty(medicId)) {
  52 + Toast.makeText(this, getString(R.string.hint_medic_id), Toast.LENGTH_SHORT).show();
  53 + return;
  54 + }
  55 + if (TextUtils.isEmpty(forwardUserToken)) {
  56 + Toast.makeText(this, getString(R.string.hint_forward_user_token), Toast.LENGTH_SHORT).show();
  57 + return;
  58 + }
  59 + String url = HHDoctor.getMedicDetailUrl(medicId,mainUserToken,forwardUserToken);
  60 + callBinding.editUrl.setText(url);
  61 +
  62 + }
  63 +
  64 + private void call() {
  65 + String userToken = callBinding.editUserToken.getText().toString().trim();
  66 + if (TextUtils.isEmpty(userToken)) {
  67 +// Toast.makeText(this, getString(R.string.tip_input_call_user_token), Toast.LENGTH_SHORT).show();
  68 +// return;
  69 + userToken = mainUserToken;
  70 + }
  71 +
  72 + HHDoctor.call(this, userToken, new HHCallListener() {
  73 + @Override
  74 + public void onStart(String s) {
  75 + toast("onStart");
  76 + }
  77 +
  78 + @Override
  79 + public void onFinish(long l) {
  80 + toast("onFinish");
  81 + }
  82 +
  83 + @Override
  84 + public void onCallSuccess() {
  85 + toast("onCallSuccess");
  86 + }
  87 +
  88 + @Override
  89 + public void onFail(int i) {
  90 + toast("onFail" + i);
  91 + }
  92 +
  93 + @Override
  94 + public void onCancel() {
  95 + toast("onCancel");
  96 + }
  97 + });
  98 + }
  99 +
  100 + private void toast(String call) {
  101 + Toast.makeText(this, call, Toast.LENGTH_SHORT).show();
  102 + }
  103 +}
  1 +package com.hhmedic.sdk.demo;
  2 +
  3 +import android.app.Application;
  4 +import android.util.Log;
  5 +
  6 +import com.hhmedic.android.sdk.HHDoctor;
  7 +import com.hhmedic.android.sdk.config.HHSDKOptions;
  8 +
  9 +public class DemoApp extends Application {
  10 +
  11 + @Override
  12 + public void onCreate() {
  13 + super.onCreate();
  14 + initSDK();
  15 + }
  16 +
  17 + private void initSDK() {
  18 + boolean isDevelop = BaseConfig.isDevelop(this);
  19 + Log.e("isDevelop", "isDevelop=" + isDevelop);
  20 + HHSDKOptions options = new HHSDKOptions(BaseConfig.DefaultSDKProductId,isDevelop,new GlideImageLoader());
  21 + HHDoctor.init(this,options);
  22 + }
  23 +}
  1 +package com.hhmedic.sdk.demo;
  2 +
  3 +import android.content.Context;
  4 +import android.widget.ImageView;
  5 +
  6 +import com.bumptech.glide.Glide;
  7 +import com.bumptech.glide.request.RequestOptions;
  8 +import com.hhmedic.android.sdk.config.HHImageEngine;
  9 +
  10 +public class GlideImageLoader implements HHImageEngine {
  11 + @Override
  12 + public void loadImage(Context context, int placeHolder, String url, ImageView imageView) {
  13 + Glide.with(context).load(url).apply(new RequestOptions()).placeholder(placeHolder).into(imageView);
  14 + }
  15 +}
  16 +
  1 +package com.hhmedic.sdk.demo;
  2 +
  3 +import android.content.Intent;
  4 +import android.os.Bundle;
  5 +import android.os.Handler;
  6 +import android.text.TextUtils;
  7 +import android.widget.Toast;
  8 +
  9 +import androidx.databinding.DataBindingUtil;
  10 +
  11 +import com.hhmedic.android.sdk.HHDoctor;
  12 +import com.hhmedic.android.sdk.listener.HHLoginListener;
  13 +import com.hhmedic.sdk.demo.databinding.ActivityMainBinding;
  14 +
  15 +public class MainActivity extends BaseAct {
  16 +
  17 + private ActivityMainBinding mainBinding;
  18 +
  19 +
  20 + @Override
  21 + protected void onCreate(Bundle savedInstanceState) {
  22 + super.onCreate(savedInstanceState);
  23 + mainBinding = DataBindingUtil.setContentView(this,R.layout.activity_main);
  24 +
  25 + initUI();
  26 + }
  27 +
  28 + private void initUI() {
  29 + initActionBar(mainBinding.toolbar);
  30 + hideBack();
  31 +
  32 + mainBinding.developSwitch.setChecked(BaseConfig.isDevelop(this));
  33 + mainBinding.developSwitch.setOnCheckedChangeListener((compoundButton, b) -> {
  34 + BaseConfig.setDevelop(MainActivity.this,b);
  35 + switchReload();
  36 + } );
  37 + mainBinding.useDefaultUserToken.setOnClickListener(view -> mainBinding.userToken.setText(BaseConfig.DefaultUserToken));
  38 + mainBinding.loginButton.setOnClickListener(view -> login());
  39 +
  40 + }
  41 +
  42 + private void login() {
  43 + String userToken = mainBinding.userToken.getText().toString().trim();
  44 + if (TextUtils.isEmpty(userToken)) {
  45 + Toast.makeText(this, "请输入需要登录的UserToken", Toast.LENGTH_SHORT).show();
  46 + return;
  47 + }
  48 + HHDoctor.login(this, userToken, new HHLoginListener() {
  49 + @Override
  50 + public void onSuccess() {
  51 + Intent intent = new Intent(MainActivity.this,CallAct.class);
  52 + intent.putExtra(BaseConfig.KeyUserToken,userToken);
  53 + startActivity(intent);
  54 + }
  55 +
  56 + @Override
  57 + public void onError(String s) {
  58 + Toast.makeText(MainActivity.this, s, Toast.LENGTH_SHORT).show();
  59 + }
  60 + });
  61 + }
  62 +
  63 + private void switchReload() {
  64 + Toast.makeText(this, "切换设置后需要重启打开APP才会生效", Toast.LENGTH_SHORT).show();
  65 + new Handler(getMainLooper()).postDelayed(() -> System.exit(0),1000);
  66 + }
  67 +}
  1 +package com.hhmedic.sdk.demo;
  2 +
  3 +import android.content.Context;
  4 +import android.content.SharedPreferences;
  5 +
  6 +public class SharedPreferenceUtils {
  7 +
  8 + private static final String PREFERENCE_NAME = "HH_SDK_DEMO";
  9 +
  10 + public static void setValue(Context context,String key,String value) {
  11 + SharedPreferences.Editor editor = getEditor(context);
  12 + editor.putString(key, value);
  13 + editor.apply();
  14 + }
  15 +
  16 + public static void setValue(Context context,String key,Boolean value) {
  17 + SharedPreferences.Editor editor = getEditor(context);
  18 + editor.putBoolean(key, value);
  19 + editor.apply();
  20 + }
  21 +
  22 + public static String getStringValue(Context context, String key){
  23 + return getSharePreference(context).getString(key, "");
  24 + }
  25 +
  26 + public static boolean getBooleanValue(Context context,String key, boolean defaultValue) {
  27 + return getSharePreference(context).getBoolean(key, defaultValue);
  28 + }
  29 +
  30 + private static SharedPreferences getSharePreference(Context context) {
  31 + return context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);
  32 + }
  33 +
  34 + private static SharedPreferences.Editor getEditor(Context context) {
  35 + SharedPreferences preferences = getSharePreference(context);
  36 + return preferences.edit();
  37 + }
  38 +}
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + xmlns:aapt="http://schemas.android.com/aapt"
  3 + android:width="108dp"
  4 + android:height="108dp"
  5 + android:viewportWidth="108"
  6 + android:viewportHeight="108">
  7 + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
  8 + <aapt:attr name="android:fillColor">
  9 + <gradient
  10 + android:endX="85.84757"
  11 + android:endY="92.4963"
  12 + android:startX="42.9492"
  13 + android:startY="49.59793"
  14 + android:type="linear">
  15 + <item
  16 + android:color="#44000000"
  17 + android:offset="0.0" />
  18 + <item
  19 + android:color="#00000000"
  20 + android:offset="1.0" />
  21 + </gradient>
  22 + </aapt:attr>
  23 + </path>
  24 + <path
  25 + android:fillColor="#FFFFFF"
  26 + android:fillType="nonZero"
  27 + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
  28 + android:strokeWidth="1"
  29 + android:strokeColor="#00000000" />
  30 +</vector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:width="108dp"
  4 + android:height="108dp"
  5 + android:viewportWidth="108"
  6 + android:viewportHeight="108">
  7 + <path
  8 + android:fillColor="#3DDC84"
  9 + android:pathData="M0,0h108v108h-108z" />
  10 + <path
  11 + android:fillColor="#00000000"
  12 + android:pathData="M9,0L9,108"
  13 + android:strokeWidth="0.8"
  14 + android:strokeColor="#33FFFFFF" />
  15 + <path
  16 + android:fillColor="#00000000"
  17 + android:pathData="M19,0L19,108"
  18 + android:strokeWidth="0.8"
  19 + android:strokeColor="#33FFFFFF" />
  20 + <path
  21 + android:fillColor="#00000000"
  22 + android:pathData="M29,0L29,108"
  23 + android:strokeWidth="0.8"
  24 + android:strokeColor="#33FFFFFF" />
  25 + <path
  26 + android:fillColor="#00000000"
  27 + android:pathData="M39,0L39,108"
  28 + android:strokeWidth="0.8"
  29 + android:strokeColor="#33FFFFFF" />
  30 + <path
  31 + android:fillColor="#00000000"
  32 + android:pathData="M49,0L49,108"
  33 + android:strokeWidth="0.8"
  34 + android:strokeColor="#33FFFFFF" />
  35 + <path
  36 + android:fillColor="#00000000"
  37 + android:pathData="M59,0L59,108"
  38 + android:strokeWidth="0.8"
  39 + android:strokeColor="#33FFFFFF" />
  40 + <path
  41 + android:fillColor="#00000000"
  42 + android:pathData="M69,0L69,108"
  43 + android:strokeWidth="0.8"
  44 + android:strokeColor="#33FFFFFF" />
  45 + <path
  46 + android:fillColor="#00000000"
  47 + android:pathData="M79,0L79,108"
  48 + android:strokeWidth="0.8"
  49 + android:strokeColor="#33FFFFFF" />
  50 + <path
  51 + android:fillColor="#00000000"
  52 + android:pathData="M89,0L89,108"
  53 + android:strokeWidth="0.8"
  54 + android:strokeColor="#33FFFFFF" />
  55 + <path
  56 + android:fillColor="#00000000"
  57 + android:pathData="M99,0L99,108"
  58 + android:strokeWidth="0.8"
  59 + android:strokeColor="#33FFFFFF" />
  60 + <path
  61 + android:fillColor="#00000000"
  62 + android:pathData="M0,9L108,9"
  63 + android:strokeWidth="0.8"
  64 + android:strokeColor="#33FFFFFF" />
  65 + <path
  66 + android:fillColor="#00000000"
  67 + android:pathData="M0,19L108,19"
  68 + android:strokeWidth="0.8"
  69 + android:strokeColor="#33FFFFFF" />
  70 + <path
  71 + android:fillColor="#00000000"
  72 + android:pathData="M0,29L108,29"
  73 + android:strokeWidth="0.8"
  74 + android:strokeColor="#33FFFFFF" />
  75 + <path
  76 + android:fillColor="#00000000"
  77 + android:pathData="M0,39L108,39"
  78 + android:strokeWidth="0.8"
  79 + android:strokeColor="#33FFFFFF" />
  80 + <path
  81 + android:fillColor="#00000000"
  82 + android:pathData="M0,49L108,49"
  83 + android:strokeWidth="0.8"
  84 + android:strokeColor="#33FFFFFF" />
  85 + <path
  86 + android:fillColor="#00000000"
  87 + android:pathData="M0,59L108,59"
  88 + android:strokeWidth="0.8"
  89 + android:strokeColor="#33FFFFFF" />
  90 + <path
  91 + android:fillColor="#00000000"
  92 + android:pathData="M0,69L108,69"
  93 + android:strokeWidth="0.8"
  94 + android:strokeColor="#33FFFFFF" />
  95 + <path
  96 + android:fillColor="#00000000"
  97 + android:pathData="M0,79L108,79"
  98 + android:strokeWidth="0.8"
  99 + android:strokeColor="#33FFFFFF" />
  100 + <path
  101 + android:fillColor="#00000000"
  102 + android:pathData="M0,89L108,89"
  103 + android:strokeWidth="0.8"
  104 + android:strokeColor="#33FFFFFF" />
  105 + <path
  106 + android:fillColor="#00000000"
  107 + android:pathData="M0,99L108,99"
  108 + android:strokeWidth="0.8"
  109 + android:strokeColor="#33FFFFFF" />
  110 + <path
  111 + android:fillColor="#00000000"
  112 + android:pathData="M19,29L89,29"
  113 + android:strokeWidth="0.8"
  114 + android:strokeColor="#33FFFFFF" />
  115 + <path
  116 + android:fillColor="#00000000"
  117 + android:pathData="M19,39L89,39"
  118 + android:strokeWidth="0.8"
  119 + android:strokeColor="#33FFFFFF" />
  120 + <path
  121 + android:fillColor="#00000000"
  122 + android:pathData="M19,49L89,49"
  123 + android:strokeWidth="0.8"
  124 + android:strokeColor="#33FFFFFF" />
  125 + <path
  126 + android:fillColor="#00000000"
  127 + android:pathData="M19,59L89,59"
  128 + android:strokeWidth="0.8"
  129 + android:strokeColor="#33FFFFFF" />
  130 + <path
  131 + android:fillColor="#00000000"
  132 + android:pathData="M19,69L89,69"
  133 + android:strokeWidth="0.8"
  134 + android:strokeColor="#33FFFFFF" />
  135 + <path
  136 + android:fillColor="#00000000"
  137 + android:pathData="M19,79L89,79"
  138 + android:strokeWidth="0.8"
  139 + android:strokeColor="#33FFFFFF" />
  140 + <path
  141 + android:fillColor="#00000000"
  142 + android:pathData="M29,19L29,89"
  143 + android:strokeWidth="0.8"
  144 + android:strokeColor="#33FFFFFF" />
  145 + <path
  146 + android:fillColor="#00000000"
  147 + android:pathData="M39,19L39,89"
  148 + android:strokeWidth="0.8"
  149 + android:strokeColor="#33FFFFFF" />
  150 + <path
  151 + android:fillColor="#00000000"
  152 + android:pathData="M49,19L49,89"
  153 + android:strokeWidth="0.8"
  154 + android:strokeColor="#33FFFFFF" />
  155 + <path
  156 + android:fillColor="#00000000"
  157 + android:pathData="M59,19L59,89"
  158 + android:strokeWidth="0.8"
  159 + android:strokeColor="#33FFFFFF" />
  160 + <path
  161 + android:fillColor="#00000000"
  162 + android:pathData="M69,19L69,89"
  163 + android:strokeWidth="0.8"
  164 + android:strokeColor="#33FFFFFF" />
  165 + <path
  166 + android:fillColor="#00000000"
  167 + android:pathData="M79,19L79,89"
  168 + android:strokeWidth="0.8"
  169 + android:strokeColor="#33FFFFFF" />
  170 +</vector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layout xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + tools:context=".CallAct">
  8 +
  9 + <androidx.appcompat.widget.Toolbar
  10 + android:id="@+id/toolbar"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="@dimen/hh_action_bar_height"
  13 + android:background="@color/colorPrimary"
  14 + app:layout_constraintStart_toStartOf="parent"
  15 + app:layout_constraintTop_toTopOf="parent"
  16 + app:theme="@style/Toolbar.Light"
  17 + app:titleTextColor="@android:color/white" />
  18 +
  19 + <TextView
  20 + android:id="@+id/title_ext"
  21 + android:layout_width="wrap_content"
  22 + android:layout_height="wrap_content"
  23 + android:layout_marginStart="15dp"
  24 + android:layout_marginTop="15dp"
  25 + android:text="@string/label_tip_ext"
  26 + app:layout_constraintStart_toStartOf="parent"
  27 + app:layout_constraintTop_toBottomOf="@id/toolbar" />
  28 +
  29 + <EditText
  30 + android:id="@+id/edit_ext"
  31 + android:layout_width="match_parent"
  32 + android:layout_marginTop="15dp"
  33 + android:hint="@string/hint_ext"
  34 + app:layout_constraintTop_toBottomOf="@id/title_ext"
  35 + app:layout_constraintStart_toStartOf="parent"
  36 + app:layout_constraintEnd_toEndOf="parent"
  37 + android:inputType="text"
  38 + android:layout_height="50dp"
  39 + android:autofillHints="" />
  40 +
  41 + <Button
  42 + android:id="@+id/button_set_ext"
  43 + android:layout_width="wrap_content"
  44 + android:layout_height="wrap_content"
  45 + android:layout_marginTop="@dimen/default_margin"
  46 + android:layout_marginStart="@dimen/default_margin"
  47 + app:layout_constraintTop_toBottomOf="@id/edit_ext"
  48 + app:layout_constraintStart_toStartOf="parent"
  49 + android:text="@string/button_set_ext"/>
  50 +
  51 + <EditText
  52 + android:id="@+id/edit_userToken"
  53 + android:layout_width="match_parent"
  54 + android:layout_marginTop="15dp"
  55 + android:hint="@string/tip_input_call_user_token"
  56 + app:layout_constraintTop_toBottomOf="@id/button_set_ext"
  57 + app:layout_constraintStart_toStartOf="parent"
  58 + app:layout_constraintEnd_toEndOf="parent"
  59 + android:inputType="text"
  60 + android:layout_height="50dp"
  61 + android:autofillHints="" />
  62 +
  63 + <Button
  64 + android:id="@+id/button_call"
  65 + android:layout_width="wrap_content"
  66 + android:layout_height="wrap_content"
  67 + android:layout_marginTop="@dimen/default_margin"
  68 + android:layout_marginStart="@dimen/default_margin"
  69 + app:layout_constraintTop_toBottomOf="@id/edit_userToken"
  70 + app:layout_constraintStart_toStartOf="parent"
  71 + android:text="@string/button_call_user_token"/>
  72 +
  73 + <Button
  74 + android:id="@+id/button_get_medic"
  75 + android:layout_width="wrap_content"
  76 + android:layout_height="wrap_content"
  77 + android:layout_marginTop="@dimen/default_margin"
  78 + android:layout_marginStart="@dimen/default_margin"
  79 + app:layout_constraintTop_toBottomOf="@id/button_call"
  80 + app:layout_constraintStart_toStartOf="parent"
  81 + android:text="@string/button_get_medic_url"/>
  82 +
  83 + <EditText
  84 + android:id="@+id/edit_medic_id"
  85 + android:layout_width="match_parent"
  86 + android:layout_marginTop="15dp"
  87 + android:hint="@string/hint_medic_id"
  88 + app:layout_constraintTop_toBottomOf="@id/button_get_medic"
  89 + app:layout_constraintStart_toStartOf="parent"
  90 + app:layout_constraintEnd_toEndOf="parent"
  91 + android:inputType="text"
  92 + android:layout_height="50dp"
  93 + android:autofillHints="" />
  94 +
  95 + <EditText
  96 + android:id="@+id/edit_forward_userToken"
  97 + android:layout_width="match_parent"
  98 + android:layout_marginTop="15dp"
  99 + android:hint="@string/hint_forward_user_token"
  100 + app:layout_constraintTop_toBottomOf="@id/edit_medic_id"
  101 + app:layout_constraintStart_toStartOf="parent"
  102 + app:layout_constraintEnd_toEndOf="parent"
  103 + android:inputType="text"
  104 + android:layout_height="50dp"
  105 + android:autofillHints="" />
  106 +
  107 + <EditText
  108 + android:id="@+id/edit_url"
  109 + android:layout_width="match_parent"
  110 + android:layout_height="0dp"
  111 + android:minLines="5"
  112 + app:layout_constraintBottom_toBottomOf="parent"
  113 + android:textIsSelectable="true"
  114 + android:inputType="text"
  115 + app:layout_constraintTop_toBottomOf="@id/edit_forward_userToken"/>
  116 +
  117 + </androidx.constraintlayout.widget.ConstraintLayout>
  118 +</layout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layout>
  3 +
  4 + <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5 + xmlns:app="http://schemas.android.com/apk/res-auto"
  6 + xmlns:tools="http://schemas.android.com/tools"
  7 + android:layout_width="match_parent"
  8 + android:layout_height="match_parent"
  9 + tools:context=".MainActivity">
  10 + <androidx.appcompat.widget.Toolbar
  11 + android:id="@+id/toolbar"
  12 + app:titleTextColor="@android:color/white"
  13 + android:layout_width="match_parent"
  14 + android:layout_height="@dimen/hh_action_bar_height"
  15 + android:background="@color/colorPrimary"
  16 + app:theme="@style/Toolbar.Light"
  17 + app:layout_constraintStart_toStartOf="parent"
  18 + app:layout_constraintTop_toTopOf="parent"
  19 + />
  20 + <androidx.appcompat.widget.SwitchCompat
  21 + style="@style/config_switch"
  22 + android:id="@+id/developSwitch"
  23 + android:checked="true"
  24 + android:text="@string/is_develop"
  25 + app:layout_constraintStart_toStartOf="parent"
  26 + app:layout_constraintTop_toBottomOf="@id/toolbar"/>
  27 +
  28 + <TextView
  29 + android:id="@+id/title_user_token"
  30 + android:layout_width="wrap_content"
  31 + android:layout_height="wrap_content"
  32 + android:layout_marginStart="15dp"
  33 + android:layout_marginTop="15dp"
  34 + android:text="@string/user_token"
  35 + app:layout_constraintEnd_toStartOf="@id/user_token"
  36 + app:layout_constraintStart_toStartOf="parent"
  37 + app:layout_constraintTop_toBottomOf="@id/developSwitch" />
  38 +
  39 + <EditText
  40 + android:id="@+id/user_token"
  41 + android:layout_width="0dp"
  42 + android:layout_height="wrap_content"
  43 + android:hint="@string/tip_input_user_token"
  44 + app:layout_constraintBaseline_toBaselineOf="@id/title_user_token"
  45 + app:layout_constraintEnd_toEndOf="parent"
  46 + app:layout_constraintHorizontal_weight="1"
  47 + android:inputType="text"
  48 + android:autofillHints="@string/use_default_user_token"
  49 + app:layout_constraintStart_toEndOf="@id/title_user_token" />
  50 +
  51 + <Button
  52 + android:id="@+id/use_default_user_token"
  53 + android:layout_width="wrap_content"
  54 + android:layout_height="wrap_content"
  55 + android:layout_marginTop="15dp"
  56 + android:text="@string/use_default_user_token"
  57 + app:layout_constraintStart_toStartOf="@id/title_user_token"
  58 + app:layout_constraintTop_toBottomOf="@id/user_token" />
  59 +
  60 + <Button
  61 + android:id="@+id/login_button"
  62 + android:layout_width="wrap_content"
  63 + android:layout_height="wrap_content"
  64 + android:layout_marginTop="15dp"
  65 + android:text="@string/button_login"
  66 + app:layout_constraintStart_toEndOf="@id/use_default_user_token"
  67 + app:layout_constraintTop_toBottomOf="@id/user_token"
  68 + android:layout_marginStart="15dp"/>
  69 + </androidx.constraintlayout.widget.ConstraintLayout>
  70 +</layout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <background android:drawable="@drawable/ic_launcher_background" />
  4 + <foreground android:drawable="@drawable/ic_launcher_foreground" />
  5 +</adaptive-icon>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <background android:drawable="@drawable/ic_launcher_background" />
  4 + <foreground android:drawable="@drawable/ic_launcher_foreground" />
  5 +</adaptive-icon>
  1 +<resources xmlns:tools="http://schemas.android.com/tools">
  2 + <!-- Base application theme. -->
  3 + <style name="Theme.HHDoctorSDKDemo" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
  4 + <!-- Primary brand color. -->
  5 + <item name="colorPrimary">@color/purple_200</item>
  6 + <item name="colorPrimaryVariant">@color/purple_700</item>
  7 + <item name="colorOnPrimary">@color/black</item>
  8 + <!-- Secondary brand color. -->
  9 + <item name="colorSecondary">@color/teal_200</item>
  10 + <item name="colorSecondaryVariant">@color/teal_200</item>
  11 + <item name="colorOnSecondary">@color/black</item>
  12 + <!-- Status bar color. -->
  13 + <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
  14 + <!-- Customize your theme here. -->
  15 + </style>
  16 +</resources>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources>
  3 + <color name="colorPrimary">#0c92f0</color>
  4 + <color name="colorPrimaryDark">#ff0082de</color>
  5 + <color name="colorAccent">#ff1482f0</color>
  6 +
  7 + <color name="purple_200">#FFBB86FC</color>
  8 + <color name="purple_500">#FF6200EE</color>
  9 + <color name="purple_700">#FF3700B3</color>
  10 + <color name="teal_200">#FF03DAC5</color>
  11 + <color name="teal_700">#FF018786</color>
  12 + <color name="black">#FF000000</color>
  13 + <color name="white">#FFFFFFFF</color>
  14 +</resources>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources>
  3 + <dimen name="default_margin">15dp</dimen>
  4 + <dimen name="hh_action_bar_height">46dp</dimen>
  5 +</resources>
  1 +<resources>
  2 + <string name="app_name">美团Demo</string>
  3 + <string name="is_develop">是否为测试环境</string>
  4 + <string name="user_token">UserToken</string>
  5 + <string name="tip_input_user_token">请输入登录所需UserToken</string>
  6 + <string name="button_login">登录</string>
  7 + <string name="use_default_user_token">使用默认UserToken</string>
  8 + <string name="call_adult_doctor">呼叫成人医生</string>
  9 + <string name="call_child_doctor">呼叫儿童医生</string>
  10 + <string name="tip_input_call_user_token">请输入呼叫指定UserToken</string>
  11 + <string name="button_call_user_token">开始呼叫</string>
  12 + <string name="button_direct_call">直接呼叫</string>
  13 + <string name="button_send_message">发送消息</string>
  14 + <string name="label_tip_ext">呼叫附加参数</string>
  15 + <string name="hint_ext">请输入附加参数</string>
  16 + <string name="button_set_ext">设置呼叫附加参数</string>
  17 + <string name="button_get_medic_url">获取病历地址</string>
  18 + <string name="hint_medic_id">请输入指定的MedicID</string>
  19 + <string name="hint_forward_user_token">请输入指定userToken</string>
  20 +</resources>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources>
  3 +
  4 + <style name="HHAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
  5 + <!-- Customize your theme here. -->
  6 + <!-- 配置qmui提供的theme -->
  7 + <item name="colorPrimary">@color/colorPrimary</item>
  8 + <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
  9 + <item name="colorAccent">@color/colorAccent</item>
  10 + <item name="colorControlNormal">@android:color/black</item>
  11 + <item name="android:windowIsTranslucent">true</item>
  12 + </style>
  13 +
  14 + <style name="config_switch">
  15 + <item name="android:layout_width">wrap_content</item>
  16 + <item name="android:layout_height">wrap_content</item>
  17 + <item name="android:layout_marginTop">10dp</item>
  18 + <item name="android:paddingStart">15dp</item>
  19 + <item name="android:paddingEnd">15dp</item>
  20 + </style>
  21 +
  22 + <style name="Toolbar" parent="Theme.AppCompat.Light">
  23 +
  24 + <item name="actionMenuTextColor">@android:color/black</item>
  25 + <item name="colorPrimary">@color/colorPrimary</item>
  26 + <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
  27 + <item name="colorAccent">@color/colorAccent</item>
  28 + <item name="colorControlNormal">@android:color/black</item>
  29 +
  30 + </style>
  31 +
  32 + <style name="Toolbar.Light" parent="Toolbar">
  33 +
  34 + <item name="colorControlNormal">@android:color/white</item>
  35 +
  36 + <item name="actionMenuTextColor">@android:color/white</item>
  37 +
  38 + </style>
  39 +</resources>
  1 +<resources xmlns:tools="http://schemas.android.com/tools">
  2 + <!-- Base application theme. -->
  3 + <style name="Theme.HHDoctorSDKDemo" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
  4 + <!-- Primary brand color. -->
  5 + <item name="colorPrimary">@color/purple_500</item>
  6 + <item name="colorPrimaryVariant">@color/purple_700</item>
  7 + <item name="colorOnPrimary">@color/white</item>
  8 + <!-- Secondary brand color. -->
  9 + <item name="colorSecondary">@color/teal_200</item>
  10 + <item name="colorSecondaryVariant">@color/teal_700</item>
  11 + <item name="colorOnSecondary">@color/black</item>
  12 + <!-- Status bar color. -->
  13 + <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
  14 + <!-- Customize your theme here. -->
  15 + </style>
  16 +</resources>
  1 +package com.hhmedic.sdk.demo;
  2 +
  3 +import org.junit.Test;
  4 +
  5 +import static org.junit.Assert.*;
  6 +
  7 +/**
  8 + * Example local unit test, which will execute on the development machine (host).
  9 + *
  10 + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
  11 + */
  12 +public class ExampleUnitTest {
  13 + @Test
  14 + public void addition_isCorrect() {
  15 + assertEquals(4, 2 + 2);
  16 + }
  17 +}
  1 +// Top-level build file where you can add configuration options common to all sub-projects/modules.
  2 +buildscript {
  3 + repositories {
  4 + google()
  5 + jcenter()
  6 + }
  7 + dependencies {
  8 + classpath "com.android.tools.build:gradle:4.1.1"
  9 +
  10 + // NOTE: Do not place your application dependencies here; they belong
  11 + // in the individual module build.gradle files
  12 + }
  13 +}
  14 +
  15 +allprojects {
  16 + repositories {
  17 + google()
  18 + jcenter()
  19 + mavenCentral()
  20 + }
  21 +}
  22 +
  23 +task clean(type: Delete) {
  24 + delete rootProject.buildDir
  25 +}
  1 +# Project-wide Gradle settings.
  2 +# IDE (e.g. Android Studio) users:
  3 +# Gradle settings configured through the IDE *will override*
  4 +# any settings specified in this file.
  5 +# For more details on how to configure your build environment visit
  6 +# http://www.gradle.org/docs/current/userguide/build_environment.html
  7 +# Specifies the JVM arguments used for the daemon process.
  8 +# The setting is particularly useful for tweaking memory settings.
  9 +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
  10 +# When configured, Gradle will run in incubating parallel mode.
  11 +# This option should only be used with decoupled projects. More details, visit
  12 +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
  13 +# org.gradle.parallel=true
  14 +# AndroidX package structure to make it clearer which packages are bundled with the
  15 +# Android operating system, and which are packaged with your app"s APK
  16 +# https://developer.android.com/topic/libraries/support-library/androidx-rn
  17 +android.useAndroidX=true
  18 +# Automatically convert third-party libraries to use AndroidX
  19 +android.enableJetifier=true
No preview for this file type
  1 +#Tue Aug 03 16:14:44 CST 2021
  2 +distributionBase=GRADLE_USER_HOME
  3 +distributionPath=wrapper/dists
  4 +zipStoreBase=GRADLE_USER_HOME
  5 +zipStorePath=wrapper/dists
  6 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
  1 +#!/usr/bin/env sh
  2 +
  3 +##############################################################################
  4 +##
  5 +## Gradle start up script for UN*X
  6 +##
  7 +##############################################################################
  8 +
  9 +# Attempt to set APP_HOME
  10 +# Resolve links: $0 may be a link
  11 +PRG="$0"
  12 +# Need this for relative symlinks.
  13 +while [ -h "$PRG" ] ; do
  14 + ls=`ls -ld "$PRG"`
  15 + link=`expr "$ls" : '.*-> \(.*\)$'`
  16 + if expr "$link" : '/.*' > /dev/null; then
  17 + PRG="$link"
  18 + else
  19 + PRG=`dirname "$PRG"`"/$link"
  20 + fi
  21 +done
  22 +SAVED="`pwd`"
  23 +cd "`dirname \"$PRG\"`/" >/dev/null
  24 +APP_HOME="`pwd -P`"
  25 +cd "$SAVED" >/dev/null
  26 +
  27 +APP_NAME="Gradle"
  28 +APP_BASE_NAME=`basename "$0"`
  29 +
  30 +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  31 +DEFAULT_JVM_OPTS=""
  32 +
  33 +# Use the maximum available, or set MAX_FD != -1 to use that value.
  34 +MAX_FD="maximum"
  35 +
  36 +warn () {
  37 + echo "$*"
  38 +}
  39 +
  40 +die () {
  41 + echo
  42 + echo "$*"
  43 + echo
  44 + exit 1
  45 +}
  46 +
  47 +# OS specific support (must be 'true' or 'false').
  48 +cygwin=false
  49 +msys=false
  50 +darwin=false
  51 +nonstop=false
  52 +case "`uname`" in
  53 + CYGWIN* )
  54 + cygwin=true
  55 + ;;
  56 + Darwin* )
  57 + darwin=true
  58 + ;;
  59 + MINGW* )
  60 + msys=true
  61 + ;;
  62 + NONSTOP* )
  63 + nonstop=true
  64 + ;;
  65 +esac
  66 +
  67 +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
  68 +
  69 +# Determine the Java command to use to start the JVM.
  70 +if [ -n "$JAVA_HOME" ] ; then
  71 + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
  72 + # IBM's JDK on AIX uses strange locations for the executables
  73 + JAVACMD="$JAVA_HOME/jre/sh/java"
  74 + else
  75 + JAVACMD="$JAVA_HOME/bin/java"
  76 + fi
  77 + if [ ! -x "$JAVACMD" ] ; then
  78 + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
  79 +
  80 +Please set the JAVA_HOME variable in your environment to match the
  81 +location of your Java installation."
  82 + fi
  83 +else
  84 + JAVACMD="java"
  85 + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  86 +
  87 +Please set the JAVA_HOME variable in your environment to match the
  88 +location of your Java installation."
  89 +fi
  90 +
  91 +# Increase the maximum file descriptors if we can.
  92 +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
  93 + MAX_FD_LIMIT=`ulimit -H -n`
  94 + if [ $? -eq 0 ] ; then
  95 + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
  96 + MAX_FD="$MAX_FD_LIMIT"
  97 + fi
  98 + ulimit -n $MAX_FD
  99 + if [ $? -ne 0 ] ; then
  100 + warn "Could not set maximum file descriptor limit: $MAX_FD"
  101 + fi
  102 + else
  103 + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
  104 + fi
  105 +fi
  106 +
  107 +# For Darwin, add options to specify how the application appears in the dock
  108 +if $darwin; then
  109 + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
  110 +fi
  111 +
  112 +# For Cygwin, switch paths to Windows format before running java
  113 +if $cygwin ; then
  114 + APP_HOME=`cygpath --path --mixed "$APP_HOME"`
  115 + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
  116 + JAVACMD=`cygpath --unix "$JAVACMD"`
  117 +
  118 + # We build the pattern for arguments to be converted via cygpath
  119 + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
  120 + SEP=""
  121 + for dir in $ROOTDIRSRAW ; do
  122 + ROOTDIRS="$ROOTDIRS$SEP$dir"
  123 + SEP="|"
  124 + done
  125 + OURCYGPATTERN="(^($ROOTDIRS))"
  126 + # Add a user-defined pattern to the cygpath arguments
  127 + if [ "$GRADLE_CYGPATTERN" != "" ] ; then
  128 + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
  129 + fi
  130 + # Now convert the arguments - kludge to limit ourselves to /bin/sh
  131 + i=0
  132 + for arg in "$@" ; do
  133 + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
  134 + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
  135 +
  136 + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
  137 + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
  138 + else
  139 + eval `echo args$i`="\"$arg\""
  140 + fi
  141 + i=$((i+1))
  142 + done
  143 + case $i in
  144 + (0) set -- ;;
  145 + (1) set -- "$args0" ;;
  146 + (2) set -- "$args0" "$args1" ;;
  147 + (3) set -- "$args0" "$args1" "$args2" ;;
  148 + (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
  149 + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
  150 + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
  151 + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
  152 + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
  153 + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
  154 + esac
  155 +fi
  156 +
  157 +# Escape application args
  158 +save () {
  159 + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
  160 + echo " "
  161 +}
  162 +APP_ARGS=$(save "$@")
  163 +
  164 +# Collect all arguments for the java command, following the shell quoting and substitution rules
  165 +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
  166 +
  167 +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
  168 +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
  169 + cd "$(dirname "$0")"
  170 +fi
  171 +
  172 +exec "$JAVACMD" "$@"
  1 +@if "%DEBUG%" == "" @echo off
  2 +@rem ##########################################################################
  3 +@rem
  4 +@rem Gradle startup script for Windows
  5 +@rem
  6 +@rem ##########################################################################
  7 +
  8 +@rem Set local scope for the variables with windows NT shell
  9 +if "%OS%"=="Windows_NT" setlocal
  10 +
  11 +set DIRNAME=%~dp0
  12 +if "%DIRNAME%" == "" set DIRNAME=.
  13 +set APP_BASE_NAME=%~n0
  14 +set APP_HOME=%DIRNAME%
  15 +
  16 +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  17 +set DEFAULT_JVM_OPTS=
  18 +
  19 +@rem Find java.exe
  20 +if defined JAVA_HOME goto findJavaFromJavaHome
  21 +
  22 +set JAVA_EXE=java.exe
  23 +%JAVA_EXE% -version >NUL 2>&1
  24 +if "%ERRORLEVEL%" == "0" goto init
  25 +
  26 +echo.
  27 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  28 +echo.
  29 +echo Please set the JAVA_HOME variable in your environment to match the
  30 +echo location of your Java installation.
  31 +
  32 +goto fail
  33 +
  34 +:findJavaFromJavaHome
  35 +set JAVA_HOME=%JAVA_HOME:"=%
  36 +set JAVA_EXE=%JAVA_HOME%/bin/java.exe
  37 +
  38 +if exist "%JAVA_EXE%" goto init
  39 +
  40 +echo.
  41 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  42 +echo.
  43 +echo Please set the JAVA_HOME variable in your environment to match the
  44 +echo location of your Java installation.
  45 +
  46 +goto fail
  47 +
  48 +:init
  49 +@rem Get command-line arguments, handling Windows variants
  50 +
  51 +if not "%OS%" == "Windows_NT" goto win9xME_args
  52 +
  53 +:win9xME_args
  54 +@rem Slurp the command line arguments.
  55 +set CMD_LINE_ARGS=
  56 +set _SKIP=2
  57 +
  58 +:win9xME_args_slurp
  59 +if "x%~1" == "x" goto execute
  60 +
  61 +set CMD_LINE_ARGS=%*
  62 +
  63 +:execute
  64 +@rem Setup the command line
  65 +
  66 +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
  67 +
  68 +@rem Execute Gradle
  69 +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
  70 +
  71 +:end
  72 +@rem End local scope for the variables with windows NT shell
  73 +if "%ERRORLEVEL%"=="0" goto mainEnd
  74 +
  75 +:fail
  76 +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
  77 +rem the _cmd.exe /c_ return code!
  78 +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
  79 +exit /b 1
  80 +
  81 +:mainEnd
  82 +if "%OS%"=="Windows_NT" endlocal
  83 +
  84 +:omega
  1 +include ':app'
  2 +rootProject.name = "HHDoctorSDKMiniDemo"