Appucino

Appucino Initialization


  1. Add the following lines of code in onCreate or onStart method of your application's first activity:

  2. Copy to clipboard
     
    //Required for Map based leaderboard to work - Refer Technical Notes
    Appucino.getInstance().setMapAPIKey("YOUR_MAP_API_KEY_HERE");
     
    //change the last parameter to Appucino.APPMODE_LIVE when making live.
     
    Appucino.getInstance().init(APPUCINO_APP_ID,THIS_CLASS.this,
    Appucino.APPMODE_TEST);

  3. In case your application has more than one activity, add the following code those activity's onResume() handlers:

  4. Copy to clipboard
     
    Appucino.getInstance().setContext(THIS_CLASS.this);

Tracking Scores


When the user has completed their game session (i.e. reached the Game Over screen), you need to update the Appucino score variable with the user's score:


Copy to clipboard
 
Appucino.getInstance().updateScore(runsScored,gameMode);
//where runsScored is a Long and gameMode is a String (as defined on the Admin).
 
//Ensure that you use the Mode names you defined in the Admin, when you pass gameMode. If there is no match, the scores will be stored as belonging to the Default game mode.

Capturing Places (Submit Scores)


Integrate the Appucino Capture button on your Game Over screen. (assets available here TODO)


When the Player clicks on the Capture button, call :


Copy to clipboard
 
Appucino.getInstance().doScoreCheckin();

Handle Challenges


Copy to clipboard
 
//To handle the Challenge Callback in this activity use the following method
Appucino.getInstance().setDelegate(new AppucinoDelegate() {
        @Override
        public void startChallenge(final long score, final String mode_id) {
               runOnUiThread(new Runnable() {
                      @Override
                      public void run(){
                      }
               });
        }
});

startChallenge will have two parameters Score and Mode ID.

Inside this method you should do the following:

  • Exit current game session if any.
  • Start a new game session directly with the passed score as target score.

Show the Appucino In-App Bar


  1. Modify your Application's Layout file to support the Appucino Bar:

    To display the in-game Appucino Bar (in pause screen or any other static screens) add one of the following to your game's main layout xml file just before the closing tag of your root element.

    If the root element is RelativeLayout use:


    Copy to clipboard
     
    <LinearLayout android:layout_alignParentBottom="true"
    android:id="@+id/appucinoBar" android:layout_width="fill_parent"
    android:layout_height="wrap_content"></LinearLayout>

    If the root element is FrameLayout use:


    Copy to clipboard
     
    <LinearLayout android:layout_gravity="bottom"
    android:id="@+id/appucinoBar"
    android:layout_width="fill_parent"android:layout_height="wrap_content
    "></LinearLayout>

  2. Add the following after init :

    Copy to clipboard
     
    Appucino.getInstance().addAppucinoBar(findViewById(R.id.appucinoBar));

  3. Show the Appucino App Bar (e.g. on a Game Over screen or Pause screen)
    *should not be called without calling addAppucinoBar previously in the App

    Copy to clipboard
     
    Appucino.getInstance().showAppucinoBar();
     
    //to avoid crashes make sure this is called in the UI Thread

  4. Hide the Appucino App Bar
    *should not be called without addAppucinoBar previously in the App

    Add the following when you need to hide the Appucino in-app bar


    Copy to clipboard
     
    Appucino.getInstance().hideAppucinoBar();
     
    //to avoid crashes make sure this is called in the UI Thread


Other Useful APIs


Appucino.getInstance().isChallengeModeActive();

Returns:

TRUE or FALSE (Boolean)


Description: To check if the user has intiated a challenge from Appucino

Sample UseCase1 : Start the game directly in challenge mode when User starts challenge from other Game/Application

Sample UseCase2 : Update UI to show Target Score in-game

Sample UseCase3 : Update UI to show Challenge result in game end screen



Appucino.getInstance().getChallengeObject();

Returns:

Appucino Score Object (instance of com.appucino.model.Score)

Contains the score, mode_id, username, place_name, etc., of the current Challenge


Description: To check if the user has intiated a challenge from Appucino

Sample UseCase1 : Update UI to show Target Score in-game

Sample UseCase2 : Update UI to show Challenge result in game end screen

  • featured web games

    Ultimate Cricket
    on Web

  • featured web games

    Turbo Cricket Pro
    on Web

  • featured web games

    Heavy Duty Truck Parking
    on Web

  • featured web games

    School Bus Driver
    on Web

  • featured web games

    Race.One
    on Web

  • featured apps

    Turbo Cricket Pro
    on Android

  • featured apps

    Parking Frenzy
    on Android