public class Swarm
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static SwarmActiveUser |
user |
Constructor and Description |
---|
Swarm() |
Modifier and Type | Method and Description |
---|---|
static void |
addLoginListener(SwarmLoginListener loginListener)
Deprecated.
Please use SwarmLoginManager.addLoginListener()
Add a SwarmLoginListener. The SwarmLoginListener offers access to different stages of the user's login and logout process.
|
static void |
addNotificationDelegate(SwarmNotificationDelegate delegate)
Add a SwarmNotificationDelegate.
|
static void |
enableAlternativeMarketCompatability()
Disables Android Market links from within Swarm.
|
static void |
init(Activity active,
int applicationId,
java.lang.String applicationAuth)
Initializes Swarm.
|
static void |
init(Activity active,
int applicationId,
java.lang.String applicationAuth,
SwarmLoginListener loginListener)
Initializes Swarm.
|
static boolean |
isEnabled()
Checks if Swarm is enabled.
|
static boolean |
isInitialized()
Checks if Swarm is initialized.
|
static boolean |
isLoggedIn()
Checks if the user is logged in.
|
static boolean |
isOnline()
Checks if Swarm is running in online mode for this user.
|
static boolean |
isSwarmEnabled()
Deprecated.
please use Swarm.isEnabled()
Checks if Swarm is enabled. Swarm is enabled if a user has logged in at least one time before (has accepted terms and conditions).
|
static void |
logOut()
Logs the user out of Swarm.
|
static void |
preload(Activity active,
int applicationId,
java.lang.String applicationAuth)
An optional method that can be called prior to init.
|
static void |
removeLoginListener(SwarmLoginListener loginListener)
Deprecated.
Please use SwarmLoginManager.removeLoginListener()
Remove a SwarmLoginListener.
|
static void |
removeNotificationDelegate(SwarmNotificationDelegate delegate)
Remove a SwarmNotificationDelegate.
|
static void |
setAchievementNotificationsEnabled(boolean enabled)
Configure whether or not achievement popup notifications are enabled.
|
static void |
setActive(Activity a)
Gives Swarm a handle to the specified (current) Activity.
|
static void |
setAllNotificationsEnabled(boolean enabled)
Configure whether or not all popup notifications are enabled.
|
static void |
setAllowGuests(boolean allow)
Configure whether or not Swarm will allow users to login with guest accounts.
|
static void |
setInactive(Activity a)
Removes Swarm's handle to the specified (current) Activity.
|
static void |
setLeaderboardNotificationsEnabled(boolean enabled)
Configure whether or not leaderboard popup notifications are enabled.
|
static void |
show(int screenType) |
static void |
showAchievements()
Display the achievements screen to the user.
|
static void |
showDashboard()
Display the dashboard screen to the user.
|
static void |
showGetCoins()
Displays options to the user that allow the user to get more Swarm coins.
|
static void |
showLeaderboards()
Display the leaderboard screen to the user.
|
static void |
showLogin()
Display the Swarm login screen to the user.
|
static void |
showStore()
Display the store screen to the user.
|
public static SwarmActiveUser user
public static void addNotificationDelegate(SwarmNotificationDelegate delegate)
delegate
- public static void removeNotificationDelegate(SwarmNotificationDelegate delegate)
delegate
- public static void addLoginListener(SwarmLoginListener loginListener)
loginListener
- The SwarmLoginListener to be added.public static void removeLoginListener(SwarmLoginListener loginListener)
loginListener
- The SwarmLoginListener to be removed.public static void setActive(Activity a)
a
- The Activity.public static void setInactive(Activity a)
a
- The Activity.public static boolean isOnline()
public static boolean isLoggedIn()
public static boolean isInitialized()
public static boolean isEnabled()
public static void enableAlternativeMarketCompatability()
public static boolean isSwarmEnabled()
public static void preload(Activity active, int applicationId, java.lang.String applicationAuth)
public static void init(Activity active, int applicationId, java.lang.String applicationAuth)
active
- The context of the currently active Activity.applicationId
- The application ID for the application that is using Swarm.applicationAuth
- The application authorization key that corresponds to the application ID.public static void init(Activity active, int applicationId, java.lang.String applicationAuth, SwarmLoginListener loginListener)
active
- The context of the currently active Activity.applicationId
- The application ID for the application that is using Swarm.applicationAuth
- The application authorization key that corresponds to the application ID.loginListener
- The loginListener to be set for the initialization.public static void logOut()
public static void setAllowGuests(boolean allow)
allow
- When true, Swarm will allow users to login with
guest accounts. When false, Swarm will force users to login with
a named account that has a username, password, and email address. If
a user does not have a named account, then the user will be given
the option to create a named account on login.public static void showGetCoins()
public static void showLogin()
public static void showDashboard()
public static void showStore()
public static void showLeaderboards()
public static void showAchievements()
public static void show(int screenType)
public static void setLeaderboardNotificationsEnabled(boolean enabled)
enabled
- True to enable leaderboard notifications, false to disable leaderboard notifications.public static void setAchievementNotificationsEnabled(boolean enabled)
enabled
- True to enable achievement notifications, false to disable achievement notifications.public static void setAllNotificationsEnabled(boolean enabled)
enabled
- True to enable all notifications, false to disable all notifications.