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,

Megalayer美国独立服务器新用户首月优惠350元(30M优化不限流量)

Megalayer 商家在开始看到有提供香港服务器、香港站群服务器的时候有介绍过,后来就一直没有怎么关注。但是前几天有看到网友使用到他们家的美国独立服务器问其如何的,但是我没有使用过就不好评论,这不前几天也有介绍到Megalayer美国独立服务器。以及我们也有看到商家有提供美国站群服务器和美国大带宽服务器产品,可选30M不限制流量CN2优化线路,以及100M不限制流量国际带宽线路。新年元旦后,Me...

hypervmart:英国/荷兰vps,2核/3GB内存/25GB NVMe空间/不限流量/1Gbps端口/Hyper-V,$10.97/季

hypervmart怎么样?hypervmart是一家国外主机商,成立于2011年,提供虚拟主机、VPS等,vps基于Hyper-V 2012 R2,宣称不超售,支持linux和windows,有荷兰和英国2个数据中心,特色是1Gbps带宽、不限流量。现在配置提高,价格不变,性价比提高了很多。(数据中心不太清楚,按以前的记录,应该是欧洲),支持Paypal付款。点击进入:hypervmart官方网...

华纳云-618大促3折起,18元/月买CN2 GIA 2M 香港云,物理机高防同享,10M带宽独享三网直连,无限流量!

官方网站:点击访问华纳云活动官网活动方案:一、香港云服务器此次推出八种配置的香港云服务器,满足不同行业不同业务规模的客户需求,同时每种配置的云服务都有不同的带宽选择,灵活性更高,可用性更强,性价比更优质。配置带宽月付6折季付5.5折半年付5折年付4.5折2年付4折3年付3折购买1H1G2M/99180324576648直达购买5M/17331556710081134直达购买2H2G2M892444...

小米开放为你推荐
SAProuteI:\Sam-research\QEF\Publications\ConferencegetIntjavacss3圆角怎样用css实现圆角矩形?win10关闭445端口win10怎么关闭445的最新相关信息win10关闭445端口在win10 如何关闭445端口的最新相关信息fusionchartsfusioncharts曲线图怎么默认显示数量重庆电信宽带管家重庆电信宽带多少钱一个月win7关闭135端口windows 7如何关闭139端口csshack什么是Css Hack?ie6,7,8的hack分别是什么
locvps 火车票抢票攻略 主机合租 最好的空间 200g硬盘 cn3 vip购优惠 如何注册阿里云邮箱 优酷黄金会员账号共享 金主 后门 好看的空间 htaccess windowsserverr2 vim 国外bt网站 中国最年轻博士 美国主机购买 电脑主机报价 更多