Commit 126455baa544948a2e2dba45a2fa377d56f623d6
1 parent
83715f60d7
Exists in
master
add plat of param
Showing 12 changed files with 1 additions and 1 deletions Inline Diff
- InlandSDKDemo/src/com/gump/inland/sdk/demo/MainActivity.java
- InlandSDKRelease/assets/data.bin
- InlandSDKRelease/libs/UPPayAssistEx.jar
- InlandSDKRelease/libs/UPPayPluginExStd.jar
- InlandSDKRelease/libs/alipaySDK-20150818.jar
- InlandSDKRelease/libs/android-support-v4.jar
- InlandSDKRelease/libs/arm64-v8a/libentryexstd.so
- InlandSDKRelease/libs/armeabi-v7a/libentryexstd.so
- InlandSDKRelease/libs/armeabi/libentryexstd.so
- InlandSDKRelease/libs/libammsdk.jar
- InlandSDKRelease/libs/mips/libentryexstd.so
- InlandSDKRelease/libs/x86/libentryexstd.so
InlandSDKDemo/src/com/gump/inland/sdk/demo/MainActivity.java
1 | package com.gump.inland.sdk.demo; | 1 | package com.gump.inland.sdk.demo; |
2 | 2 | ||
3 | import android.app.Activity; | 3 | import android.app.Activity; |
4 | import android.content.Intent; | 4 | import android.content.Intent; |
5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
6 | import android.util.Log; | 6 | import android.util.Log; |
7 | import android.view.View; | 7 | import android.view.View; |
8 | import android.widget.Button; | 8 | import android.widget.Button; |
9 | import android.widget.TextView; | 9 | import android.widget.TextView; |
10 | 10 | ||
11 | import com.gump.inland.gamesdk.InlandSDK; | 11 | import com.gump.inland.gamesdk.InlandSDK; |
12 | import com.gump.inland.gamesdk.InlandSDKCallback; | 12 | import com.gump.inland.gamesdk.InlandSDKCallback; |
13 | import com.gump.inland.gamesdk.InlandSDKException; | 13 | import com.gump.inland.gamesdk.InlandSDKException; |
14 | import com.gump.inland.gamesdk.bean.GumpUser; | 14 | import com.gump.inland.gamesdk.bean.GumpUser; |
15 | import com.gump.inland.gamesdk.bean.PayRequest; | 15 | import com.gump.inland.gamesdk.bean.PayRequest; |
16 | import com.gump.inland.gamesdk.callback.PurchaseCallback; | 16 | import com.gump.inland.gamesdk.callback.PurchaseCallback; |
17 | import com.gump.inland.gamesdk.passport.Passport; | 17 | import com.gump.inland.gamesdk.passport.Passport; |
18 | import com.gump.inland.gamesdk.utils.Logger; | 18 | import com.gump.inland.gamesdk.utils.Logger; |
19 | import com.ninjaonline.R; | 19 | import com.ninjaonline.R; |
20 | 20 | ||
21 | public class MainActivity extends Activity { | 21 | public class MainActivity extends Activity { |
22 | 22 | ||
23 | private static final String TAG = "MainActivity"; | 23 | private static final String TAG = "MainActivity"; |
24 | private TextView tvSDKInfo; | 24 | private TextView tvSDKInfo; |
25 | private TextView tvUserInfo; | 25 | private TextView tvUserInfo; |
26 | private TextView tvPurchaseResult; | 26 | private TextView tvPurchaseResult; |
27 | private Button btnLogin; | 27 | private Button btnLogin; |
28 | private Button btnPay; | 28 | private Button btnPay; |
29 | 29 | ||
30 | @Override | 30 | @Override |
31 | protected void onCreate(Bundle savedInstanceState) { | 31 | protected void onCreate(Bundle savedInstanceState) { |
32 | super.onCreate(savedInstanceState); | 32 | super.onCreate(savedInstanceState); |
33 | setContentView(R.layout.activity_main); | 33 | setContentView(R.layout.activity_main); |
34 | tvSDKInfo = (TextView) findViewById(R.id.sdk_info); | 34 | tvSDKInfo = (TextView) findViewById(R.id.sdk_info); |
35 | tvUserInfo = (TextView) findViewById(R.id.user_info); | 35 | tvUserInfo = (TextView) findViewById(R.id.user_info); |
36 | tvPurchaseResult = (TextView) findViewById(R.id.purchase_result); | 36 | tvPurchaseResult = (TextView) findViewById(R.id.purchase_result); |
37 | btnLogin = (Button) findViewById(R.id.login); | 37 | btnLogin = (Button) findViewById(R.id.login); |
38 | btnPay = (Button) findViewById(R.id.purchase); | 38 | btnPay = (Button) findViewById(R.id.purchase); |
39 | 39 | ||
40 | Log.d(TAG, "MainActivity onCreate"); | 40 | Log.d(TAG, "MainActivity onCreate"); |
41 | InlandSDK.setIsDebugEnable(true); | 41 | InlandSDK.setIsDebugEnable(true); |
42 | InlandSDK.setScreenLandscape(false); | 42 | InlandSDK.setScreenLandscape(false); |
43 | InlandSDK.initializeSDK("10000", "dkfjgljdlgjldjgl"); | 43 | InlandSDK.initializeSDK("10000", "dkfjgljdlgjldjgl","1001"); |
44 | Passport.getInstance().registerCallback(new InlandSDKCallback<GumpUser>() { | 44 | Passport.getInstance().registerCallback(new InlandSDKCallback<GumpUser>() { |
45 | 45 | ||
46 | @Override | 46 | @Override |
47 | public void onSuccess(GumpUser result) { | 47 | public void onSuccess(GumpUser result) { |
48 | Logger.d(TAG, "gumpUser:" + result.toString()); | 48 | Logger.d(TAG, "gumpUser:" + result.toString()); |
49 | btnLogin.setVisibility(View.GONE); | 49 | btnLogin.setVisibility(View.GONE); |
50 | tvUserInfo.setText(formatUserInfo(result)); | 50 | tvUserInfo.setText(formatUserInfo(result)); |
51 | btnPay.setVisibility(View.VISIBLE); | 51 | btnPay.setVisibility(View.VISIBLE); |
52 | } | 52 | } |
53 | 53 | ||
54 | @Override | 54 | @Override |
55 | public void onError(InlandSDKException error) { | 55 | public void onError(InlandSDKException error) { |
56 | Logger.d(TAG, "login error:" + error.getMessage()); | 56 | Logger.d(TAG, "login error:" + error.getMessage()); |
57 | } | 57 | } |
58 | 58 | ||
59 | @Override | 59 | @Override |
60 | public void onCancel() { | 60 | public void onCancel() { |
61 | Logger.d(TAG, "login be canceled"); | 61 | Logger.d(TAG, "login be canceled"); |
62 | } | 62 | } |
63 | }); | 63 | }); |
64 | 64 | ||
65 | tvSDKInfo.setText(getSDKInfo()); | 65 | tvSDKInfo.setText(getSDKInfo()); |
66 | btnLogin.setOnClickListener(new View.OnClickListener() { | 66 | btnLogin.setOnClickListener(new View.OnClickListener() { |
67 | 67 | ||
68 | @Override | 68 | @Override |
69 | public void onClick(View v) { | 69 | public void onClick(View v) { |
70 | Passport.getInstance().login(MainActivity.this); | 70 | Passport.getInstance().login(MainActivity.this); |
71 | } | 71 | } |
72 | }); | 72 | }); |
73 | btnPay.setOnClickListener(new View.OnClickListener() { | 73 | btnPay.setOnClickListener(new View.OnClickListener() { |
74 | 74 | ||
75 | @Override | 75 | @Override |
76 | public void onClick(View v) { | 76 | public void onClick(View v) { |
77 | PayRequest payRequest = new PayRequest(); | 77 | PayRequest payRequest = new PayRequest(); |
78 | payRequest.setPrice(1); | 78 | payRequest.setPrice(1); |
79 | payRequest.setProduct("玄冥剑"); | 79 | payRequest.setProduct("玄冥剑"); |
80 | payRequest.setExtOrder("p100201508311730"); | 80 | payRequest.setExtOrder("p100201508311730"); |
81 | payRequest.setGumpUid(Passport.getInstance().getGumpUser().getUid()); | 81 | payRequest.setGumpUid(Passport.getInstance().getGumpUser().getUid()); |
82 | InlandSDK.purchase(MainActivity.this, payRequest, new PurchaseCallback() { | 82 | InlandSDK.purchase(MainActivity.this, payRequest, new PurchaseCallback() { |
83 | 83 | ||
84 | @Override | 84 | @Override |
85 | public void onPurchaseError(Exception e) { | 85 | public void onPurchaseError(Exception e) { |
86 | Logger.w(TAG, "purchase error:" + e.getMessage()); | 86 | Logger.w(TAG, "purchase error:" + e.getMessage()); |
87 | tvPurchaseResult.setText("purchase occured an error:" + e.getMessage()); | 87 | tvPurchaseResult.setText("purchase occured an error:" + e.getMessage()); |
88 | } | 88 | } |
89 | 89 | ||
90 | @Override | 90 | @Override |
91 | public void onPurchaseSuccess(String gumpTransId, String extOrder) { | 91 | public void onPurchaseSuccess(String gumpTransId, String extOrder) { |
92 | Logger.d(TAG, "purchase success:" + gumpTransId + ",extorder:" + extOrder); | 92 | Logger.d(TAG, "purchase success:" + gumpTransId + ",extorder:" + extOrder); |
93 | tvPurchaseResult.setText("purchase " + gumpTransId + " success,extorder:" + extOrder); | 93 | tvPurchaseResult.setText("purchase " + gumpTransId + " success,extorder:" + extOrder); |
94 | } | 94 | } |
95 | 95 | ||
96 | @Override | 96 | @Override |
97 | public void onPurchaseCanceled() { | 97 | public void onPurchaseCanceled() { |
98 | Logger.d(TAG, "purchase be canceled"); | 98 | Logger.d(TAG, "purchase be canceled"); |
99 | tvPurchaseResult.setText("purchase be canceled"); | 99 | tvPurchaseResult.setText("purchase be canceled"); |
100 | } | 100 | } |
101 | }); | 101 | }); |
102 | } | 102 | } |
103 | }); | 103 | }); |
104 | } | 104 | } |
105 | 105 | ||
106 | @Override | 106 | @Override |
107 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { | 107 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { |
108 | if (!InlandSDK.onActivityResult(requestCode, resultCode, data)) | 108 | if (!InlandSDK.onActivityResult(requestCode, resultCode, data)) |
109 | super.onActivityResult(requestCode, resultCode, data); | 109 | super.onActivityResult(requestCode, resultCode, data); |
110 | } | 110 | } |
111 | 111 | ||
112 | private String getSDKInfo() { | 112 | private String getSDKInfo() { |
113 | StringBuilder str = new StringBuilder(); | 113 | StringBuilder str = new StringBuilder(); |
114 | str.append("SDK version:"); | 114 | str.append("SDK version:"); |
115 | str.append(InlandSDK.getVersion()); | 115 | str.append(InlandSDK.getVersion()); |
116 | str.append("\nappId:"); | 116 | str.append("\nappId:"); |
117 | str.append(InlandSDK.getAppId()); | 117 | str.append(InlandSDK.getAppId()); |
118 | str.append("\nappKey:"); | 118 | str.append("\nappKey:"); |
119 | str.append(InlandSDK.getAppKey()); | 119 | str.append(InlandSDK.getAppKey()); |
120 | return str.toString(); | 120 | return str.toString(); |
121 | } | 121 | } |
122 | 122 | ||
123 | private String formatUserInfo(GumpUser user) { | 123 | private String formatUserInfo(GumpUser user) { |
124 | StringBuilder str = new StringBuilder(); | 124 | StringBuilder str = new StringBuilder(); |
125 | str.append("Logined User information:\n"); | 125 | str.append("Logined User information:\n"); |
126 | str.append("userId:" + user.getUid()); | 126 | str.append("userId:" + user.getUid()); |
127 | str.append("\nacccountType:" + user.getAccountType()); | 127 | str.append("\nacccountType:" + user.getAccountType()); |
128 | str.append("\nsessionKey:" + user.getSessionKey()); | 128 | str.append("\nsessionKey:" + user.getSessionKey()); |
129 | return str.toString(); | 129 | return str.toString(); |
130 | } | 130 | } |
131 | } | 131 | } |
132 | 132 |
InlandSDKRelease/assets/data.bin
No preview for this file type
InlandSDKRelease/libs/UPPayAssistEx.jar
No preview for this file type
InlandSDKRelease/libs/UPPayPluginExStd.jar
No preview for this file type
InlandSDKRelease/libs/alipaySDK-20150818.jar
No preview for this file type
InlandSDKRelease/libs/android-support-v4.jar
No preview for this file type
InlandSDKRelease/libs/arm64-v8a/libentryexstd.so
No preview for this file type
InlandSDKRelease/libs/armeabi-v7a/libentryexstd.so
No preview for this file type
InlandSDKRelease/libs/armeabi/libentryexstd.so
No preview for this file type
InlandSDKRelease/libs/libammsdk.jar
No preview for this file type
InlandSDKRelease/libs/mips/libentryexstd.so
No preview for this file type
InlandSDKRelease/libs/x86/libentryexstd.so
No preview for this file type