├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_web.xml │ │ │ │ ├── login_dialog_layout.xml │ │ │ │ └── activity_index.xml │ │ │ ├── drawable │ │ │ │ ├── ic_refresh_black_24dp.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── menu │ │ │ │ └── tools.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── xiaoeshopsdk │ │ │ │ └── sample │ │ │ │ ├── net │ │ │ │ ├── HttpLogger.java │ │ │ │ ├── SimpleCallBack.java │ │ │ │ ├── AccessTokenEntity.java │ │ │ │ ├── LoginEntity.java │ │ │ │ ├── BaseCallBack.java │ │ │ │ └── OkHttpHelper.java │ │ │ │ ├── SdkDemoApplication.java │ │ │ │ ├── utils │ │ │ │ └── Const.java │ │ │ │ ├── IndexActivity.java │ │ │ │ └── XeSdkDemoActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── xiaoeshopsdk │ │ │ └── sample │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── xiaoeshopsdk │ │ └── sample │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .github └── ISSUE_TEMPLATE │ └── bug--.md ├── README.md ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoeteam/XiaoeAppSDK-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | sample 3 | 登录成功 4 | 登录失败 5 | "用户名不能为空!" 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .idea 15 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jun 30 23:52:53 CST 2019 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-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/xiaoeshopsdk/sample/net/HttpLogger.java: -------------------------------------------------------------------------------- 1 | package com.xiaoeshopsdk.sample.net; 2 | 3 | import android.util.Log; 4 | import okhttp3.logging.HttpLoggingInterceptor; 5 | 6 | public class HttpLogger implements HttpLoggingInterceptor.Logger { 7 | @Override 8 | public void log(String message) { 9 | Log.d("HttpLogInfo", message); 10 | } 11 | } -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug--.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug报告 3 | about: 创建一个Bug报告帮助我们改善项目质量 4 | title: "【Bug】报告" 5 | labels: bug 6 | assignees: xiaoeteam 7 | 8 | --- 9 | 10 | **Bug描述** 11 | 清楚而简明地描述bug是什么。 12 | 13 | **重现步骤** 14 | 重现行为的步骤: 15 | xxxx 16 | 17 | **预期行为** 18 | 清楚而简明地描述你所期望发生的事情。 19 | 20 | **截图** 21 | 如果可以的话,添加屏幕截图来帮助解释您的问题。 22 | 23 | **手机(请填写以下信息):** 24 | - 设备类型: [e.g. iPhone6] 25 | - 设备系统版本: [e.g. iOS8.1] 26 | - SDK版本: [e.g. 1.0] 27 | 28 | **额外的信息** 29 | 在这里添加关于这个问题的任何其他信息。 30 | -------------------------------------------------------------------------------- /app/src/test/java/com/xiaoeshopsdk/sample/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.xiaoeshopsdk.sample; 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 Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_refresh_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/xiaoeshopsdk/sample/SdkDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.xiaoeshopsdk.sample; 2 | 3 | import android.app.Application; 4 | import com.xiaoe.shop.webcore.core.XiaoEWeb; 5 | import com.xiaoeshopsdk.sample.utils.Const; 6 | 7 | public class SdkDemoApplication extends Application{ 8 | 9 | @Override 10 | public void onCreate(){ 11 | super.onCreate(); 12 | //为了使用的稳定性,建议此处指定使用X5内核的WebView 13 | XiaoEWeb.init(this, Const.APP_ID, Const.CLIENT_ID, XiaoEWeb.WebViewType.X5); 14 | XiaoEWeb.isOpenLog(true); 15 | } 16 | } -------------------------------------------------------------------------------- /app/src/main/res/menu/tools.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/xiaoeshopsdk/sample/net/SimpleCallBack.java: -------------------------------------------------------------------------------- 1 | package com.xiaoeshopsdk.sample.net; 2 | 3 | import android.content.Context; 4 | 5 | import okhttp3.Request; 6 | import okhttp3.Response; 7 | 8 | public abstract class SimpleCallBack extends BaseCallBack 9 | { 10 | protected Context mContext; 11 | public SimpleCallBack(Context context) 12 | { 13 | mContext = context; 14 | } 15 | 16 | @Override 17 | public void onRequestBefore(Request request){} 18 | 19 | @Override 20 | public void onResponse(Response response){} 21 | 22 | @Override 23 | public void onTokenError(Response response, int code){} 24 | } 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 |

3 | 4 | [![webSite](https://img.shields.io/badge/%E5%B0%8F%E9%B9%85%E9%80%9A-%E5%AE%98%E7%BD%91-blue?style=for-the-badge)](https://www.xiaoe-tech.com/) 5 | 6 | ## 简述 7 | 8 | 通过小鹅通 APP 内嵌 SDK 可以在 App 内快速集成小鹅通提供的整个交易服务,享受完善的基础知识商品能力、营销玩法,更有小鹅通强劲的技术及服务作保障,实现低成本、高效率、强融合的移动商城方案,快速获得 App 流量的商业化变现。 9 | 10 | ## 引入 11 | 12 | ``` 13 | allprojects { 14 | repositories { 15 | mavenCentral() 16 | } 17 | } 18 | ``` 19 | 20 | 在子项目build.gradle的dependencies中根据需求引入依赖: 21 | ``` 22 | implementation 'com.xiaoetong.android.sdk:webcore:2.2.19'//最新版本号 23 | implementation 'com.tencent.tbs.tbssdk:sdk:43993' 24 | ``` 25 | ## 文档 26 | [接入文档](https://github.com/xiaoeteam/XiaoeAppSDK-Android/wiki "接入文档") 27 | 28 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/xiaoeshopsdk/sample/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.xiaoeshopsdk.sample; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.InstrumentationRegistry; 6 | import androidx.test.runner.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 Testing documentation 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.getTargetContext(); 24 | 25 | assertEquals("com.xiaoeshopsdk.sample", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 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=-Xmx1536m 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 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/xiaoeshopsdk/sample/utils/Const.java: -------------------------------------------------------------------------------- 1 | package com.xiaoeshopsdk.sample.utils; 2 | 3 | /** 4 | * Created by york on 2019-06-26. 5 | */ 6 | public class Const { 7 | 8 | //Demo测试店铺的登录接口(三方 App 用户需要实现SDK的登录,具体请看文档) 9 | public static final String SDK_LOGIN_URL = "https://app38itOR341547.sdk.xiaoe-tech.com/sdk_api/xe.account.login.test/1.0.0"; 10 | //Demo测试店铺的Url(三方 App 用户购买小鹅店铺sdk获取店铺Url 替换) 11 | public static final String SHOP_URL = "https://app38itOR341547.h5.xiaoeknow.com"; 12 | //Demo测试店铺的appID(三方 App 用户注册使用小鹅店铺,取得店铺appID 替换) 13 | public static final String APP_ID = "app38itOR341547"; 14 | //Demo测试店铺的sdkAppId(三方 App 用户购买小鹅店铺sdk获取sdkAppId 替换) 15 | public static final String CLIENT_ID = "883pzzGyzynE72G"; 16 | //Demo测试店铺的秘钥(三方 App 用户购买小鹅店铺sdk获取的秘钥 替换) 17 | public static final String SECRET_KEY = "dfomGwT7JRWWnzY3okZ6yTkHtgNPTyhr"; 18 | 19 | //下面两个接口不建议三方 App 用户直接在自己的app端进行调用,而是三方 App 用户后台写一个sdk登录的接口提供给自己的app使用, 20 | //当app请求后台的这个接口,由三方 App 用户的后台调用下面两个接口(我司的SDK登录接口),三方 App 用户的后台调用成功,把token返回给app 21 | public static final String GET_TOKEN_URL = "http://api.xiaoe-tech.com/token"; 22 | public static final String LOGIN_URL = "http://api.xiaoe-tech.com/xe.sdk.account.login/1.0.0"; 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xiaoeshopsdk/sample/net/AccessTokenEntity.java: -------------------------------------------------------------------------------- 1 | package com.xiaoeshopsdk.sample.net; 2 | 3 | public class AccessTokenEntity { 4 | 5 | private int code; 6 | private String msg; 7 | private Data data; 8 | 9 | public int getCode() { 10 | return code; 11 | } 12 | 13 | public void setCode(int code) { 14 | this.code = code; 15 | } 16 | 17 | public String getMsg() { 18 | return msg; 19 | } 20 | 21 | public void setMsg(String msg) { 22 | this.msg = msg; 23 | } 24 | 25 | public Data getData() { 26 | return data; 27 | } 28 | 29 | public void setData(Data data) { 30 | this.data = data; 31 | } 32 | 33 | public static class Data{ 34 | private String access_token; 35 | private int expires_in; 36 | 37 | public String getAccess_token() { 38 | return access_token; 39 | } 40 | 41 | public void setAccess_token(String access_token) { 42 | this.access_token = access_token; 43 | } 44 | 45 | public int getExpires_in() { 46 | return expires_in; 47 | } 48 | 49 | public void setExpires_in(int expires_in) { 50 | this.expires_in = expires_in; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | buildToolsVersion "29.0.0" 6 | defaultConfig { 7 | applicationId "com.xiaoeshopsdk.sample" 8 | minSdkVersion 15 9 | targetSdkVersion 28 10 | versionCode 5 11 | versionName "1.0.5" 12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs') 24 | implementation 'com.android.support:appcompat-v7:28.0.0' 25 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 26 | testImplementation 'junit:junit:4.12' 27 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 28 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 29 | implementation 'com.squareup.okhttp3:okhttp:4.2.2' 30 | implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2' 31 | implementation 'com.google.code.gson:gson:2.8.5' 32 | implementation 'com.xiaoe.shop:webcore:2.2.19' 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/xiaoeshopsdk/sample/IndexActivity.java: -------------------------------------------------------------------------------- 1 | package com.xiaoeshopsdk.sample; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.view.Window; 7 | import android.widget.TextView; 8 | import androidx.annotation.Nullable; 9 | import androidx.appcompat.app.AppCompatActivity; 10 | 11 | import com.xiaoe.shop.webcore.core.XiaoEWeb; 12 | 13 | public class IndexActivity extends AppCompatActivity { 14 | 15 | @Override 16 | protected void onCreate(@Nullable Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | supportRequestWindowFeature(Window.FEATURE_NO_TITLE); 19 | setContentView(R.layout.activity_index); 20 | 21 | TextView logoutTv = findViewById(R.id.user_logout_tv); 22 | logoutTv.setOnClickListener(new View.OnClickListener() { 23 | @Override 24 | public void onClick(View v) { 25 | //在三方 App 内发生用户切换或用户退出的时, 为了避免出现客户信息混乱, 请务必执行如下代码登出小鹅通用户角色. 26 | XiaoEWeb.userLogout(IndexActivity.this.getApplicationContext()); 27 | } 28 | }); 29 | 30 | TextView testShopTv = findViewById(R.id.test_shop_tv); 31 | testShopTv.setOnClickListener(new View.OnClickListener() { 32 | @Override 33 | public void onClick(View v) { 34 | startActivity(new Intent(IndexActivity.this, XeSdkDemoActivity.class)); 35 | } 36 | }); 37 | } 38 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/login_dialog_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 21 | 22 | 26 | 27 |