DevStore首页 > DEV资源 > 服务评测下载 > 畅游Android版服务评测

畅游Android版服务评测

查看服务>>
DevStore编辑 尚丽洁 | 2014-08-18 11:00    浏览量(7288)    纠错    评论(1)    畅游服务详情>>

服务评测作者

  • 24 能力值
  • 4 源码
  • 8 评测
  • 0 资料

评测目录

集成测试

评测环境

2G/3G/WIFI环境下:

测试对象

畅游SDK

是否免费

免费

支持系统

Android、IOS

测试系统

Android

测试手机

华为荣耀3C

系统版本

4.2.2

手机网络

2G/3G/WIFI

测试方法

建立测试项目进行功能性测试

测试时长

3小时

测试难度

一般

基本参数:

登录游戏

支持

游客登录

不支持

游戏社区

不支持

商品购买

支持

显示悬浮框

支持

隐藏悬浮框

不支持

退出SDK

支持

暂停页

不支持

设置横竖屏

支持

防沉迷查询

不支持

获取充值记录

支持

客服反馈

支持

获取商品列表

支持

切换帐号

支持

集成过程

客户端集成

开发者需要到畅游开放平台下载开发文档和SDK:笔者这里下载的是Android

http://open.cy.com/document/doccenter_download.html

畅游


畅游

下载下来会有两个压缩包,一个是畅游的SDK,一个是开发文档:

畅游

解压缩:

Android SDK有以下文件:

畅游

开发文档有以下文件:

畅游

集成SDK,需要把项目关联的库导入到Eclipse中:

畅游

在目标项目引入其中的两个关联项目:

畅游

配置AndroidManifest.xml

-添加权限:

<uses-permissionandroid:name="android.permission.INTERNET"/>
    <uses-permissionandroid:name="android.permission.CALL_PHONE"/>
    <uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permissionandroid:name="android.permission.READ_PHONE_STATE"/>
    <uses-permissionandroid:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permissionandroid:name="android.permission.SEND_SMS"/>
    <uses-permissionandroid:name="android.permission.READ_SMS"/>
    <uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permissionandroid:name="com.ut.permission.DEVICE_STATE"/>
    <uses-permissionandroid:name="android.permission.WRITE_SETTINGS"/>
    <uses-permissionandroid:name="android.permission.READ_SETTINGS"/>
    <permissionandroid:name="com.ut.permission.DEVICE_STATE"/>
    <uses-permissionandroid:name="android.permission.CHANGE_CONFIGURATION"/>
<uses-permissionandroid:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permissionandroid:name="android.permission.GET_TASKS"/>
<uses-permissionandroid:name="android.permission.READ_LOGS"/>
<uses-permissionandroid:name="com.alipay.mobile.command.trigger.permission"/>

-需要配置的信息

<!--以下为需配置信息 -->
<activity
android:name="com.changyou.mgp.sdk.mbi.account.ui.CYMGLoginActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
</activity>
<activity
android:name="com.changyou.mgp.sdk.mbi.cts.ui.CYMGCustomerServiceActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateUnspecified">
<intent-filter>
<actionandroid:name="com.changyou.mgp.sdk.mbi.cts.ui.CYMGCustomerServiceActivity"/>
 
<categoryandroid:name="android.intent.category.DEFAULT"/>
</intent-filter>
       </activity>
       
 
<!--微信支付结果的监听-->
<activity
android:name="com.changyou.mgp.sdk.mbi.wxapi.WXPayEntryActivity"
android:exported="true"
android:theme="@android:style/Theme.Dialog"
android:launchMode="singleTop"/>
 
       <!--支付宝配置 -->
       <activity
android:name="com.alipay.android.mini.window.sdk.MiniLaucherActivity"
android:configChanges="orientation"
android:excludeFromRecents="true"
android:launchMode="singleTop"
android:theme="@style/MspAppTheme"/>
<activity
android:name="com.alipay.android.mini.window.sdk.TransContainer"
android:configChanges="orientation"
android:excludeFromRecents="true"
android:launchMode="singleTop"
android:theme="@style/MspAppTheme"/>
<!--极简收银台主界面 -->
<activity
android:name="com.alipay.android.mini.window.sdk.MiniPayActivity"
android:configChanges="orientation"
android:excludeFromRecents="true"
android:label="@string/msp_app_name"
android:launchMode="singleTop"
android:theme="@style/MspAppTheme"
android:windowSoftInputMode="adjustResize">
<intent-filterandroid:priority="800">
<actionandroid:name="android.intent.action.MAIN"/>
 
<categoryandroid:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<!--极简收银台链接查看界面 -->
<activity
android:name="com.alipay.android.mini.window.sdk.MiniWebActivity"
android:configChanges="orientation|keyboardHidden|navigation"
android:excludeFromRecents="true"
android:launchMode="singleTop"
android:theme="@style/MspAppTheme">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN"/>
 
<categoryandroid:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<!--快捷支付服务 -->
<serviceandroid:name="com.alipay.android.app.MspService"/>
<!-- UTDID -->
<receiver
android:name="com.ut.device.BQueryWhoHasOne"
android:exported="true"
android:permission="com.ut.permission.DEVICE_STATE">
<intent-filter>
<actionandroid:name="UT.QueryWhoHasOne"/>
</intent-filter>
</receiver>
<receiver
android:name="com.ut.device.BFoundIt"
android:exported="true"
android:permission="com.ut.permission.DEVICE_STATE">
<intent-filter>
<actionandroid:name="UT.FoundIT"/>
</intent-filter>
</receiver>
       
       <!--支付宝配置END -->
       
       <receiver
       android:name="com.ut.device.BFoundIt"
       android:exported="true"
       android:permission="com.ut.permission.DEVICE_STATE">
       <intent-filter>
       <actionandroid:name="UT.FoundIT"/>
           </intent-filter>
       </receiver>
       <activity
           android:name="com.tencent.connect.common.AssistActivity"
           android:screenOrientation="portrait"
           android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
       <activity
           android:name="com.tencent.tauth.AuthActivity"
           android:launchMode="singleTask"
           android:noHistory="true">
           <intent-filter>
                  <actionandroid:name="android.intent.action.VIEW"/>
           <categoryandroid:name="android.intent.category.DEFAULT"/>
           <categoryandroid:name="android.intent.category.BROWSABLE"/>
           <dataandroid:scheme="tencent101005256"/>
           </intent-filter>
       </activity>
<activity
android:name="com.changyou.mgp.sdk.mbi.account.ui.CYMGRegistActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="adjustPan">
</activity>
<activity
android:name="com.changyou.mgp.sdk.mbi.pay.ui.CYMGPaymentActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
> 
<intent-filter>
<actionandroid:name="com.changyou.mgp.sdk.mbi.pay.ui.CYMGPaymentActivity"/>
 
<categoryandroid:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
 
<receiver
android:name="com.ut.device.BQueryWhoHasOne"
android:exported="true"
android:permission="com.ut.permission.DEVICE_STATE">
<intent-filter>
<actionandroid:name="UT.QueryWhoHasOne"/>
</intent-filter>
</receiver>
<receiver
android:name="com.ut.device.BFoundIt"
android:exported="true"
android:permission="com.ut.permission.DEVICE_STATE">
<intent-filter>
<actionandroid:name="UT.FoundIT"/>
</intent-filter>
</receiver>
 
 
 
<!--银联所需-->
<activity
android:name="com.unionpay.uppay.PayActivityEx"
android:configChanges="orientation|keyboardHidden|screenSize"
android:excludeFromRecents="true"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
</activity>
<activityandroid:name="com.unionpay.uppay.PayActivity">
<!--银联所需 END-->
</activity>
<!-- MO9所需-->
<activity
android:name="com.mokredit.payment.MktPayment"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="sensor"
android:windowSoftInputMode="adjustResize">
</activity>
<!-- MO9所需 END-->
<service
android:name="com.changyou.mgp.sdk.mbi.mbi.service.MBIService"
android:exported="false">
</service>
 
       <!--添加MGPSDK可选的meta-data:CYMGP_QQ_APP_ID.此处value为qq_app_id,请在QQ开放平台http://open.qq.com/注册申请。配置该值后在登录页面会开放QQ账号登录入口-->
       <meta-data
       android:name="CYMG_QQ_APP_ID"
       android:value="101005256"/>
       <!--添加MGPSDK可选的meta-data:CYMGP_QQ_APP_ID.此处value为sina_app_id,请在新浪微博开放平台http://open.weibo.com/注册申请。sina_app_key和sina_app_secret同时配置后会在登录页面会开放新浪微博账号登录入口-->
       <meta-data
       android:name="CYMG_SINA_APP_KEY"
       android:value="1995092283"/>
       <!--添加MGPSDK可选的meta-data:CYMGP_QQ_APP_ID.此处value为sina_app_secret,请在新浪微博开放平台http://open.weibo.com/注册申请。sina_app_key和sina_app_secret同时配置后会在登录页面会开放新浪微博账号登录入口-->
       <meta-data
       android:name="CYMG_SINA_APP_SECRET"
       android:value="3fd7c8ff8a81ede5ded36a9916526497"/>
       <!--添加MGPSDK必需的meta-data:CYMG_APP_KEY.此处value为app_key。请在畅游游戏开放平台http://t.changyou.com注册申请 -->
       <meta-data
       android:name="CYMG_APP_KEY"
       android:value="@string/app_key"/>
       <!--添加MGPSDK必需的meta-data:CY_MGP_APP_SECRET.此处value为app_secret。请在畅游游戏开放平台http://t.changyou.com注册申请 -->
       <meta-data
       android:name="CYMG_APP_SECRET"
       android:value="5ae88850e3af41fab5c3e4419fbb15be"/>
       <!--添加MGPSDK必需的meta-data: CY_MGP_CHANNEL_ID.此处value为channel_id。该值决定MGPSDK接入的渠道,详情请查阅《ChannelID对照表》-->
       <meta-data
       android:name="CYMG_CHANNEL_ID"
       android:value="4001"/>
       <meta-data
       android:name="CMBI_APP_KEY"
       android:value="@string/app_key"/>
       <meta-data
       android:name="CMBI_CHANNEL_ID"
       android:value="@string/cmbi_channel_id"/>
 
 
<!--微信支付 -->
 
<meta-data android:name="APP_ID_WEIXIN"android:value="wxcdcd2f547842c4e5"/>
<meta-data android:name="APP_KEY_WEIXIN"android:value="YicMRZTqxGKvwmGpo9PkYv0rbUeR01kkDcJRphZh6z9cZM2ec4m5puhNHash4UcjuX4VOm3eXLRTnGyR2proUmFAVcmdw7GKMYnPsVOW4nHM8Od5mQx1USRHuhXtj9Q8"/>
<meta-data android:name="SECRET_WEIXIN"android:value="5fccfcb3834cf7524b8d82d3e1158ab9"/>
<!--以上为需配置信息 -->

主要功能

登录功能

畅游提供了一键注册还有第三方登录的方式登录游戏,玩家可以不需要注册畅游帐号就可以直接使用新浪微博帐号和腾讯帐号进行登录。

畅游

畅游

注销功能

畅游提供SDK注销功能,玩家可以退出游戏的登录。

畅游

支付

畅游提供了比较炫的充值界面,玩家可以选择指定金额来完成充值。

畅游

充值记录

畅游为玩家提供充值记录查询,玩家可以清楚得查看自己的充值信息。

畅游

功能特色

畅游具有以下几项功能特色:

在线客服

玩家可以实时对游戏进行反馈,畅游通过在线客服来为玩家提供更加方便的服务。

畅游

支付方式

畅游为玩家提供了便捷的支付方式,比如支付宝、微信支付等等。

畅游

DEMO展示

配置AndroidManifest.xml文件

<?xmlversion="1.0"encoding="utf-8"?>
<manifestxmlns:android="http://schemas.android.com/apk/res/android"
package="com.changyou.mgp.sdk.mbi"
android:versionCode="108017"
android:versionName="1.08.017">
 
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17"/>
 
<application
android:name="com.changyou.mgp.sdk.mbi.test.SDKApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity
android:name="com.changyou.mgp.sdk.mbi.test.activity.SDKScreenChoiceActivity"android:label="@string/app_name">
</activity>
<activity
android:name="com.changyou.mgp.sdk.mbi.test.activity.SDKLauncherActivity" 
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN"/>
 
<categoryandroid:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="com.changyou.mgp.sdk.mbi.test.activity.SDKMainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"/>
 
 
 
 
<!--以下为需配置信息 -->
<activity
android:name="com.changyou.mgp.sdk.mbi.account.ui.CYMGLoginActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
</activity>
<activity
android:name="com.changyou.mgp.sdk.mbi.cts.ui.CYMGCustomerServiceActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateUnspecified">
<intent-filter>
<actionandroid:name="com.changyou.mgp.sdk.mbi.cts.ui.CYMGCustomerServiceActivity"/>
 
<categoryandroid:name="android.intent.category.DEFAULT"/>
</intent-filter>
        </activity>
        
 
<!--微信支付结果的监听-->
<activity
android:name="com.changyou.mgp.sdk.mbi.wxapi.WXPayEntryActivity"
android:exported="true"
android:theme="@android:style/Theme.Dialog"
android:launchMode="singleTop"/>
 
        <!--支付宝配置 -->
        <activity
android:name="com.alipay.android.mini.window.sdk.MiniLaucherActivity"
android:configChanges="orientation"
android:excludeFromRecents="true"
android:launchMode="singleTop"
android:theme="@style/MspAppTheme"/>
<activity
android:name="com.alipay.android.mini.window.sdk.TransContainer"
android:configChanges="orientation"
android:excludeFromRecents="true"
android:launchMode="singleTop"
android:theme="@style/MspAppTheme"/>
<!--极简收银台主界面 -->
<activity
android:name="com.alipay.android.mini.window.sdk.MiniPayActivity"
android:configChanges="orientation"
android:excludeFromRecents="true"
android:label="@string/msp_app_name"
android:launchMode="singleTop"
android:theme="@style/MspAppTheme"
android:windowSoftInputMode="adjustResize">
<intent-filterandroid:priority="800">
<actionandroid:name="android.intent.action.MAIN"/>
 
<categoryandroid:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<!--极简收银台链接查看界面 -->
<activity
android:name="com.alipay.android.mini.window.sdk.MiniWebActivity"
android:configChanges="orientation|keyboardHidden|navigation"
android:excludeFromRecents="true"
android:launchMode="singleTop"
android:theme="@style/MspAppTheme">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN"/>
 
<categoryandroid:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<!--快捷支付服务 -->
<serviceandroid:name="com.alipay.android.app.MspService"/>
<!-- UTDID -->
<receiver
android:name="com.ut.device.BQueryWhoHasOne"
android:exported="true"
android:permission="com.ut.permission.DEVICE_STATE">
<intent-filter>
<actionandroid:name="UT.QueryWhoHasOne"/>
</intent-filter>
</receiver>
<receiver
android:name="com.ut.device.BFoundIt"
android:exported="true"
android:permission="com.ut.permission.DEVICE_STATE">
<intent-filter>
<actionandroid:name="UT.FoundIT"/>
</intent-filter>
</receiver>
        
        <!--支付宝配置END -->
        
        <receiver
        android:name="com.ut.device.BFoundIt"
        android:exported="true"
        android:permission="com.ut.permission.DEVICE_STATE">
        <intent-filter>
        <actionandroid:name="UT.FoundIT"/>
            </intent-filter>
        </receiver>
        <activity
            android:name="com.tencent.connect.common.AssistActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
        <activity
            android:name="com.tencent.tauth.AuthActivity"
            android:launchMode="singleTask"
            android:noHistory="true">
            <intent-filter>
                    <actionandroid:name="android.intent.action.VIEW"/>
            <categoryandroid:name="android.intent.category.DEFAULT"/>
            <categoryandroid:name="android.intent.category.BROWSABLE"/>
            <dataandroid:scheme="tencent101005256"/>
            </intent-filter>
        </activity>
<activity
android:name="com.changyou.mgp.sdk.mbi.account.ui.CYMGRegistActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="adjustPan">
</activity>
<activity
android:name="com.changyou.mgp.sdk.mbi.pay.ui.CYMGPaymentActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
> 
<intent-filter>
<actionandroid:name="com.changyou.mgp.sdk.mbi.pay.ui.CYMGPaymentActivity"/>
 
<categoryandroid:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
 
<receiver
android:name="com.ut.device.BQueryWhoHasOne"
android:exported="true"
android:permission="com.ut.permission.DEVICE_STATE">
<intent-filter>
<actionandroid:name="UT.QueryWhoHasOne"/>
</intent-filter>
</receiver>
<receiver
android:name="com.ut.device.BFoundIt"
android:exported="true"
android:permission="com.ut.permission.DEVICE_STATE">
<intent-filter>
<actionandroid:name="UT.FoundIT"/>
</intent-filter>
</receiver>
 
 
 
<!--银联所需-->
<activity
android:name="com.unionpay.uppay.PayActivityEx"
android:configChanges="orientation|keyboardHidden|screenSize"
android:excludeFromRecents="true"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
</activity>
<activityandroid:name="com.unionpay.uppay.PayActivity">
<!--银联所需 END-->
</activity>
<!-- MO9所需-->
<activity
android:name="com.mokredit.payment.MktPayment"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="sensor"
android:windowSoftInputMode="adjustResize">
</activity>
<!-- MO9所需 END-->
<service
android:name="com.changyou.mgp.sdk.mbi.mbi.service.MBIService"
android:exported="false">
</service>
 
        <!--添加MGPSDK可选的meta-data:CYMGP_QQ_APP_ID.此处value为qq_app_id,请在QQ开放平台http://open.qq.com/注册申请。配置该值后在登录页面会开放QQ账号登录入口-->
        <meta-data
        android:name="CYMG_QQ_APP_ID"
        android:value="101005256"/>
        <!--添加MGPSDK可选的meta-data:CYMGP_QQ_APP_ID.此处value为sina_app_id,请在新浪微博开放平台http://open.weibo.com/注册申请。sina_app_key和sina_app_secret同时配置后会在登录页面会开放新浪微博账号登录入口-->
        <meta-data
        android:name="CYMG_SINA_APP_KEY"
        android:value="1995092283"/>
        <!--添加MGPSDK可选的meta-data:CYMGP_QQ_APP_ID.此处value为sina_app_secret,请在新浪微博开放平台http://open.weibo.com/注册申请。sina_app_key和sina_app_secret同时配置后会在登录页面会开放新浪微博账号登录入口-->
        <meta-data
        android:name="CYMG_SINA_APP_SECRET"
        android:value="3fd7c8ff8a81ede5ded36a9916526497"/>
        <!--添加MGPSDK必需的meta-data:CYMG_APP_KEY.此处value为app_key。请在畅游游戏开放平台http://t.changyou.com注册申请 -->
        <meta-data
        android:name="CYMG_APP_KEY"
        android:value="@string/app_key"/>
        <!--添加MGPSDK必需的meta-data:CY_MGP_APP_SECRET.此处value为app_secret。请在畅游游戏开放平台http://t.changyou.com注册申请 -->
        <meta-data
        android:name="CYMG_APP_SECRET"
        android:value="5ae88850e3af41fab5c3e4419fbb15be"/>
        <!--添加MGPSDK必需的meta-data: CY_MGP_CHANNEL_ID.此处value为channel_id。该值决定MGPSDK接入的渠道,详情请查阅《ChannelID对照表》-->
        <meta-data
        android:name="CYMG_CHANNEL_ID"
        android:value="4001"/>
        <meta-data
        android:name="CMBI_APP_KEY"
        android:value="@string/app_key"/>
        <meta-data
        android:name="CMBI_CHANNEL_ID"
        android:value="@string/cmbi_channel_id"/>
 
 
<!--微信支付 -->
 
<meta-data  android:name="APP_ID_WEIXIN"android:value="wxcdcd2f547842c4e5"/>
<meta-data android:name="APP_KEY_WEIXIN"android:value="YicMRZTqxGKvwmGpo9PkYv0rbUeR01kkDcJRphZh6z9cZM2ec4m5puhNHash4UcjuX4VOm3eXLRTnGyR2proUmFAVcmdw7GKMYnPsVOW4nHM8Od5mQx1USRHuhXtj9Q8"/>
<meta-data  android:name="SECRET_WEIXIN"android:value="5fccfcb3834cf7524b8d82d3e1158ab9"/>
<!--以上为需配置信息 -->
 
 
</application>
 
<uses-permissionandroid:name="android.permission.INTERNET"/>
    <uses-permissionandroid:name="android.permission.CALL_PHONE"/>
    <uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permissionandroid:name="android.permission.READ_PHONE_STATE"/>
    <uses-permissionandroid:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permissionandroid:name="android.permission.SEND_SMS"/>
    <uses-permissionandroid:name="android.permission.READ_SMS"/>
    <uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permissionandroid:name="com.ut.permission.DEVICE_STATE"/>
    <uses-permissionandroid:name="android.permission.WRITE_SETTINGS"/>
    <uses-permissionandroid:name="android.permission.READ_SETTINGS"/>
    <permissionandroid:name="com.ut.permission.DEVICE_STATE"/>
    <uses-permissionandroid:name="android.permission.CHANGE_CONFIGURATION"/>
<uses-permissionandroid:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permissionandroid:name="android.permission.GET_TASKS"/>
<uses-permissionandroid:name="android.permission.READ_LOGS"/>
<uses-permissionandroid:name="com.alipay.mobile.command.trigger.permission"/>
 
 
</manifest>

打开:

畅游

package com.changyou.mgp.sdk.mbi.test.activity;
 
import org.json.JSONException;
import org.json.JSONObject;
 
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;
 
import com.changyou.mgp.sdk.mbi.R;
import com.changyou.mgp.sdk.mbi.common.CYMGCallback;
import com.changyou.mgp.sdk.mbi.config.CYMGPrompt;
import com.changyou.mgp.sdk.mbi.config.CYMGProtocolConfig;
import com.changyou.mgp.sdk.mbi.config.CYMGProtocolKeys;
import com.changyou.mgp.sdk.mbi.http.MyAsyncResponseHandler;
import com.changyou.mgp.sdk.mbi.mbi.manager.MBILogManager;
import com.changyou.mgp.sdk.mbi.platform.CYMGPlatform;
import com.changyou.mgp.sdk.mbi.platform.CYMGPlatformConfiguration;
import com.changyou.mgp.sdk.mbi.test.Config;
import com.changyou.mgp.sdk.mbi.test.Contants;
import com.changyou.mgp.sdk.mbi.test.SDKApplication;
import com.changyou.mgp.sdk.mbi.utils.UserInfoSPUtil;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.RequestParams;
 
public class SDKMainActivity extends Activity implements OnClickListener{
 
       private static final int VERIFY_SUCCESS = 1;
      
       private Button mLoginBtn;
       private Button mLoginOutBtn;
       private Button mPayBtn;
       private Button mChargeRecorderBtn;
       private Button mCustomerServiceBtn;
       private Button mPayMethodBtn;
       private Button mGetGoodsListBtn;
       private LinearLayout mFunTL;
       private Button mMBIGameeventBtn;
       private ProgressDialog mDialog;
      
       private String mUID;
      
       @Override
       protected void onCreate(Bundle savedInstanceState) {
              Log.d(SDKApplication.TAG, "onCreate");
              super.onCreate(savedInstanceState);
              setContentView(R.layout.sdk_main);
              setRequestedOrientation(getSharedPreferences(Contants.SETTING, Context.MODE_PRIVATE)
                            .getInt(Contants.SCREEN, ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT));
              initView();
              initEvent();
              initSDK();
              initMBI();
       }
      
       private void initView(){
              this.mLoginBtn = (Button)findViewById(R.id.sdk_login_btn);
              this.mLoginOutBtn = (Button)findViewById(R.id.sdk_loginout_btn);
              this.mFunTL = (LinearLayout)findViewById(R.id.sdk_fun_tl);
              this.mPayBtn = (Button)findViewById(R.id.sdk_pay_btn);
              this.mChargeRecorderBtn = (Button)findViewById(R.id.sdk_charge_recorder_btn);
              this.mCustomerServiceBtn = (Button)findViewById(R.id.sdk_customer_service_btn);
              this.mPayMethodBtn = (Button)findViewById(R.id.sdk_pay_method_btn);
              this.mGetGoodsListBtn = (Button)findViewById(R.id.sdk_get_goodslist_btn);
              this.mMBIGameeventBtn = (Button)findViewById(R.id.sdk_mbi_gameevent_btn);
              this.mDialog = new ProgressDialog(SDKMainActivity.this);
              this.mDialog.setMessage("登录验证中");
       }
      
       private void initEvent(){
              this.mLoginBtn.setOnClickListener(this);
              this.mLoginOutBtn.setOnClickListener(this);
              this.mPayBtn.setOnClickListener(this);
              this.mChargeRecorderBtn.setOnClickListener(this);
              this.mCustomerServiceBtn.setOnClickListener(this);
              this.mPayMethodBtn.setOnClickListener(this);
              this.mMBIGameeventBtn.setOnClickListener(this);
              this.mGetGoodsListBtn.setOnClickListener(this);
       }
      
       private void initSDK(){
              //CYMGSDK 初始化接口
              boolean isDebug = Config.DEBUG ;
              SharedPreferences sp = getSharedPreferences(Contants.SETTING, Context.MODE_PRIVATE);
              CYMGPlatformConfiguration config = new CYMGPlatformConfiguration
              .Builder(SDKMainActivity.this)
              .setScreenOrientation(sp.getInt(Contants.SCREEN, CYMGProtocolConfig.PORTRAIT) == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE ? CYMGProtocolConfig.LANDSCAPE : CYMGProtocolConfig.PORTRAIT)
              .setDebug(isDebug)//若开启debug模式则SDK会自动连接到测试服务器,接入者可以和畅游技术人员进行联调。否则SDK会连接到正式服务器。
              .build();
              CYMGPlatform.getInstance().init(config, new CYMGCallback() {//init方法中传入sdk唯一的CYMGCallback,用作全局回调
                    
                     @Override
                     public void onFinished(String arg0) {
                            Log.d("CYSDKDemo", arg0);
                            Toast.makeText(SDKMainActivity.this, arg0,Toast.LENGTH_LONG).show();
                            try {
                                   JSONObject obj = new JSONObject(arg0);//创建json对象
                                   int state_code = obj.getInt(CYMGProtocolKeys.STATE_CODE);//解析CYMGProtocolKeys.STATE_CODE以获得状态码
                                   switch (state_code) {//根据状态吗判断回调信息
                                   case CYMGPrompt.CODE_INIT_SUCCESS://初始化成功
                                          mLoginBtn.setVisibility(View.VISIBLE);
                                          mMBIGameeventBtn.setVisibility(View.VISIBLE);
                                          break;
                                   case CYMGPrompt.CODE_INIT_FAILED://初始化失败
                                          break;
                                   case CYMGPrompt.CODE_LOGIN_SUCCESS://登录成功
                                          Verify(arg0);
                                          break;
                                   case CYMGPrompt.CODE_LOGIN_FAILED://登录失败
                                          break;
                                   case CYMGPrompt.CODE_LOGOUT_SUCCESS://注销成功
                                          mFunTL.setVisibility(View.GONE);
                                          mLoginOutBtn.setVisibility(View.GONE);
                                          break;
                                   case CYMGPrompt.CODE_LOGOUT_FAILED://注销失败
                                          break;
                                   case CYMGPrompt.CODE_PAY_SUCCESS://支付成功
                                          Log.d("weixin", "====支付成功!===");
                                          break;
                                   case CYMGPrompt.CODE_PAY_FAILED://支付失败
                                          Log.d("weixin", "====支付失败!===");
                                          break;
                                   case CYMGPrompt.CODE_PAY_CANCEL://支付取消
                                          Log.d("weixin", "====支付取消!===");
                                          break;
                                   case CYMGPrompt.CODE_CHANGE_USER:
                                          mFunTL.setVisibility(View.GONE);
                                          mLoginOutBtn.setVisibility(View.GONE);
                                          break;
                                   case CYMGPrompt.CODE_GET_GOODS_LIST_SUCCESS:
                                          //TODO
                                          break;
                                   case CYMGPrompt.CODE_GET_GOODS_LIST_FAILED:
                                          //TODO
                                          break;
                                   }
                            } catch (Exception e) {
                                   Log.e(SDKApplication.TAG, "", e);
                            }
                     }
              });
       }
      
       private void initMBI(){
              //初始化MBI,参数1:当前Activtiy,参数2:log文件存放目录名称(自定义,天龙为例tlbbmbi),参数3:是否上传debug地址(默认false正式地址)
              CYMGPlatform.getInstance().initMBI(SDKMainActivity.this, "NEWMBI", true);
       }
      
       //在每个Activity的以下生命周期中调用mbiServiceManager的相关接口
       @Override
       protected void onResume() {
              super.onResume();
              CYMGPlatform.getInstance().onResume(SDKMainActivity.this);
       }
      
       @Override
       protected void onPause() {
              super.onPause();
              CYMGPlatform.getInstance().onPause(SDKMainActivity.this);
       }
      
       @Override
       protected void onStop() {
              super.onStop();
              CYMGPlatform.getInstance().onStop(SDKMainActivity.this);
       }
      
       @Override
       protected void onDestroy() {
              CYMGPlatform.getInstance().onDestroy(SDKMainActivity.this);
              super.onDestroy();
       }
 
      
       @Override
       public void onClick(View v) {
              switch (v.getId()) {
              //CYMGSDK 登录接口
              case R.id.sdk_login_btn:
                     CYMGPlatform.getInstance().login(SDKMainActivity.this, true);
                     break;
              //CYMGSDK 注销接口
              case R.id.sdk_loginout_btn:
                     Bundle loginOutBundle = new Bundle();
                     loginOutBundle.putString(CYMGProtocolKeys.TOKEN, UserInfoSPUtil.getToken(this));//设置当前账户token
                     CYMGPlatform.getInstance().logout(SDKMainActivity.this,loginOutBundle);
                     break;
              //CYMGSDK 支付接口
              case R.id.sdk_pay_btn:
                     Bundle payBundle = new Bundle();
                     payBundle.putInt(CYMGProtocolKeys.PAYMENT_METHOD, CYMGProtocolConfig.PAY_NORMAL);
                     payBundle.putString(CYMGProtocolKeys.UID, mUID);//设置当前账户uid
                     payBundle.putString(CYMGProtocolKeys.ROLE_ID, "123");//当角色和元宝由畅游BILLING来管理时,此参数不能为空,否则玩家无法充值,必传参数。
                     payBundle.putString(CYMGProtocolKeys.GROUP_ID, "123");//请将此值设置为分区标识,必传参数
                     payBundle.putString(CYMGProtocolKeys.LV, "99");//请将此值设置为角色等级,无等级不需要设置。
                     payBundle.putString(CYMGProtocolKeys.PUSH_INFO, "pushinfo");//设置扩展信息
                     CYMGPlatform.getInstance().payment(SDKMainActivity.this, payBundle);
                     break;
              //CYMGSDK 充值记录接口
              case R.id.sdk_charge_recorder_btn:
                     Bundle ChargeRecorderBundle = new Bundle();
                     ChargeRecorderBundle.putString(CYMGProtocolKeys.UID, mUID);//设置当前账户uid
                     CYMGPlatform.getInstance().chargeRecorder(this, ChargeRecorderBundle);
                     break;
              //CYMGSDK 客服接口
              case R.id.sdk_customer_service_btn:
                     Bundle b = new Bundle();
                     b.putString(CYMGProtocolKeys.UID, mUID);
                     b.putString(CYMGProtocolKeys.ROLE_ID, "role_id");
                     b.putString(CYMGProtocolKeys.GAME_NAME, "sdkdemo");
                     b.putString(CYMGProtocolKeys.SERVER_NAME, "server_name");
                     CYMGPlatform.getInstance().customerService(SDKMainActivity.this, b);
                     break;
              //CYMGSDK 支付方式接口
              case R.id.sdk_pay_method_btn:
                     Bundle methodB = new Bundle();
                     methodB.putInt(CYMGProtocolKeys.PAYMENT_METHOD, CYMGProtocolConfig.PAY_WAY);
                     methodB.putString(CYMGProtocolKeys.UID, mUID);
                     methodB.putString(CYMGProtocolKeys.ROLE_ID, "role_id");//必传参数
                     methodB.putString(CYMGProtocolKeys.GAME_NAME, "sdkdemo");
                     methodB.putString(CYMGProtocolKeys.SERVER_NAME, "server_name");
                     methodB.putString(CYMGProtocolKeys.GOODS_REGIST_ID, "zhifufangshi");
                     methodB.putString(CYMGProtocolKeys.GOODS_NUMBER, "1");
                     methodB.putString(CYMGProtocolKeys.GOODS_PRICE, "1");
                     methodB.putString(CYMGProtocolKeys.GROUP_ID, "123");//请将此值设置为分区标识,必传参数
                     methodB.putString(CYMGProtocolKeys.GOODS_NAME, "支付方式测试");
                     if(Config.DEBUG){
                            methodB.putString(CYMGProtocolKeys.GOODS_ID, "1547");
                     }else{
                            methodB.putString(CYMGProtocolKeys.GOODS_ID, "1490");
                     }
                     CYMGPlatform.getInstance().payment(SDKMainActivity.this, methodB);
                     break;
              //MBI gameevent日志接口
              case R.id.sdk_mbi_gameevent_btn:
                     MBILogManager.printOnlineLog(SDKMainActivity.this);
                     MBILogManager.printGameEventLog(SDKMainActivity.this, "demo");
                     break;
              //CYMGSDK 获取商品列表接口
              case R.id.sdk_get_goodslist_btn:
                     Bundle requestGoodsB = new Bundle();
                     CYMGPlatform.getInstance().reqPaymentGoodsList(SDKMainActivity.this,requestGoodsB);
                     break;
              }
       }
      
      
       /**
        *
        * 登录后模拟游戏服务器向Billing验证Token合法性
        *
        */
       private void Verify(String result) {
              try {
                     JSONObject obj = new JSONObject(result);
                     RequestParams params = new RequestParams();
                     params.put("data", obj.getString("data"));
                     params.put("channelid", obj.getString("channel_id"));
                     params.put("opcode", obj.getString("opcode"));
                     AsyncHttpClient asyncHttpClient = new AsyncHttpClient();
                     asyncHttpClient.setTimeout(10*1000);
                     asyncHttpClient.post(Contants.getVerifyUrl(), params,
                                   new MyAsyncResponseHandler() {
 
                                          @Override
                                          public void onStart() {
                                                 mDialog.show();
                                          }
 
                                          @Override
                                          public void onSuccess(int statusCode, String content) {
                                                 Log.d(SDKApplication.TAG, "onSuccess,content"+content);
                                                 mDialog.dismiss();
                                                 Toast.makeText(SDKMainActivity.this, content,Toast.LENGTH_LONG).show();
                                                 JSONObject jsonObject = null;
                                                 JSONObject jsonObject2 = null;
                                                 Integer status = 0;
                                                 if (!TextUtils.isEmpty(content)) {
                                                        try {
                                                               jsonObject = new JSONObject(content);
                                                               jsonObject2 = jsonObject.getJSONObject("data");
                                                               status = jsonObject2.getInt("status");
                                                               switch (status) {
                                                               case VERIFY_SUCCESS:
                                                                      Toast.makeText(SDKMainActivity.this, "登录验证成功",Toast.LENGTH_LONG).show();
                                                                      mUID = jsonObject2.getString("userid");
                                                                      mFunTL.setVisibility(View.VISIBLE);
                                                                      mLoginOutBtn.setVisibility(View.VISIBLE);
                                                                      //登录验证成功,请调用MBI的登录接口
                                                                      MBILogManager.mAccount.setUserid(mUID);//此处传uid
                                                                      MBILogManager.mAccount.setGamerealm("123");//此处传分区标示id
                                                                      MBILogManager.printLoginLog(SDKMainActivity.this);//此处调用登录日志接口
                                                                      break;
                                                               default:
                                                                      Toast.makeText(SDKMainActivity.this, "登录验证失败",Toast.LENGTH_LONG).show();
                                                                      CYMGPlatform.getInstance().login(SDKMainActivity.this, false);
                                                                      break;
                                                               }
                                                        } catch (JSONException e) {
                                                               Log.e(SDKApplication.TAG, "", e);
                                                        }
                                                 } else {
                                                        Toast.makeText(SDKMainActivity.this, "登录验证失败",Toast.LENGTH_LONG).show();
                                                        CYMGPlatform.getInstance().login(SDKMainActivity.this, false);
                                                 }
                                          }
 
                                          @Override
                                          public void onFailure(Throwable error, String content) {
                                                 Log.d(SDKApplication.TAG, "onFailure,content"+content);
                                                 mDialog.dismiss();
                                                 Toast.makeText(SDKMainActivity.this, "登录验证失败",Toast.LENGTH_LONG).show();
                                                 CYMGPlatform.getInstance().login(SDKMainActivity.this, false);
                                          }
                                   });
              } catch (Exception e) {
                     Log.e(SDKApplication.TAG, "", e);
              }
       }
}

测试日志

登录测试日志

畅游

获取商品列表日志:

畅游

遇到问题

笔者在接入金立游戏的时候遇到以下几个问题,需要开发要注意的:

1、SDK版本不对应

开发者导入测试Demo的时候可以机器并没有对应的SDK版本,我们到如下界面选择SDK版本。

畅游

2、无法把库项目导入到工作空间

畅游

笔者在测试畅游SDK的时候,用的是ADT,而畅游所提供的库项目是使用Android studio所创建的,所以无法引入到Eclipse中。

解决方案:我们可以在Eclipse创建对应的库项目,把所需要的资源复制到我们使用Eclipse所创建的项目中去即可,然后设置为library,再导入到目标项目。如下:

畅游

畅游

上手难易

笔者花了比较长的时间接入畅游的项目,主要问题出在项目上,开发者如果没有使用Android Studio进行开发的话,可以按照笔者上面的解决办法进行解决,在Eclipse创建两个新的库文件,再导入到我们的项目中去即可完成接入,难度一般。

开发文档

畅游为开发者提供了较为详尽的文档支持,开发者可以到官网查看接入SDK的相关说明:

畅游

也提供了对应不同渠道的开发文档,开发者接入渠道的时候可以选择对应的文档进行查看。

畅游

此服务评测版权归DevStore所有,禁止转载,申请升级为 特约评测员 才可进行测评立即申请

声明:DevStore评测内容都是基于专业评测人员/开发者通过真实的测试之后得出的数据,服务版本实时都在更新,所以评测并不一定是此服务的最新版本,但我们会秉承公正专业精准的态度,对开发者负责,同时欢迎大家监督和建议,如对评测内容有异议,请提交纠错,由专业的评测团队再次评测,我们会尽最大努力为大家提供更贴心的服务。

DevStore_全球首家第三方开发者服务商店,最精准的服务对比、最专业的服务评测、最及时的行业动态,为开发者挑选服务提供最全面的参考和专业分析,加入DevStore,从此告别熬夜加班,你也可以这么帅!搜索微信号:DevStore

评论(1)
xmy1228

xmy1228 2014-08-18 15:58:25

其实现在畅游SDK已经有很多成功接入案例,例如《谁是大英雄》《刀塔联盟》还有最近准备测试的《秦时明月2》,听说畅游SDK马上要升级成2.0,届时将会和橙柚社区功能进行对接,并增加了游戏更新,悬浮窗等很多新功能。评测里提到开发者申请麻烦确实存在,可能畅游还没做好全面对外开放的准备吧,而且对各个渠道SDK进行了聚合反而感觉很鸡肋,如果开发者接入其他渠道过程中出现问题是向畅游咨询还是向渠道咨询?
回复(1) 赞(0) 赞(1)
 
  • wwj_748:
    畅游没有直接提供客服,官网提供了资讯号码和qq群,可以通过打电话和qq群发问来对渠道资讯
    回复2014-08-18 17:22:37