Enabling Xiaomi Support

While being included in the Xiaomi market is currently an invite-only process, making your app Xiaomi-Enabled is a relatively simple affair. To ensure your app/game is ready for Xiaomi, be sure to update to the latest OUYA-Everywhere plugin and publish to the OUYA Store targeting the OUYA. After passing review, your app/game is ready for Xiaomi.

Xiaomi Target Hardware

Update to the latest ODK

Download latest ODK (ODK-1.3.1503) from the OUYA Developer portal and setup your game to use it.

Engine specific details:

Review the OUYA Everywhere Documentation

  • Be sure to review the OUYA Everywhere Documentation for your engine. The next initialization steps may integrate differently for your particular engine.

Engine specific details:

Xiaomi Libraries

  • Download and extract SDK_MIBOX_2.0.1
  • Place SDK_MIBOX_2.0.1.jar with the libraries of your game
  • Place MiGameCenterSDKService.apk in your /assets directory.

Engine specific details:

Xiaomi required permissions

Xiaomi's SDK requires several additional permissions in AndroidManifest.xml in order to work.

    <uses-permission android:name="com.xiaomi.sdk.permission.PAYMENT"/>
    <uses-permission android:name="android.permission.GET_TASKS"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>

Engine specific details:

Receipt Checking

  • If your game has in-app-purchases, be sure to check for receipts when the application starts. This is important to verify entitlement purchases for premium games and demo games with paid unlock.

Xiaomi Initialization

The Xiaomi market requires a special application key and ID. Contact the OUYA team to get these values.

Additionally, non-OUYA markets require being pre-informed about all possible product IDs that might be used during the game's run. This is so the SDK can do any transforms that are specific to the market that the game is connecting to.

The following initialization strings must be set.

  • tv.ouya.developer_id - The developer UUID available after signing into the developer portal

  • signing key - The signing key is created when a game entry is entered in the developer portal. Each game entry in the games list has a signing key available for download.

  • com.xiaomi.app_id - The Xiaomi Application Identifier

  • com.xiaomi.app_key - The Xiaomi Application Key

  • tv.ouya.product_id_list - The list of entitlements available for purchase within the app/game

Engine specific details:

Is Running on OUYA Hardware

Be sure to check that OuyaFacade.isInitialized() returns true before checking OuyaFacade.isRunningOnOUYASupportedHardware(), otherwise the call will fail if the OUYA Framework is not present.

Disable Xiaomi Screensaver

  • The Xiaomi screensaver should be disabled while your game is running.

Engine specific details:

Exit Button on Main Menu

Typically games have a main menu, and the menu should have an exit button to quit the game. Alternatively, pressing the OUYA A button on the main menu should prompt to exit the game.

Create a Xiaomi-specific icon

The application icon on Xiaomi is a little unusual. It will exist in the xhdpi resolution, but it is not a standard Android icon.

  • res/drawable-xhdpi:

    • File must be named "ouya_xiaomi_icon.png"
    • 284x160, 32-bit
    • 15px rounded corners
    • Hero element
      • Size 284x110
    • Game name
      • Bottom 50px
      • Background should be a solid color
      • No actual text - will be inserted by system at runtime.
    • NOTE: Do NOT update your AndroidManifest.xml to reference ouya_xiaomi_icon - you only need to place the asset in the correct location.
    • See this example

    this example

Engine specific details:

Xiaomi requires a .psd image.

  • Xiaomi also requires a 800x800 image of the protagonist character(s), or something showing what the game is about.

  • Must be in PSD format.

  • Should be sent directly to the OUYA team

Localization Resources

  • Xiaomi requires that the app/game has been localized for Simplified Chinese.

  • Xiaomi also requires that the app/game name needs to be localized, if possible.

Engine specific details:

Fonts

  • In order to support Simplified Chinese text, some engines use true type fonts and others use bitmap fonts.

  • bmfont is a free bitmap font generation tool that can convert true type fonts into bitmap fonts.

bitmap font  example

Engine specific details:

Versioning

Builds need to use standard Android versioning. Each time a build is submitted to Xiaomi, the version name and version code need to be incremented. In most cases the version can be changed in the AndroidManifest.xml.

Engine

  • When uploading your game to the developer portal, be sure to fill out which engine you used. That way support will have a context for issues and engine specific fixes can be relayed faster to you.

Submission

Once the above changes have been made, your updated APK should be submitted via the OUYA Developer portal. You'll then need to email OUYA at xiaomisupport@ouya.tv to let us know it's ready. Once you've done that, we'll take a snapshot of the in-app-purchase products that you have and send them to Xiaomi. Please make sure that you've created any necessary in-app-purchase products BEFORE telling us your submission is ready. This email is also when you should send OUYA your protagonist PSD file.

TL;DR

  • Update to the latest ODK (ODK-1.3.1503).
  • Add files to your game project - Xiaomi SDK and Xiaomi's game service apk.
  • Add required permissions to your manifest.
  • Update OuyaFacade's initialization bundle.
  • Create new icon per Xiaomi's requirements
  • Create 800x800 PSD of protagonist.
  • Submit updated apk to OUYA's dev portal
  • Email OUYA to let us know it's ready; include your protagonist PSD.

That's it!

Wasn't that easy? :)

Questions?

If it actually wasn't that easy and you have questions, please don't hesitate to email us at xiaomisupport@ouya.tv.

Log into the Xiaomi Console

To log into the console, pick the second option on the home screen.

second option

Choose the third tab.

third tab

Select the first item to enter user settings.

user settings

Select the option on the right to sign in.

sign in

Confirm with the left button.

confirm sign in

Enter the user and password using the controller or remote.

enter user and password

Select the left button to log in.

left button

If the login is successful, a success animation appears briefly.

login success

After a successful log in, the launcher will return to the home screen.

Browse to the OUYA Category on Xiaomi

To browse to the OUYA Category on the Xiaomi console, pick the second option on the home screen.

second option

On the first tab, press Down and scroll through the items to the Right.

down image

Enter the OUYA Category.

OUYA Category

Play OUYA Games!

OUYA Games