问题标签 [android-googleapiclient]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
1596 浏览

android - 如何在限制特定位置的情况下在 android 中使用 google places api?

嘿伙计们,我基本上想创建一个具有自动完成文本视图并根据用户搜索显示位置的应用程序,我只是限制用户只显示印度的城市名称而不是其他城市名称。任何人都可以知道吗?

0 投票
0 回答
694 浏览

android - 致命异常:java.lang.NoClassDefFoundError:com/google/android/gms/internal/zzrl

我正在开发一个使用 GoogleApiClient 获取用户位置的 Android 应用程序。

在开发过程中一切正常。但是在部署之后,一些用户得到了这种类型的错误。我认为这是一个 Android 版本 4.xx 的特定问题。

我在这条线上遇到了异常

0 投票
2 回答
1091 浏览

android - Android 地点选择器样式操作栏

我试图在我的应用程序中使用Place Picker库,但似乎我在 Place Picker 屏幕的样式上遇到了问题。有人能告诉我如何设置这个屏幕的样式吗?它是否可以设置样式?这是我在我的设备上得到的:

在此处输入图像描述

这是我使用的 AppTheme:

编辑:这仅发生在我的带有 android 4.4 的 Note 2 设备上,有人知道解决这个问题吗?

0 投票
1 回答
812 浏览

location-services - 用于多个 API 的 GoogleApiClient

我正在为我的 android 应用程序使用 GooglePlayServices。我将使用 Google+ Api 和 LocationServices Api。因此,根据 Google 的文档,我使用 addApi( Auth.GOOGLE_SIGN_IN_API )、addApi( LocationServices.API ) 构建了GoogleApiClient。每次用户启动应用程序时,我都会使用 Google+ api,但在极少数情况下我会使用 LocationServices(每 100 次启动一次)。那么什么是最好的实施方式。

通过添加两个 Api 创建单个 GoogleApiClient ?或者
分别为这两个 api 创建两个 GoogleApiClient?

0 投票
5 回答
16322 浏览

java - Caused by: java.lang.IllegalStateException: GoogleApiClient is not connected yet

I am getting this error message when trying to implement logout for Google Sign-In for Android:

The crash occurs in DrawerActivity.java (below), where I call the signOut() method.

I've looked at the solutions in other posts and have tried them to no avail:

java.lang.IllegalStateException: GoogleApiClient is not connected yet

GoogleApiClient is not connected yet exception Fatal Exception: java.lang.IllegalStateException GoogleApiClient is not connected yet

MainActivity.java:

In DrawerActivity.java (where I want to perform the sign out)

In my App activity that extends Application (used to store the GoogleApiClient)

StackTrace:

Any help would be appreciated. Thanks!

0 投票
2 回答
135 浏览

android - 当我将数据从 Android Wear 发送到我的 Android 手机时,onConnected() 没有调用

我正在将数据从 Android Wear 发送到 Android 手机


为了建立连接,我在 Wear 的 MainActivity 中使用了下面的代码,但 OnConnected() 方法从未执行,这意味着连接没有发生所以我想知道我们需要在 Wear 的 MainActivity 中编写什么代码,以便在发送数据时将 Android Wear 连接到 Android 设备从磨损到手机。

每当我运行此代码onConnectionFailed时,都会调用此代码并且未建立连接。

我的 Wear 清单文件

用于 Wear 的 Build.gradle 文件

0 投票
1 回答
1593 浏览

dagger-2 - How do you provide a GoogleApiClient dependency with Dagger2?

I've started using Dagger2 to manage dependencies and I'm trying to understand how I can use DI to provide a singleton GoogleApiClient. The motivations for this are:

  • reduce boilerplate code: multiple Activities & Fragments require a GoogleApiClient
  • improve testability: currently these Activities and Fragments are not well tested

I want to provide a Singleton GoogleApiClient at the Application scope.

How do you handle callbacks? Whether you choose an auto-managed or manually-managed connection, there are some callbacks that must be handled:

  • GoogleApiClient.ConnectionCallbacks (manual only)
  • GoogleApiClient.OnConnectionFailedListener (both)
0 投票
0 回答
142 浏览

android - 再次登录时Android google plus登录错误

我已经登录了google plus,但是当我登录成功时,在新的活动中,我注销了,再次登录后,它不是成功登录。日志:ClearcutLoggerApiImpl:断开托管 GoogleApiClient

它是代码:

活动一:登录:

活动二:

0 投票
2 回答
1191 浏览

android - Android Google API 调试应用程序工作但未签名的应用程序

通过使用以下代码,我的 Android 应用程序似乎运行良好:google api 网页

在调试模式下运行时,但一旦我生成了一个签名的 apk,并将应用程序上传到应用商店,应用程序将无法正确登录。有没有办法解决这个问题,甚至调试已安装的应用程序,因为日志不会显示在 android studio 中?非常感谢。

0 投票
4 回答
7417 浏览

android - GoogleApiClient onConnected 未被调用,在服务中使用

当我在 Activity 中使用 GoogleApiClient 但将其移至服务并且未调用 onConnected 时正在工作。

}

有什么想法吗?我究竟做错了什么?有没有人让 GoogleApiClient 在服务中工作?

从 Activity 调用该服务

公共类 MainActivity 扩展 FragmentActivity {

}

在调试期间,我可以看到服务的 onCreate 被调用,但是 onConnected 从未被调用。据我所见,日志中没有什么特别之处。