Home > Services & APIs > Engage > GameCircle

Implementing Achievements

Step 1: Send an Achievement Update

After initializing Amazon GameCircle in your game, you can submit achievement progress updates to the service.

The second input parameter to the updateProgress method is a floating-point value representing the player’s completion percentage for the achievement. The valid range of this parameter is 0.0 to 100.0, where 0.0 represents fully locked and 100.0 represents fully unlocked. Completion percentage can only increase. If the method submits a completion percentage value that is lower than the current value, the completion percentage shown for that achievement will not change. 

// Replace YOUR_ACHIEVEMENT_ID with an actual achievement ID from your game.
AchievementsClient acClient = agsClient.getAchievementsClient();
AGResponseHandle<UpdateProgressResponse> handle = acClient.updateProgress(YOUR_ACHIEVEMENT_ID, 100.0f);

// Optional callback to receive notification of success/failure.
handle.setCallback(new AGResponseCallback<UpdateProgressResponse>() {

   public void onComplete(UpdateProgressResponse result) {
       if (result.isError()) {
           // Add optional error handling here.  Not strictly required
           // since retries and on-device request caching are automatic.
       } else {
           // Continue game flow.

Step 2: Add a Link to the Achievement Overlay in Your Game

To help customers find their achievements, make sure to add a link somewhere in your game to the in-game overlay.

Button btnAchievementsOverlay;
btnOpenAchievementsOverlay.setOnClickListener(new OnClickListener() {

    public void onClick(View v) {

Use a Handle to Control Game Flow While Downloading an Achievement Icon

AGResponseHandle<LoadIconResponse> loadIconHandle = acClient.loadIcon(YOUR_ACHIEVEMENT_ID, IconSize.LARGE, true, null);

public void loadIconHandler(AGResponseHandle<LoadIconResponse> loadIconHandle)
    while(loadIconHandle.getStatus() == AGHandleStatus.WAITING)
        // Show a spinner animation
    LoadIconResponse response = loadIconHandle.getResponse();
    if (response != null)
        byte[] image = response.getImage();
        // Do something with the image

Control Placement of Achievement Toasts

You can control the placement of achievement toasts in your game.

The possible PopUpLocation values are listed here:




The default location is BOTTOM_CENTER.

To turn off all toasts in your game except for welcome toasts, execute the following:


Welcome toasts are always BOTTOM_CENTER.