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,

wordpress公司网站模板 wordpress简洁高级通用公司主题

wordpress公司网站模板,wordpresss简洁风格的高级通用自适应网站效果,完美自适应支持多终端移动屏幕设备功能,高级可视化后台自定义管理模块+规范高效的搜索优化。wordpress公司网站模板采用标准的HTML5+CSS3语言开发,兼容当下的各种主流浏览器: IE 6+(以及类似360、遨游等基于IE内核的)、Firefox、Google Chrome、Safari、Opera等;同时...

麻花云:3折优惠,香港CN2安徽麻花云香港安徽移动BGP云服务器(大带宽)

麻花云在7月特意为主机测评用户群定制了促销活动:香港宽频CN2云服务器、安徽移动云服务器(BGP网络,非单线,效果更好)、安徽移动独立服务器、安徽电信独立服务器,全部不限制流量,自带一个IPv4,默认5Gbps的DDoS防御。活动链接:https://www.mhyun.net/act/zjcp特价云服务器不限流量,自带一个IPv4,5Gbps防御香港宽频CN2全固态Ⅲ型 4核4G【KVM】内存:...

ParkInHost - 俄罗斯VPS主机 抗投诉 55折,月付2.75欧元起

ParkInHost主机商是首次介绍到的主机商,这个商家是2013年的印度主机商,隶属于印度DiggDigital公司,主营业务有俄罗斯、荷兰、德国等机房的抗投诉虚拟主机、VPS主机和独立服务器。也看到商家的数据中心还有中国香港和美国、法国等,不过香港机房肯定不是直连的。根据曾经对于抗投诉外贸主机的了解,虽然ParkInHost以无视DMCA的抗投诉VPS和抗投诉服务器,但是,我们还是要做好数据备...

小米开放为你推荐
用户重庆中南财经政法大学知识产权研究中心机动车diandiancyclesios8敬请参阅报告结尾处免责声明win10关闭445端口win10家庭版怎么禁用445端口itunes备份itunes就是备份不了怎么办啊ms17-010win1038度古贝春珍藏10价格?google中国地图谷歌卫星地图中文版下载在哪下??迅雷下载速度为什么 迅雷下载速度太慢
国外vps 淘宝二级域名 什么是域名地址 香港ufo 西安电信测速 踢楼 美国翻墙 搬瓦工官网 wdcp 外国空间 网盘申请 免费个人空间申请 毫秒英文 天互数据 web服务器架设 韩国名字大全 免费吧 gtt 服务器监测 上海服务器 更多