Google play游戏排行榜

無論 2020 年是好是壞,這些應用程式和遊戲都幫助我們適應轉變,並在有需要時助我們逃離煩憂。匯聚啟發性、娛樂性與想像力,為您推介 2020 年 Google Play 最佳排行榜。

年度最佳应用

Medito: Meditation & Sleep

4.9

格志日记

4.4

Whisk: Recipes & Meal Planner

4.5

好眠 - 助眠冥想白噪音与专业睡眠监测

4.3

The Pattern Astrology

4.2

Zoom云视频会议

4.1

VITA - Video Editor & Maker

4.3

Reface: 视频照片人脸面部互换制作编辑器

4.2

Dolby On: Record Audio & Music

4.4

Instories: Instagram 故事,拼贴制作工具

4.5

Bazaart百色特:照片编辑器和设计

4.6

Loóna: Bedtime Calm & Relax

4.6

Explorest — Photo Locations

2.8

Violin by Trala – Learn violin

4.7

行影勾绘

4.3

Cappuccino

3.7

Redbubble

3.4

Sleep & Meditation : Wysa

4.6

Co–Star Personalized Astrology

4.7

Paired: Couples & Relationship

4.2

年度最佳遊戲

烹饪之星:亚洲烹饪比赛

4.4

波古波古

4.6

曲奇必死

4.4

Find Out: 寻找隐藏物品

4.3

Hide 'N Seek!

3.8

神枪手强尼 (Johnny Trigger) - 射击游戏

4.5

Maze Machina

4.1

极简地下城 RPG

4.5

Motorsport Manager Racing

4.1

宝丽星辰: 王子故事

4.6

Rocky Rampage: Wreck 'em Up

4.3

Sandship: Crafting Factory

4.6

The Wild Darkness

4.5

口袋奇兵-超休闲的策略游戏

4.4

Magic Survival

4.6

Death Palette

4.9

人生画廊

3.7

实况旅人 Subscribe to My Adventure

4.0

使用集合让一切井井有条 根据您的偏好保存内容并对其进行分类。

本指南介绍了如何在 Android 应用中使用排行榜 API 来创建直观的排行榜、记录玩家得分,以及将玩家的最新得分与他们在之前游戏会话中的得分进行比较。这些 API 可在 com.google.android.gms.gamescom.google.android.gms.games.leaderboards 软件包中找到。

准备工作

请阅读排行榜游戏概念(如果您尚未执行此操作)。

开始使用排行榜 API 进行编码之前,请执行以下操作:

  • 按照设置 Google Play 服务 SDK 指南中的说明安装并设置应用,以使用 Google Play 游戏服务。

  • 按照 Google Play 管理中心指南中的说明,定义您希望在游戏中显示或更新的排行榜。

  • 在 GitHub 的 Android 示例页面中下载并查看排行榜代码示例。

  • 熟悉质量核对清单中所述的建议。

获取排行榜客户端

如需开始使用排行榜 API,您的游戏必须先获取一个 LeaderboardsClient 对象。为此,您可以调用 Games.getLeadeboardsClient() 方法并传入 activity。

更新玩家得分

当玩家得分发生变化时(例如,玩家完成游戏时),游戏可以在排行榜上更新玩家得分,具体做法是调用 LeaderboardsClient.submitScore() 并传入排行榜 ID 和原始得分值。

以下代码段展示了应用如何更新玩家得分:

PlayGames.getLeaderboardsClient(this)
    .submitScore(getString(R.string.leaderboard_id), 1337);

最好在 strings.xml 文件中定义排行榜 ID,以便游戏按资源 ID 引用排行榜。在进行调用以更新和加载玩家得分时,请务必遵循相关最佳实践,以免超出您的 API 配额。

显示排行榜

如需显示排行榜,请调用 LeaderboardsClient.getLeaderboardIntent() 来获取 Intent,以便创建默认排行榜界面。然后,您的游戏可以通过调用 startActivityForResult 启动界面。

以下代码段展示了应用如何更新玩家得分。在该代码段中,RC_LEADERBOARD_UI 是请求代码的任意整数。

private static final int RC_LEADERBOARD_UI = 9004;

private void showLeaderboard() {
  PlayGames.getLeaderboardsClient(this)
      .getLeaderboardIntent(getString(R.string.leaderboard_id))
      .addOnSuccessListener(new OnSuccessListener<Intent>() {
        @Override
        public void onSuccess(Intent intent) {
          startActivityForResult(intent, RC_LEADERBOARD_UI);
        }
      });
}

即使系统未返回任何结果,您也必须使用 startActivityForResult,以便 API 获取发出调用的软件包的身份。默认排行榜界面的示例如下所示。

Google play游戏排行榜

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2022-08-01 UTC.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"没有我需要的信息" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"太复杂/步骤太多" },{ "type": "thumb-down", "id": "outOfDate", "label":"内容需要更新" },{ "type": "thumb-down", "id": "translationIssue", "label":"翻译问题" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"示例/代码问题" },{ "type": "thumb-down", "id": "otherDown", "label":"其他" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"易于理解" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"解决了我的问题" },{ "type": "thumb-up", "id": "otherUp", "label":"其他" }]