jjzjj

GoogleApiClient

全部标签

java.lang.IllegalStateException : GoogleApiClient is not connected yet 错误

我正在尝试使用googleplay游戏服务为我的游戏添加成就。我的游戏中负责提供成就的Activity已经扩展了BaseGameActivity并且它在必须提供成就时调用beginUserInitiatedSignIn,因此用户必须登录,但在我为用户解锁成就时,我保持获取“java.lang.IllegalStateException:GoogleApiClient尚未连接”。谁能告诉我我做错了什么?这是负责解锁成就的代码(它在扩展BaseGameActivity的类中,来自BaseGameUtils):privatevoiddarConquistaDerrubouArvore(int

android - 如何使用 GoogleApiClient 为云端点客户端提供凭据

好的,使用GooglePlay服务的GoogleApiClient,我让用户选择一个帐户(如果有多个)并确认我的Android应用程序的oauth权限。我需要这个用于排行榜和其他一些东西。但我也在使用AppEngine后端,需要用它来验证用户。为此,我需要传入用于进行身份验证的emailAccount。在集成GooglePlay服务之前,我手动处理帐户选择,因此我始终可以访问用户选择的电子邮件帐户。但GoogleApiClient会以一臂之力处理该问题。privatevoidsignInToGoogleAccount(){googleApiClient=newGoogleApiClie

android - 注入(inject) GoogleApiClient

我想在我的项目的不同部分注入(inject)Googleapi客户端的实例,但是我没能成功。@Provides@Named("geodata_api")@SingletonGoogleApiClientprovidesGoogleApiClient(Contextcontext){returnnewGoogleApiClient.Builder(context).addApi(Places.GEO_DATA_API).build();}@Provides@Named("location_api")@SingletonGoogleApiClientprovidesGoogleApiCli

android - 卡在与 GoogleApiClient 的连接失败循环中

我正在尝试在我的项目中实现com.google.android.gms.common.api.GoogleApiClient。问题是每次我尝试连接时,我都会将调用返回到onConnectionFailed监听器,其中包含我执行的未决Intent。在全新安装中,第一个待定Intent将启动一个帐户选择屏幕。这是意料之中的。应用程序的每次后续重启都将绕过帐户选择,除非在应用程序管理器中清除应用程序的数据。在帐户选择屏幕之后,登录屏幕将短暂出现。它从不登录。onActivityResult将在登录屏幕闪烁后调用,它会尝试连接客户端。它不连接,并再次调用onConnectionFailed监听

java - Android Studio "class"或 "interface"预期

我正在按照http://developer.android.com/training/location/retrieve-current.html中提供的说明进行操作显示用户位置。但导致上述编译错误。这是我的代码publicclassMainActivityextendsActionBarActivityimplementsGoogleApiClient.ConnectionCallbacks,GoogleApiClient.OnConnectionFailedListener{privateGoogleApiClientmGoogleApiClient;privateLocation

android - GoogleApiClient onConnectionFailed with statusCode=SIGN_IN_REQUIRED

我正在尝试将我的应用程序连接到GooglePlay服务以访问Google云端硬盘,但它显示连接失败,状态代码为SIGN_IN_REQUIRED。但它似乎就在3天前表现得像那样。我也检查了谷歌的开发者控制台。他们可能更改了API中的某些内容,我无法弄清楚。欢迎您的帮助。我的代码:/***CreateanewfileandsaveittoDrive.*/privatevoidsaveFileToDrive(finalbyte[]data){//Startbycreatinganewcontents,andsettingacallback.Log.i(TAG,"Creatingnewcont

android - GoogleApiClient 未配置为使用此调用所需的 API

我正在尝试使用GooglePlacesAPI获取某个地点的纬度和经度。我正在关注这个例子:GoogleDirectionsAndroid我这样配置客户端:mGoogleApiClient=newGoogleApiClient.Builder(this).addApi(Places.GEO_DATA_API).addApi(Places.PLACE_DETECTION_API).addApi(LocationServices.API).addConnectionCallbacks(this).addOnConnectionFailedListener(this).build();但是这里

android - 在 AppCompatActivity 中启用 GoogleApiClient 时遇到问题

尝试按照Google的指南进行基本设置:mGoogleApiClient=newGoogleApiClient.Builder(this).enableAutoManage(this/*FragmentActivity*/,this/*OnConnectionFailedListener*/).addApi(Auth.GOOGLE_SIGN_IN_API,gso).build();OnConnectionFailedListener的第二个“this”失败Wrong2ndargumenttype.Found:'....HomeScreen',required:'com.google.a

android - 使用推送通知 IntentService 中的 GoogleApiClient 将数据发送到 Android Wear

这是一个跟进问题...AndroidWearBundledNotificationsandBackgroundImages我想创建一个AndroidWearGridViewPager布局,它会在收到新的推送通知时创建。下面是我的代码,它在收到新消息时初始化GoogleApiClient连接,这样我就可以将数据发送到wear应用程序,然后创建GridViewPager。我的问题是GoogleApiClient从未获得连接。我已成功运行sdk文件夹中的SynchonizedNotifications示例应用程序,因此我知道我的设备和watch已正确配对。下面是当前代码...publiccl

android - 使用 TabLayout Viewpager 时出现 "Already managing a GoogleApiClient with id 0"异常

我想使用TabLayoutViewPagerFragments集成GoogleSignup。ViewPager包含两个fragmentLoginFragment和RegistrationFragment,并且都包含“Google注册”按钮。问题是我在启动Activity时遇到以下错误。java.lang.IllegalStateException:AlreadymanagingaGoogleApiClientwithid0完整的错误日志-java.lang.IllegalStateException:AlreadymanagingaGoogleApiClientwithid0atcom