├── .classpath ├── .project ├── AndroidManifest.xml ├── README.md ├── ic_launcher-web.png ├── libs └── android-support-v4.jar ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── drawable-xxhdpi │ └── ic_launcher.png ├── layout │ └── activity_main.xml ├── menu │ └── main.xml ├── values-w820dp │ └── dimens.xml └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml └── src └── com ├── example └── u8sdk │ └── MainActivity.java └── u8 └── sdk ├── ComponentFactory.java ├── IActivityListener.java ├── IU8SDKListener.java ├── SDKConfigData.java ├── U8SDK.java └── component ├── pay └── U8Pay.java └── user └── U8User.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | U8SDK 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # U8SDK 2 | U8SDK——渠道接入与游戏分离 3 | -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yesunsong/U8SDK/55b33c80c56638ec4c1ffd21d94717a1b6a2f26e/ic_launcher-web.png -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yesunsong/U8SDK/55b33c80c56638ec4c1ffd21d94717a1b6a2f26e/libs/android-support-v4.jar -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-10 15 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yesunsong/U8SDK/55b33c80c56638ec4c1ffd21d94717a1b6a2f26e/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yesunsong/U8SDK/55b33c80c56638ec4c1ffd21d94717a1b6a2f26e/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yesunsong/U8SDK/55b33c80c56638ec4c1ffd21d94717a1b6a2f26e/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yesunsong/U8SDK/55b33c80c56638ec4c1ffd21d94717a1b6a2f26e/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 64dp 9 | 10 | 11 | -------------------------------------------------------------------------------- /res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | U8SDK 5 | Hello world! 6 | Settings 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/com/example/u8sdk/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.u8sdk; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.Menu; 6 | import android.view.MenuItem; 7 | 8 | public class MainActivity extends Activity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_main); 14 | } 15 | 16 | @Override 17 | public boolean onCreateOptionsMenu(Menu menu) { 18 | // Inflate the menu; this adds items to the action bar if it is present. 19 | getMenuInflater().inflate(R.menu.main, menu); 20 | return true; 21 | } 22 | 23 | @Override 24 | public boolean onOptionsItemSelected(MenuItem item) { 25 | // Handle action bar item clicks here. The action bar will 26 | // automatically handle clicks on the Home/Up button, so long 27 | // as you specify a parent activity in AndroidManifest.xml. 28 | int id = item.getItemId(); 29 | if (id == R.id.action_settings) { 30 | return true; 31 | } 32 | return super.onOptionsItemSelected(item); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/com/u8/sdk/ComponentFactory.java: -------------------------------------------------------------------------------- 1 | package com.u8.sdk; 2 | 3 | import android.app.Activity; 4 | 5 | public class ComponentFactory { 6 | private static ComponentFactory componentFactory = null; 7 | 8 | private ComponentFactory() { 9 | 10 | } 11 | 12 | public static ComponentFactory getInstance() { 13 | if (componentFactory == null) { 14 | componentFactory = new ComponentFactory(); 15 | } 16 | return componentFactory; 17 | } 18 | 19 | public void init(Activity context){ 20 | 21 | } 22 | 23 | public SDKConfigData getSDKConfigData() { 24 | return null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/com/u8/sdk/IActivityListener.java: -------------------------------------------------------------------------------- 1 | package com.u8.sdk; 2 | 3 | public interface IActivityListener { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/com/u8/sdk/IU8SDKListener.java: -------------------------------------------------------------------------------- 1 | package com.u8.sdk; 2 | 3 | public interface IU8SDKListener { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/com/u8/sdk/SDKConfigData.java: -------------------------------------------------------------------------------- 1 | package com.u8.sdk; 2 | 3 | public class SDKConfigData { 4 | 5 | public boolean contains(String string) { 6 | // TODO Auto-generated method stub 7 | return false; 8 | } 9 | 10 | public int getInt(String string) { 11 | // TODO Auto-generated method stub 12 | return 0; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/com/u8/sdk/U8SDK.java: -------------------------------------------------------------------------------- 1 | package com.u8.sdk; 2 | 3 | import android.app.Activity; 4 | import android.os.Handler; 5 | import android.os.Looper; 6 | 7 | import com.u8.sdk.component.pay.U8Pay; 8 | import com.u8.sdk.component.user.U8User; 9 | 10 | public class U8SDK { 11 | 12 | public static final int TYPE_LOGIN = 1; 13 | public static final int TYPE_PAY = 2; 14 | 15 | private static U8SDK instance = null; 16 | 17 | private Activity context; 18 | private Handler mainThreadHandler; 19 | 20 | private SDKConfigData developInfo; 21 | 22 | private IU8SDKListener listener; 23 | private IActivityListener activityCallback; 24 | 25 | private U8SDK() { 26 | mainThreadHandler = new Handler(Looper.getMainLooper()); 27 | } 28 | 29 | public static U8SDK getInstance() { 30 | if (instance == null) { 31 | instance = new U8SDK(); 32 | } 33 | return instance; 34 | } 35 | 36 | public void init(Activity context) { 37 | this.context = context; 38 | ComponentFactory.getInstance().init(context); 39 | developInfo = ComponentFactory.getInstance().getSDKConfigData(); 40 | 41 | U8User.getInstance().init(); 42 | U8Pay.getInstance().init(); 43 | } 44 | 45 | public void runOnMainThread(Runnable runnable) { 46 | if (mainThreadHandler != null) { 47 | mainThreadHandler.post(runnable); 48 | return; 49 | } 50 | if (context != null) { 51 | context.runOnUiThread(runnable); 52 | } 53 | } 54 | 55 | public Activity getContext() { 56 | return context; 57 | } 58 | 59 | public SDKConfigData getSDKParams() { 60 | return developInfo; 61 | } 62 | 63 | public int getCurrChannel() { 64 | if (this.developInfo == null 65 | || !this.developInfo.contains("U8_Channel")) { 66 | return -1; 67 | } 68 | return this.developInfo.getInt("U8_Channel"); 69 | } 70 | 71 | public void setSDKListener(IU8SDKListener listener) { 72 | this.listener = listener; 73 | } 74 | 75 | public void setActivityCallback(IActivityListener callback) { 76 | this.activityCallback = callback; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/com/u8/sdk/component/pay/U8Pay.java: -------------------------------------------------------------------------------- 1 | package com.u8.sdk.component.pay; 2 | 3 | public class U8Pay { 4 | private static U8Pay u8Pay = null; 5 | 6 | private U8Pay() { 7 | } 8 | 9 | public static U8Pay getInstance() { 10 | if (u8Pay == null) { 11 | u8Pay = new U8Pay(); 12 | } 13 | return u8Pay; 14 | } 15 | 16 | public void init() { 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/com/u8/sdk/component/user/U8User.java: -------------------------------------------------------------------------------- 1 | package com.u8.sdk.component.user; 2 | 3 | public class U8User { 4 | private static U8User u8User = null; 5 | 6 | private U8User() { 7 | } 8 | 9 | public static U8User getInstance() { 10 | if (u8User == null) { 11 | u8User = new U8User(); 12 | } 13 | return u8User; 14 | } 15 | 16 | public void init() { 17 | 18 | } 19 | } 20 | --------------------------------------------------------------------------------