gpt4 book ai didi

java - 获取 Gmail 联系人 Android 应用程序

转载 作者:行者123 更新时间:2023-11-30 08:04:11 26 4
gpt4 key购买 nike

我想弄清楚如何在我的 app 中获取 Gmail Contacts

On implementing the code in the link https://developers.google.com/google-apps/contacts/v3/#updating_contacts

我收到以下指定的异常:-

但我得到的异常是 Caused by: java.lang.NullPointerException
com.google.gdata.client.http.HttpGDataRequest.isOAuthProxyErrorResponse

And using the example code on http://androidwarzone.blogspot.in/2011/07/android-oauth-full-example-with-source.html

我得到的异常是:-

 03-07 17:05:21.601: E/AndroidRuntime(18754): java.lang.NoClassDefFoundError: Failed resolution of:                                                                                                                                         Loauth/signpost/commonshttp/CommonsHttpOAuthConsumer;
03-07 17:05:21.601: E/AndroidRuntime(18754): at com.netcomps.oauth_example.RequestTokenActivity.onCreate(RequestTokenActivity.java:32)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.Activity.performCreate(Activity.java:5990)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread.access$800(ActivityThread.java:151)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.os.Handler.dispatchMessage(Handler.java:102)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.os.Looper.loop(Looper.java:135)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread.main(ActivityThread.java:5254)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.reflect.Method.invoke(Native Method)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.reflect.Method.invoke(Method.java:372)
03-07 17:05:21.601: E/AndroidRuntime(18754): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
03-07 17:05:21.601: E/AndroidRuntime(18754): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
03-07 17:05:21.601: E/AndroidRuntime(18754): Caused by: java.lang.ClassNotFoundException: Didn't find class "oauth.signpost.commonshttp.CommonsHttpOAuthConsumer" on path: DexPathList[[zip file "/data/app/com.netcomps.oauth_example-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
03-07 17:05:21.601: E/AndroidRuntime(18754): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
03-07 17:05:21.601: E/AndroidRuntime(18754): ... 14 more
03-07 17:05:21.601: E/AndroidRuntime(18754): Suppressed: java.lang.ClassNotFoundException: oauth.signpost.commonshttp.CommonsHttpOAuthConsumer
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.Class.classForName(Native Method)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
03-07 17:05:21.601: E/AndroidRuntime(18754): ... 15 more
03-07 17:05:21.601: E/AndroidRuntime(18754): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

你能帮帮我吗

任何帮助将深表感谢。

最佳答案

最后,我得到了获取 Google/Gmail 联系人的解决方案。以下链接非常适合回答我的问题。

https://tush.wordpress.com/2014/07/15/android-google-contact-api-3-0-example/

这对我帮助很大。

更新的答案:

由于 Google 阻止了来自 webView 的 oAuth,因此此链接可帮助您获取 gmail 联系人 https://codelabs.developers.google.com/codelabs/appauth-android-codelab/#2

关于java - 获取 Gmail 联系人 Android 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35842866/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com