android - 使用 Google Play 游戏服务获取玩家姓名和图像

标签 android google-play-games

我有一个使用 Google Play 游戏服务 的游戏,我将玩家 ID 存储在我的数据库中。

我知道对于当前登录的玩家,我可以通过以下方式获取名称和图像:

String name = Games.Players.getCurrentPlayer(googleApiClient).getDisplayName();
Uri photo = Games.Players.getCurrentPlayer(googleApiClient).getIconImageUri();

但如果我知道他的玩家 ID,我可以为未登录的玩家获取它们吗?

我不想在数据库中存储玩家姓名和图像,因为玩家可以同时更改它。

最佳答案

听起来像这种方法。

Game.Players.loadPlayer(GoogleApiClient apiClient, String playerId)

Loads the profile for the requested player ID.

关于android - 使用 Google Play 游戏服务获取玩家姓名和图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42589247/

相关文章:

java - 将 textView 转换为 Boolean 以避免类型 Intent 中的 : The method putExtra(String, boolean) 不适用于参数

android - 使用警报管理器安排通知

android - 在 java 中编写 .3ds 或 .obj 加载程序

android - 游戏代理 : Volley error when reporting played

android - 在 Activity 之间保留 Google Play 服务登录

java - AppStateManager 无法解析 - Cloud Save

android - 简化 Android 游戏中的 Facebook 和 Google Play 游戏服务集成

java - 即使 android.bat 存在也无法执行

android - com.google.android.gms :play-services-base compile and runtime collision in react native

android - 如何连接到谷歌播放服务和加载排行榜