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,

HostYun:联通AS9929线路,最低月付18元起,最高500Mbps带宽,洛杉矶机房

最近AS9929线路比较火,联通A网,对标电信CN2,HostYun也推出了走联通AS9929线路的VPS主机,基于KVM架构,开设在洛杉矶机房,采用SSD硬盘,分为入门和高带宽型,最高提供500Mbps带宽,可使用9折优惠码,最低每月仅18元起。这是一家成立于2008年的VPS主机品牌,原主机分享组织(hostshare.cn),商家以提供低端廉价VPS产品而广为人知,是小成本投入学习练手首选。...

wordpress投资主题模版 白银黄金贵金属金融投资网站主题

wordpress投资主题模版是一套适合白银、黄金、贵金属投资网站主题模板,绿色大气金融投资类网站主题,专业高级自适应多设备企业CMS建站主题 完善的外贸企业建站功能模块 + 高效通用的后台自定义设置,简洁大气的网站风格设计 + 更利于SEO搜索优化和站点收录排名!点击进入:wordpress投资主题模版安装环境:运行环境:PHP 7.0+, MYSQL 5.6 ( 最低主机需求 )最新兼容:完美...

DiyVM(50元起)老牌商家,香港沙田CN2直连vps/不限流量/五折终身优惠

diyvm怎么样?diyvm是一家国内成立时间比较久的主机商家了,大约在6年前站长曾经用过他家的美国机房的套餐,非常稳定,适合做站,目前商家正在针对香港沙田机房的VPS进行促销,给的是五折优惠,续费同价,香港沙田机房走的是CN2直连的线路,到大陆地区的速度非常好,DiyVM商家采用小带宽不限流量的形式,带宽2Mbps起步,做站完全够用,有需要的朋友可以入手。diyvm优惠码:五折优惠码:OFF50...

小米开放为你推荐
第1页,共5页2019供应商搜狗浏览器2j^=iáíá=fq~=OQJOU==aJPPNMO=m~dê~ó=万家增强收益债券型证券投资基金空调iphone甘肃省政府采购支持ipad请务必阅读正文之后的免责条款部分勒索病毒win7补丁win7有针对勒索病毒的补丁吗fusionchartsfusioncharts曲线图怎么默认显示数量
俄罗斯vps 私服服务器 sockscap 512au 2017年万圣节 商家促销 java虚拟主机 台湾谷歌 drupal安装 国外视频网站有哪些 lamp架构 免费个人主页 沈阳idc 时间同步服务器 paypal登陆 linuxvi命令 小米电视主机 国内免备案空间 qq空间打开慢 服务器监测软件 更多