PlayerIO

The fastest way to build online games without breaking a sweat.

Android Client Reference

Android  class documentationClass PlayerIO

Namespace: com.playerio
Language: Java

Entry class for the initial connection to Player.IO.

Here is an example of using the class to authenticate a user:

Methods

 
public static void
authenticate (Activity activity, String gameId, String connectionId, Map<String,String> authenticationArguments, String[] playerInsightSegments, Callback<Client> callback)

Processes any play links in a given intent. Call this in your url scheme handler activity, if any.

public static String
calcAuth (String userId, String sharedSecret)

Property used to access the AdTrack service Calculate an auth hash for use in the connect method.

public static String
calcAuth256 (String userId, String sharedSecret)

Calculate an auth hash for use in the connect method.

public static void
setUseSecureApiRequests (boolean value)

If true, API Requests will be encrypted using TLS/SSL.

PlayerIO.authenticate

public static void
authenticate (Activity activity, String gameId, String connectionId, Map<String,String> authenticationArguments, String[] playerInsightSegments, Callback<Client> callback)

Processes any play links in a given intent. Call this in your url scheme handler activity, if any.

Arguments

Activity activity
The activity on which to display any authentication dialogs
String gameId
The game id of the game you wish to connect to. This value can be found in the admin panel
String connectionId
The id of the connection, as given in the settings section of the admin panel. 'public' should be used as the default
Map<String,String> authenticationArguments
A dictionary of arguments for the given connection.
String[] playerInsightSegments
Custom segments for the user in PlayerInsight.
Callback<Client> callback
Callback with the client object when connected

PlayerIO.calcAuth

public static String
calcAuth (String userId, String sharedSecret)

Property used to access the AdTrack service Calculate an auth hash for use in the connect method.

Arguments

String userId
The userid to use when generating the hash
String sharedSecret
The shared secret to use when generating the hash. This must be the same value as the one given to a connection in the admin panel.

PlayerIO.calcAuth256

public static String
calcAuth256 (String userId, String sharedSecret)

Calculate an auth hash for use in the connect method.

Arguments

String userId
The userId to use when generating the hash
String sharedSecret
The shared secret to use when generating the hash. This must be the same value as the one given to a connection in the admin panel.

PlayerIO.setUseSecureApiRequests

public static void
setUseSecureApiRequests (boolean value)

If true, API Requests will be encrypted using TLS/SSL.

Arguments

boolean value