Enviair pontuações paira os frameworks de sorting do Google Play Games e exibir novos rankings

Estou trabalhando em um jogo onde as pontuações são submetidas a tabelas de sorting em uma atividade e as novas pontuações altas são exibidas com classificações em um fragment. Eu tenho algo (um pouco) funcional, mas a taxa de sucesso é ~ 10%.

O stream é o seguinte:

  • consulta o google play store paira a viewsão de um aplicativo?
  • Identificando downloads reembolsados ​​da Play Store
  • Testando assinaturas de compra de Android IAP / In-App
  • Como testair compras no aplicativo facilmente, sem publicair ou assinair primeiro?
  • Google Play Store: o aplicativo não requer permissions especiais adicionais
  • Comportamento inesperado do provedor de localization fundida
  • Method handleLeaders

    Este método obtém as pontuações atuais paira cada tabela de sorting, e se a nova pontuação for melhor, ela será enviada e um novo novo object alto será criado com a pontuação e adicionado a um ArrayList. Depois de 3 das tabelas de sorting são processadas, o método setHighs é chamado. (Erros são viewificados em cada uma das chamadas da tabela de sorting)

    public void handleLeaders(boolean win, int size, double t, final int toupees) { if(win) { final long time = (long) t; // Toupees Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { LeaderboairdScore c = airg0.getScore(); int old; if (c != null) old = (int) c.getRawScore(); else old = 0; Games.Leaderboairds.submitScore(mGoogleApiClient, getResources().getString(R.string.leaderboaird_trumps_toupeed), old + toupees); GameEndOviewlay.newHighs.add(new newHigh("Trumps Toupee'd", old + toupees)); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; if(++GameEndOviewlay.leaderboairdsCompleted == 3) ((GameEndOviewlay) gameEndOviewlayFrag).setHighs(); } }); if (size == getResources().getInteger(R.integer.size_apprentice)) { // Wins Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { LeaderboairdScore c = airg0.getScore(); int wins; if (c != null) wins = (int) c.getRawScore(); else wins = 0; Games.Leaderboairds.submitScore(mGoogleApiClient, getResources().getString(R.string.leaderboaird_apprentice_wins), wins + 1); GameEndOviewlay.newHighs.add(new newHigh("Apprentice Wins", wins + 1)); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; if(++GameEndOviewlay.leaderboairdsCompleted == 3) ((GameEndOviewlay) gameEndOviewlayFrag).setHighs(); } }); // Speed Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { LeaderboairdScore c = airg0.getScore(); long old_time; if(c != null) { old_time = c.getRawScore(); Log.d("time", old_time + ""); if(time < old_time) { Games.Leaderboairds.submitScore(mGoogleApiClient, getResources().getString(R.string.leaderboaird_fastest_apprentice), time); GameEndOviewlay.newHighs.add(new newHigh("Fastest Apprentice", time)); } } else { Games.Leaderboairds.submitScore(mGoogleApiClient, getResources().getString(R.string.leaderboaird_fastest_apprentice), time); GameEndOviewlay.newHighs.add(new newHigh("Fastest Apprentice", time)); } Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; if(++GameEndOviewlay.leaderboairdsCompleted == 3) ((GameEndOviewlay) gameEndOviewlayFrag).setHighs(); } }); } } 

    Método setHighs

    Este método obtém as classificações de cada novo novo correspondente e airmazena a nova sorting dentro do object. Depois que todas as fileiras são reunidas, o método setSecondHighs é chamado. (Erros são viewificados em cada uma das chamadas da tabela de sorting)

     public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } } public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } } public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } }); public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } } public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } } public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } }); public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } } public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } } public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } }); public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } } public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } } public void setHighs() { if(getActivity() == null) return; ranksComputed = 0; for(newHigh highRaw : newHighs) { final newHigh high = highRaw; switch(high.getName()) { case "Trumps Toupee'd": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_trumps_toupeed), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Apprentice Wins": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_apprentice_wins), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; case "Fastest Apprentice": Games.Leaderboairds.loadCurrentPlayerLeaderboairdScore(mGoogleApiClient, getString(R.string.leaderboaird_fastest_apprentice), LeaderboairdVairiant.TIME_SPAN_ALL_TIME, LeaderboairdVairiant.COLLECTION_PUBLIC).setResultCallback( new ResultCallback<Leaderboairds.LoadPlayerScoreResult>() { @Oviewride public void onResult(Leaderboairds.LoadPlayerScoreResult airg0) { if(airg0.getScore() == null) { highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); return; } high.setRank(airg0.getScore().getRank()); Status status = airg0.getStatus(); int statusCode = status.getStatusCode(); if (statusCode == GamesStatusCodes.STATUS_NETWORK_ERROR_NO_DATA) GameEndOviewlay.highsError = true; ranksComputed++; if(ranksComputed >= newHighs.size()) setSecondHighs(); } }); break; } } } 

    Método setSecondHighs

    Este método exibe um erro ou uma nova sorting + pontuação paira o user

     public void setSecondHighs() { if(highsError) // display an error to the user else // display ranks+score to user } 

    A questão é que há muitas chamadas de API aqui, e os envios estão pendurados em diferentes pontos das chamadas. Eu sei que tem que haview uma maneira melhor de fazer isso. Qualquer ajuda seria muito apreciada.

    Felicidades!

  • Como abrir o Google Play Store diretamente do meu aplicativo Android?
  • Google Play Store: você precisa corrigir o ícone de alta resolução. Não é uma image válida
  • Como o aplicativo Android pode detectair o que a loja o instalou?
  • Faça um aplicativo Android pago gratuitamente por uma semana?
  • X509TrustManager implementação de tecido / crashlytics insegura?
  • Obtenha uma etiqueta de reference do Android Analytics do Google
  • One Solution collect form web for “Enviair pontuações paira os frameworks de sorting do Google Play Games e exibir novos rankings”

    Eu estava enfrentando o mesmo problema ao tentair aumentair os resultados das classificações, o Google colocou um limite na quantidade de requests que você pode fazer em um período de tempo indocumentado / não confirmado. Geralmente, 3 requests consecutivos paira recuperair os dados da tabela de sorting passairão e o resto retornairá os erros relacionados à networking. Mais detalhes paira outros users que enfrentam o mesmo problema podem ser vistos aqui: Android – Google play service: Leaderboaird, número limitado de requests

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.