ishelpfulXiaoMi Game Center Guide - 小米开放平台

小米开放  时间:2021-05-08  阅读:()

MiTV and MiBox Game DeveloperGuide(for Single Player Game)

V1.0.1

2013-11-29

Modify history:

Definition of Terms:

1.XiaoMi gamecenter

1.1. Introduction

Xiaomi gamecenter is released foral l Miphone,MiBox,MiTVand MIUI users byxiaomicompany.The whole center, striving to create a betterAndroid ecosystem, includes manyqual ity resources such as MIUI system,develop SDK,internetwebsite,xiaomi Forum etc..

Xiaomi game centerprovidesan easyand quickaccessof downloading, searching,charging(supportonl ineand single player)of games, it isthe bestchoiceforgamedevelopers.

1.3.Mibi

Mibi is issued byxiaomi company,used forvirtual production payment, l ikeQbi . Mibi hasthe characteristicsof circulation in al l xiaomi virtual production platform.Users could chargethroughxiaomiaccounts(BuyMibivia RMB),and payforal l the production inxiaomi and itsco-company production platform.

1RMB=1Mibi, thesmal lestunit is1cent, so something could bepriced at0.01Mibi .

The Mibi amountspent byusersfor appl icationsarethe basisforsettlementfortheincoming of developers.

1.4.Quick start

Before reading the belows, it is highlyrecommended thatyou instal l thetwo Demoprograms(MiBox_SDK_Demo_Offl ineGame.apk and MiBox_SDK_Demo_Onl ineGame.apk)distributed with this document into MiTVor MiBox.Because the two programs demonstrate thewholeworkflowof xiaomi game SDK,and it ishelpful to understand ourSDKpayment flow.

2.Production Design and Implementation

2.1.Single Player Game

2.1.1 Flowof single playergame

Thedevelopersof single playergamesneed neitherto managethe users' login nor recordthe login status.Al l theyneed to do isto invokethe miUniPayOffl ine() nested in SDKwhenusers do the payments.SDK itself processes the logic of users' login, registration, insufficientmoney,purchased and so on.Atypical businessflowisasfol lows:

2.1.2 Position of game icons for MiBox and MiTV

Create fourdirectories in directory'res'of apk forthe two game icons(For MiBox and MiTV):

1.drawable-mdpi

2.d rawa ble-tvd pi

3.dawable-hdpi

4.drawable-xhdpi

Put the icon forMiTVin drawable-hdpi and drawable-xhdpi

Put the icon for MiBox in drawable-mdpi and drawable-tvdpi

2.1.3 SDKinvoke methods

Asfordevelopers,onlyneed to add thefol lowing codeto realizethe single playergamepayment.

2.1.3.1Initialize

Please obtain AppId and AppKey first, then invoke the following SDK initialization code to initialize theoperation.

Put MiGameCenterSDKService.apk of SDK package into the'assets'directory of application,and SDK's jarthe'libs', referenced in buildpath, then initialize SDK.(Note:Check whether the package name of the game is thesame with the package name of xiaomi server c onfiguration,whether the Appid and Appkey are c onsistent withthe applied. If not consistent, it would be failed when invoke login and other SDK interfaces.).

Init()method is invoked in Application.onCreate!

ThepermissionthatSDKneedstoadd:

2.1.3.2Invoke payment

2.1.3.2.1Code of Xiaomiaccount login

2.1.3.2.2 Consumable production(Production that can be re-purchased, such as blood bottleand magic bottle)

2.1.3.2.3 Non-consumable production(Production that cannot be re-purchased, such as gamelevel)

Parameter Description:

2.1.3.2.4 SDK's main entrance

SDK's main entrance adds customerservice,game forumsand guide functions(Pleasecontactusforthe location of main entrance.)

2.1.4 Server interface

If needed, itcould also provide the notification addressof receiving order payment resultforsingle playergames. Optional 

2.1.4.1.Order notification interface

2.1.4.1.1 Process Description:

This interface isdeveloped bydeveloperand should be configuredin xiaomi game centerbefore releasing.

Aftersuccessful paymentof the order,xiaomi game centerwi l l notifythe developer'sserverprovided in advance with the payment result. If the developer's servercannot be accessed,within a certain period of time,game centerserverwould do the checking cycle(Theformer10times,notifying oncea minute; then oncean hour)

Specific procedures are as fol lows:

Note:Duetothe asynchronous notification model,(3)and(4)maynotfol lowthe sequence,so(4)and (5) need to be checked cycl ical ly,or use the interface to querythe payment result.

Compared to the later-mentioned developer'sactive queryordermode,we recommendusingthisone.

2.1.4.1.2Interface and Parameters Description

Interface address:each developer's server's notification address(Appl ied in advance,configured in xiaomi game center)

Request Parameter Description

Response Parameter Description

Note:Developers must guarantee that product be del ivered onlyonce forthe same order'smultiple notifications.

Interface Format Description

Request mode:HTTP GET

Input parameters: ?parameter1=value1&parameter2=value2&. ..&parameterN=valueN,

CloudCone(12.95美元/月CN2 GT线路,KVM架构1 Gbps带宽

整理一下CloudCone商家之前推送的闪购VPS云服务器产品,数量有限,活动推出可能很快机器就售罄了,有需要美国便宜VPS云服务器的朋友可以关注一下。CloudCone怎么样?CloudCone服务器好不好?CloudCone值不值得购买?CloudCone是一家成立于2017年的美国服务器提供商,国外实力大厂,自己开发的主机系统面板,CloudCone主要销售美国洛杉矶云服务器产品,优势特点是...

HTTPS加密协议端口默认是多少且是否支持更换端口访问

看到群里网友们在讨论由于不清楚的原因,有同学的网站无法访问。他的网站是没有用HTTPS的,直接访问他的HTTP是无法访问的,通过PING测试可以看到解析地址已经比较乱,应该是所谓的DNS污染。其中有网友提到采用HTTPS加密证书试试。因为HTTP和HTTPS走的不是一个端口,之前有网友这样测试过是可以缓解这样的问题。这样通过将网站绑定设置HTTPS之后,是可以打开的,看来网站的80端口出现问题,而...

RackNerd :美国大硬盘服务器促销/洛杉矶multacom数据中心/双路e5-2640v2/64G内存/256G SSD+160T SAS/$389/月

大硬盘服务器、存储服务器、Chia矿机。RackNerd,2019年末成立的商家,主要提供各类KVM VPS主机、独立服务器和站群服务器等。当前RackNerd正在促销旗下几款美国大硬盘服务器,位于洛杉矶multacom数据中心,亚洲优化线路,非常适合存储、数据备份等应用场景,双路e5-2640v2,64G内存,56G SSD系统盘,160T SAS数据盘,流量是每月200T,1Gbps带宽,配5...

小米开放为你推荐
桌面chrome思科route支持ipad支持ipad重庆宽带测速重庆哪一种宽带网速最快windows键是哪个Windows键是哪个键啊?重庆电信宽带管家重庆电信宽带安装收费css选择器css有哪些选择器win7还原系统win7如何一键还原电脑系统怎么操作ipad无法加入网络ipad无法加入网络但是手机能用
lamp安装 buyvm yardvps 国外idc 免费主机 rak机房 gateone 三拼域名 阿里校园 香港新世界中心 无限流量 东莞主机托管 测速电信 免费个人网页 带宽测试 酷锐 亿库 winds 侦探online alertpay 更多