如何有一个从Android手机的读访问google.com/contacts? [英] How to have a read access to google.com/contacts from an android handset?

查看:121
本文介绍了如何有一个从Android手机的读访问google.com/contacts?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid应用程序,我想从google.com/contacts检索生日字段,因为这个领域是不是在Android联系人应用程序同步。 我怎样才能有谷歌联系人的读访问?

In my android application, I would like to retrieve the birthday field from google.com/contacts, as this field isn't synchronised in the android contacts application. How can I have a read access to google contacts ?

我看到谷歌联系人API的中,没有我不得不使用它?哪一个 ?在携带版

I saw the Google contacts APIs, did I have to use it ? which one ? the Portable version ?

或者是有一个简单的方法来读取这些触点,由于Android做的时候有一个同步?

Or is there a simple way to read these contacts, as Android does when there is a synchronisation ?

在此先感谢

推荐答案

曾经是黑客攻击的的AccountManager被reased之前在那里,我开始大约一年前在Android开发组中的线程,但它已被删除。有,你必须通过反射来访问一个未公开的方法。我似乎无法找到它的任何地方,现在,像谷歌已经删除了线程什么的。我发现下面类似的东西,但它不是一个我曾经工作。

There used to be a hack before the AccountManager was reased, I started a thread about a year ago on the android developer group, but it has been removed. There was an undocumented method that you had to access through reflection. I can't seem to find it anywhere now, like google has deleted the thread or something. I found something similar below, but it's not the one I had working.

http://donpark.org/blog/2009/ 1月24日/ Android的客户端,OAuth的

在最坏的情况下,大部分的设备是出来了,应该最终得到2.1。所以,你可以只让他们登录,然后进行验证,并从谷歌的身份验证密钥,如果他们在2.1使用AccountManager和不与凭证打扰他们。类似下面

At worst case, most devices that are out now, should eventual get 2.1. So you could just make them login then validate and get the auth key from google, and if they are on 2.1 use the AccountManager and don't bother them with the credentials. something like below

WebRequest req = HttpWebRequest.Create(
@"https://www.google.com/accounts/ClientLogin?    accountType=GOOGLE&Email=them@gmail.com&Passwd=pass&service=gbase&source=sadboy");
WebResponse resp = req.GetResponse();

string all;
using (StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream()))
    all = sr.ReadToEnd().Trim();

int auth = all.IndexOf("auth=");
string auth = all.Substring(auth, all.Length - auth);

http://developer.android.com/intl/zh-TW/resources/dashboard/platform-versions.html

这篇关于如何有一个从Android手机的读访问google.com/contacts?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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