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 新增洛杉矶优化线路 年付17.99美元且简单线路测试

CloudCone 商家在以前的篇幅中也有多次介绍到,这个商家也蛮有意思的。以前一直只有洛杉矶MC机房,而且在功能上和Linode、DO、Vultr一样可以随时删除采用按时计费模式。但是,他们没有学到人家的精华部分,要这样的小时计费,一定要机房多才有优势,否则压根没有多大用途。这不最近CloudCone商家有点小变化,有新人洛杉矶优化线路,具体是什么优化的等会我测试看看线路。内存CPU硬盘流量价格...

JUSTG提供俄罗斯和南非CN2 GIA主机年$49.99美元JUSTGgia南非cn2南非CN2justG

JUSTG,这个主机商第二个接触到,之前是有介绍到有提供俄罗斯CN2 GIA VPS主机活动的,商家成立时间不久看信息是2020年,公司隶属于一家叫AFRICA CLOUD LIMITED的公司,提供的产品为基于KVM架构VPS主机,数据中心在非洲(南非)、俄罗斯(莫斯科),国内访问双向CN2,线路质量不错。有很多服务商实际上都是国人背景的,有的用英文、繁体搭建的冒充老外,这个服务商不清楚是不是真...

CloudCone(20美元/年)大硬盘VPS云服务器,KVM虚拟架构,1核心1G内存1Gbps带宽

近日CloudCone商家对旗下的大硬盘VPS云服务器进行了少量库存补货,也是悄悄推送了一批便宜VPS云服务器产品,此前较受欢迎的特价20美元/年、1核心1G内存1Gbps带宽的VPS云服务器也有少量库存,有需要美国便宜大硬盘VPS云服务器的朋友可以关注一下。CloudCone怎么样?CloudCone服务器好不好?CloudCone值不值得购买?CloudCone是一家成立于2017年的美国服务...

小米开放为你推荐
汉语163敬请参阅最后一页特别声明支持ipad支持ipad重庆网通重庆网通上网资费目前是多少? 小区宽带接入类型的联通版iphone4s苹果4S移动版和联通版有什么不同联通iphone4iphone4想换联通的卡 是普通联通的卡都能开通3G么 还是得换联通3G卡 联通都有什么套餐 我是北京的win7关闭135端口如何关闭135端口,关闭它有什么影响么?bitchina现在哪个浏览器最好用?ios5.1.1固件下载苹果 4s 5.1怎么升5.1.1
长沙域名注册 视频空间租用 香港托管 tightvnc hkg 免费活动 空间技术网 四核服务器 监控服务器 卡巴斯基试用版下载 tracker服务器 建站技术 magento主机 连连支付 卡巴斯基免费版 企业私有云存储 web服务器安全配置 qq空间登入 魔兽世界服务器维护 视频监控服务器 更多