凡getApiClient上BaseGameActivity? [英] Where is getApiClient on BaseGameActivity?

查看:144
本文介绍了凡getApiClient上BaseGameActivity?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://developers.google.com/games/services/的谷歌文档安卓/初始化说,

您游戏必须具有为了将GoogleApiClient对象的引用
  作出任何API调用Play游戏服务。在其
  活动的生命周期,你的游戏可以检索GoogleApiClient
  在对象的onCreate()后的任何时间,通过调用getApiClient()。对于
  例如:

Your game must have a reference to the GoogleApiClient object in order to make any API calls to the Play Games services. During its activity's lifecycle, your game can retrieve the GoogleApiClient object at any time after onCreate(), by calling getApiClient(). For example:

Games.Leaderboards.submitScore(getApiClient(),LB_ID,12345);

Games.Leaderboards.submitScore(getApiClient(), LB_ID, 12345);

最初的页面还表示:

该BaseGameActivity类包装GoogleApiClient,减少了建立与谷歌的连接播放服务器和管理用户登录的复杂性。

The BaseGameActivity class wraps the GoogleApiClient, reducing the complexity of setting up a connection with the Google Play servers and managing user sign-in.

不过,我无法找到 getApiClient() BaseGameActivity GameHelper 。这是哪里?

However, I can't find getApiClient() in BaseGameActivity or in GameHelper. Where is it?

推荐答案

BaseGameActivity 是围绕一个包装类 GamesClient的,这是作为pcated 2014年2月7日的德$ p $。

The BaseGameActivity is a wrapper class around GamesClient, which is deprecated as of February 7th, 2014.

您可使用 BaseGameActivity GamesClient的 GoogleApiClient

我觉得文档尚未完成。这是从昨天。

I think the documentation isn't finished yet. It's from yesterday.

要使用 GoogleApiClient 请参阅

https://developers.google.com/games/services/training/signin#signing_the_player_in_at_startup

这篇关于凡getApiClient上BaseGameActivity?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆