PlayerIO

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

Android Client Reference

Android  class documentationClass Achievements

Namespace: com.playerio
Language: Java

The Player.IO Achievements service

Methods

 
public Achievement
get (String achievementId)

This method gets the specified achivement

public Achievement[]
getMyAchievements ()

The list of all achievements; the values of Progress and ProgressGoal will indicate whether the achievement is started/pending/complete.

public void
load (List<String> userIds, Callback<Map<String,Achievement[]>> callback)

Load achievements for the specified users.

public void
progressAdd (String achievementId, int progressDelta, Callback<Achievement> callback)

Add or subtract from the current progress of an achievement.

public void
progressComplete (String achievementId, Callback<Achievement> callback)

Complete the specified achievement, by setting the progress to the maximum (ProgressGoal) of the achievement.

public void
progressMax (String achievementId, int progress, Callback<Achievement> callback)

Sets the current progress value to the bigger value of progress or the current value, i.e; newProgress = Max(currentProgress,progress)

public void
progressSet (String achievementId, int progress, Callback<Achievement> callback)

Sets the progress of the specified achievement.

public void
refresh (Callback<Void> callback)

Refreshes MyAchievements public void refresh() throws PlayerIOError { refreshed(channel.achievementsRefresh(version)); } Refreshes MyAchievements

public void
removeAchievementCompletedHandler ()

Remove a handler to the OnComplete event

public void
setAchievementCompletedHandler (AchievementCompletedEventHandler onComplete)

Set a handler to the OnComplete event

Achievements.get

public Achievement
get (String achievementId)

This method gets the specified achivement

Arguments

String achievementId
The id of the achivement to get

Achievements.getMyAchievements

public Achievement[]
getMyAchievements ()

The list of all achievements; the values of Progress and ProgressGoal will indicate whether the achievement is started/pending/complete.

Achievements.load

public void
load (List<String> userIds, Callback<Map<String,Achievement[]>> callback)

Load achievements for the specified users.

Arguments

List<String> userIds
Array of userIds to load achievements for.
Callback<Map<String,Achievement[]>> callback
Callback that will be called with a dictionary where the keys are userIds and the values are their achievements.

Achievements.progressAdd

public void
progressAdd (String achievementId, int progressDelta, Callback<Achievement> callback)

Add or subtract from the current progress of an achievement.

Arguments

String achievementId
The id of the achievement to add progress to.
int progressDelta
The delta value that will be added to the current progress of the achievement.
Callback<Achievement> callback
Callback that will be called with the updated Achievement.

Achievements.progressComplete

public void
progressComplete (String achievementId, Callback<Achievement> callback)

Complete the specified achievement, by setting the progress to the maximum (ProgressGoal) of the achievement.

Arguments

String achievementId
The id of the achievement to complete.
Callback<Achievement> callback
Callback that will be called with the updated Achievement.

Achievements.progressMax

public void
progressMax (String achievementId, int progress, Callback<Achievement> callback)

Sets the current progress value to the bigger value of progress or the current value, i.e; newProgress = Max(currentProgress,progress)

Arguments

String achievementId
The id of the achievement to work on.
int progress
The possible new progress value that should be compared to the current progress value
Callback<Achievement> callback
Callback that will be called with the updated Achievement.

Achievements.progressSet

public void
progressSet (String achievementId, int progress, Callback<Achievement> callback)

Sets the progress of the specified achievement.

Arguments

String achievementId
The id of the achievement to add progress to.
int progress
The new progress value for the achievement.
Callback<Achievement> callback
Callback that will be called with the updated Achievement.

Achievements.refresh

public void
refresh (Callback<Void> callback)

Refreshes MyAchievements public void refresh() throws PlayerIOError { refreshed(channel.achievementsRefresh(version)); } Refreshes MyAchievements

Arguments

Callback<Void> callback
Callback that will be called when the refresh is complete.

Achievements.removeAchievementCompletedHandler

Remove a handler to the OnComplete event

Achievements.setAchievementCompletedHandler

public void
setAchievementCompletedHandler (AchievementCompletedEventHandler onComplete)

Set a handler to the OnComplete event

Arguments

AchievementCompletedEventHandler onComplete