XIAOMI (OUYA everywhere) inplementation

Monkey Targets Forums/User Targets/XIAOMI (OUYA everywhere) inplementation

Snader(Posted 2015) [#1]
I am trying to make the required changes as mentioned in https://github.com/ouya/docs/blob/master/java.md#releases to get the OUYA target working for all the third party OUYA implementation out there.

I think I got most of it (well, the app still compiles), but I don't know anything about the stuff below or how to implement it...

Using Java, prepare a Bundle with additional key/value pairs which are used to initialize the OuyaFacade.
// Your developer id can be found in the Developer Portal
public static final String DEVELOPER_ID = "00000000-0000-0000-0000-000000000000";

// Both of these values will be emailed to you by the OUYA team after you've been
// selected by the OUYA team
public static final String XIAOMI_APP_ID = "0000000000000";
public static final String XIAOMI_APP_KEY = "000000000000000000";

// All product IDs that might be used
public static final String[] ALL_PRODUCT_IDS = new String[] {
"long_sword",
"sharp_axe",
"100_extra_lives"
}

@Override
protected void onCreate(Bundle savedInstanceState) {
Bundle developerInfo = new Bundle();

// "tv.ouya.developer_id"
developerInfo.putString(OuyaFacade.OUYA_DEVELOPER_ID, DEVELOPER_ID);

developerInfo.putByteArray(OuyaFacade.OUYA_DEVELOPER_PUBLIC_KEY, loadApplicationKey());

// We must tell the OuyaFacade that we can use the Xiaomi market for purchases.

// "com.xiaomi.app_id"
developerInfo.putString(OuyaFacade.XIAOMI_APPLICATION_ID, XIAOMI_APP_ID);

// "com.xiaomi.app_key"
developerInfo.putString(OuyaFacade.XIAOMI_APPLICATION_KEY, XIAOMI_APP_KEY);

// "tv.ouya.product_id_list"
developerInfo.putStringArray(OuyaFacade.OUYA_PRODUCT_ID_LIST, ALL_PRODUCT_IDS);

// Pass the Activity for the context parameter when initializing the OuyaFacade.
// Passing the application context for the context paramter will not work on Xiaomi.
OuyaFacade.getInstance().init(this, developerInfo);

super.onCreate(savedInstanceState);
}