tv.ouya.console.api
Class UserManager

java.lang.Object
  extended by tv.ouya.console.api.UserManager
All Implemented Interfaces:
android.content.ServiceConnection

public class UserManager
extends java.lang.Object
implements android.content.ServiceConnection

Entry point for the OUYA API. Applications should use the singleton instance.

Calls are asynchronous, so results are returned via client provided OuyaResponseListener objects.


Constructor Summary
protected UserManager(android.content.Context context)
          Default constructor.
 
Method Summary
 boolean bindRequestHasBeenMade()
          Deprecated. 
static UserManager getInstance(android.content.Context context)
          Returns the OuyaFacade singleton.
 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 requestUserAddsAccount(android.app.Activity activity, OuyaResponseListener<java.lang.Void> listener)
          Takes the user to the "Add OUYA account" screen.
 void requestUsername(java.lang.String consoleId, OuyaResponseListener<java.lang.String> usernameListener)
          Gets the username associated with a console
protected static void setInstance(UserManager instance)
          Deprecated. 
 void shutdown()
          Shuts down the facade.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManager

protected UserManager(android.content.Context context)
Default constructor.

Protected in order to prevent anyone from accidently creating an OuyaFacade directly.

Method Detail

getInstance

public static UserManager getInstance(android.content.Context context)
Returns the OuyaFacade singleton.

Returns:
The singleton.

setInstance

@Deprecated
protected static void setInstance(UserManager instance)
Deprecated. 

This method is for testing only.


shutdown

public void shutdown()
Shuts down the facade.

Note: Call shutdown before the program exits. Otherwise, the internal BroadcastReceiver will be leaked.


requestUsername

public void requestUsername(java.lang.String consoleId,
                            OuyaResponseListener<java.lang.String> usernameListener)
Gets the username associated with a console

Parameters:
consoleId - The ID of this console
usernameListener - The Listener for the username

requestUserAddsAccount

public void requestUserAddsAccount(android.app.Activity activity,
                                   OuyaResponseListener<java.lang.Void> listener)
Takes the user to the "Add OUYA account" screen.

Parameters:
activity - The currently active activity

bindRequestHasBeenMade

@Deprecated
public boolean bindRequestHasBeenMade()
Deprecated. 

This method is used for testing only.


onServiceConnected

public void onServiceConnected(android.content.ComponentName componentName,
                               android.os.IBinder iBinder)
Called when the service is connected.

This is part of Android's ServiceConnection interface, and it is not client consumable.

Specified by:
onServiceConnected in interface android.content.ServiceConnection
Parameters:
componentName - The name of the service that has been connected.
iBinder - The IBinder object for that service.

onServiceDisconnected

public void onServiceDisconnected(android.content.ComponentName componentName)
Called when the service is disconnected.

This is part of Android's ServiceConnection interface, and it is not client consumable.

Specified by:
onServiceDisconnected in interface android.content.ServiceConnection
Parameters:
componentName - The name of the service that has been disconnected.


Copyright © 2012 OUYA, Inc. All Rights Reserved.