|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttv.ouya.console.api.OuyaFacade
public class OuyaFacade
Entry point for the OUYA API. Applications should use the singleton instance.
Calls are asynchronous, so
results are returned via client provided OuyaResponseListener
objects.
Method Summary | |
---|---|
boolean |
bindRequestHasBeenMade()
Deprecated. |
java.lang.String |
getGameData(java.lang.String name)
Get a piece of previously stored game data. |
static OuyaFacade |
getInstance()
Returns the OuyaFacade singleton. |
static int |
getOdkVersionNumber()
|
void |
init(android.content.Context context,
java.lang.String developerId)
Initializes the facade. |
boolean |
isInitialized()
Returns whether the OuyaFacade has been initialized. |
boolean |
isRunningOnOUYAHardware()
Test to see if we're running on an OUYA console. |
void |
onServiceConnected(android.content.ComponentName componentName,
android.os.IBinder iBinder)
Called when the service is connected. |
void |
onServiceDisconnected(android.content.ComponentName componentName)
Called when the service is disconnected. |
void |
putGameData(java.lang.String name,
java.lang.String value)
Store some game data. |
void |
requestGamerUuid(OuyaResponseListener<java.lang.String> gamerUuidListener)
Requests the current gamer's UUID. |
void |
requestProductList(java.util.List<tv.ouya.console.api.Purchasable> purchasables,
OuyaResponseListener<java.util.ArrayList<tv.ouya.console.api.Product>> productListListener)
Returns a list of Product objects that describe the products (including
current price) associated with the specified list of Purchasable s. |
void |
requestPurchase(tv.ouya.console.api.Purchasable purchasable,
OuyaResponseListener<java.lang.String> purchaseListener)
Requests that the specified Purchasable be purchased on behalf of the current user. |
void |
requestReceipts(OuyaResponseListener<java.lang.String> receiptListListener)
Requests receipts for all of the purchases that the current gamer has made from a particular vendor. |
void |
setTestMode()
Enables 'test mode' for making purchases without charging real money. |
void |
shutdown()
Shuts down the facade. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static OuyaFacade getInstance()
public static int getOdkVersionNumber()
public void init(android.content.Context context, java.lang.String developerId)
context
- An Android Context object.developerId
- The developer UUID, which is obtained from the developer portal.public void shutdown()
Note: Call shutdown
before the program exits. Otherwise, the internal BroadcastReceiver
will be leaked.
public boolean isInitialized()
public boolean isRunningOnOUYAHardware()
public void setTestMode()
public void putGameData(java.lang.String name, java.lang.String value)
name
- The name of the piece of game data to store.value
- The value to store.public java.lang.String getGameData(java.lang.String name)
name
- The name of the piece of information to get.
public void requestProductList(java.util.List<tv.ouya.console.api.Purchasable> purchasables, OuyaResponseListener<java.util.ArrayList<tv.ouya.console.api.Product>> productListListener)
Product
objects that describe the products (including
current price) associated with the specified list of Purchasable
s.
purchasables
- The Purchasable objects that identify the products to be returned.productListListener
- A listener object that will asynchronously receive the Product
spublic void requestPurchase(tv.ouya.console.api.Purchasable purchasable, OuyaResponseListener<java.lang.String> purchaseListener)
The IAP client service is
responsible for identifying the user and requesting credentials as appropriate, as well as providing
all of the UI for the purchase flow. When purchases are successful, a Product
object is returned
that describes the product that was purchased.
purchasable
- The Purchasable object that describes the item to be purchased.purchaseListener
- A listener object that will asynchronously receive the results of the purchase
requestpublic void requestReceipts(OuyaResponseListener<java.lang.String> receiptListListener)
receiptListListener
- A listener object that will asynchronously receive the list of receipts for all
purchases ever made by the gamer to whom the console is currently registered.public void requestGamerUuid(OuyaResponseListener<java.lang.String> gamerUuidListener)
gamerUuidListener
- A listener object that will asynchronously receive the UUID of the gamer to whom the
console is currently registered.@Deprecated public boolean bindRequestHasBeenMade()
public void onServiceConnected(android.content.ComponentName componentName, android.os.IBinder iBinder)
This is part of Android's ServiceConnection
interface, and it is not client consumable.
onServiceConnected
in interface android.content.ServiceConnection
componentName
- The name of the service that has been connected.iBinder
- The IBinder
object for that service.public void onServiceDisconnected(android.content.ComponentName componentName)
This is part of Android's ServiceConnection
interface, and it is not client consumable.
onServiceDisconnected
in interface android.content.ServiceConnection
componentName
- The name of the service that has been disconnected.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |