Google Api Client interface methods explanation?

315
February 10, 2017, at 07:52 AM
    @Override
public void getLeaderboardGPGS() {
    if (gameHelper.isSignedIn()) {
        startActivityForResult(Games.Leaderboards.getLeaderboardIntent(gameHelper.getApiClient(), getString(R.string.event_score)), 100);
    }
    else if (!gameHelper.isConnecting()) {
        loginGPGS();
    }
}
@Override
public void getAchievementsGPGS() {
    if (gameHelper.isSignedIn()) {
        startActivityForResult(Games.Achievements.getAchievementsIntent(gameHelper.getApiClient()), 101);
    }
    else if (!gameHelper.isConnecting()) {
        loginGPGS();
    }
}

Hi folks, can anyone explain to me what these methods do. I have them as part of implementing a GoogleApi interface I made as part of a tutorial. I especially don't understand the 100 / 101 parts, but really the whole thing in general is quite confusing for me.

PS. im making a game in LibGDX and this is my first time touching the Google Play API (or I think any API for that matter)

Answer 1

First Method getLeaderboardGPGS show you Leaderboard above your Activity if you are already Signed in otherwise it start signing process.

Above method definition is from Libgdx wiki but it should be

private final static int REQUEST_CODE_UNUSED = 9002;
startActivityForResult(Games.Leaderboards.getLeaderboardIntent(gameHelper.getApiClient(), getString(R.string.leaderboardId)), REQUEST_CODE_UNUSED);

taken from Google wiki

Second Method getAchievementsGPGS start Activity over your game Activity and show Achievement

READ ALSO
'internal error' while setting Configuration file in Hibernate

'internal error' while setting Configuration file in Hibernate

I am getting the error displaying "'Update LCD has encountered a problem' - An internal error has occurred" while trying to setup the configuration file in HibernateWhat could be the reason?

353
Warning relied on Caller-Allowable-Codebase attirbute not shown always

Warning relied on Caller-Allowable-Codebase attirbute not shown always

I have the following manifest information in the signed Java appletMy build environment is old and is currently restricted to JDK 1

241
BigDecimal output does not contain precise decimal values?

BigDecimal output does not contain precise decimal values?

Practice problem using BigDecimal for the first timeMy main method output should be:

280
Java To C# Via Soap Web Service Passing Wrong Date Value

Java To C# Via Soap Web Service Passing Wrong Date Value

I have a web service written in C# deployed on a windows serverOne of the services(Generate Letter) accepts a C# "DateTime" request parameter

275