|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorbotix.achievement.AchievementManager
public class AchievementManager
Achievement manager class for interacting with SpheroWorld and using SpheroWorld achievements Use this class to connect your application to SpheroWorld so that ball stats are tracked and shown on your users' SpheroWorld profiles. Do not create an instance of this class, use the static methods instead.
protected void onStart() {
super.onStart();
AchievementManager.setupApplication("APP_ID_GOES_HERE", "APP_SECRET_GOES_HERE", this);
}
You need to let the achievement manager know when your application enters the background by calling the onPause()
method. Do this by overriding the onPause() method of your main activity.
protected void onStop() {
super.onStop();
AchievementManager.onStop();
}
Field Summary | |
---|---|
static java.lang.String |
AchievementEarnedIntent
Broadcast intent sent when an achievement is earned |
Constructor Summary | |
---|---|
AchievementManager()
|
Method Summary | |
---|---|
static int |
getAccumulatedDistanceSinceLastQuery()
Get the total distance accumulated since the last time this method was called. |
static java.lang.String |
getAppID()
Get the app id for the current app |
static int |
getColorChangesSinceLastQuery()
Get the total number of color changes accumulated since the last time this method was called. |
static void |
onStop()
Should be called in the onStop method of your main activity so AchievementManager can close the database and cleanup properly. |
static void |
recordEvent(java.lang.String eventName)
Call to log events related to earning achievements. |
static void |
recordEvent(java.lang.String eventName,
int count)
Call to log events related to earning achievements. |
static void |
setupApplication(java.lang.String appId,
java.lang.String appSecret,
android.content.Context context)
The main call to setup and authorize your application with SpheroWorld |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String AchievementEarnedIntent
Constructor Detail |
---|
public AchievementManager()
Method Detail |
---|
public static java.lang.String getAppID()
public static void setupApplication(java.lang.String appId, java.lang.String appSecret, android.content.Context context)
appId
- assigned to your app on SpheroWorldappSecret
- assigned to your app on SpheroWorldcontext
- the context of your main activity (used for sending broadcast intents)public static void onStop()
public static void recordEvent(java.lang.String eventName)
eventName
- The event name string associated with the achievement in SpheroWorldpublic static void recordEvent(java.lang.String eventName, int count)
eventName
- The event name string associated with the achievement in SpheroWorldcount
- The number of times the event happenedpublic static int getAccumulatedDistanceSinceLastQuery()
public static int getColorChangesSinceLastQuery()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |