w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to fetch players that connected to game in Android using Google game service?

i got my Answer by this i can fetch My recent Game Players.

PendingResult<Players.LoadPlayersResult> loadplayers =
Games.Players
         .loadMoreRecentlyPlayedWithPlayers(mGoogleApiClient, 20);
loadplayers.setResultCallback(new
ResultCallback<Players.LoadPlayersResult>() {

    @Override
    public void onResult(LoadPlayersResult loadplayersResult) {

        if (loadplayersResult != null) {
            if (loadplayersResult.getStatus().getStatusCode() ==
GamesStatusCodes.STATUS_OK) {
                if (loadplayersResult.getPlayers() != null) {
                    PlayerBuffer plyersBufr =
loadplayersResult.getPlayers();
                    for (Player p : plyersBufr) {
                        Log.d(TAG, p.getDisplayName() + "  " +
p.getTitle()+"  "
                                    + p.getLastPlayedWithTimestamp() + "  "
+ p.getLevelInfo());
                    }
                }
            }
        }
    }
});

anyway thanks :)





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.