下载gdata-src.java-1.41.1.zip,然后写make文件,将它们一起放到android\frameworks\base\core\java\com\google\android\文件夹下面,然后编译android工程。有风险,需要的时间很长。
1. 我用eclipse去编译这份源代码,发现缺失了不少google.common的源文件,需要补齐。
2. android的gdata和google的gdata不完全相同,还需要看一下两者的结构差别才可以去弄,涉及修改gdata的源代码。没有Port过这部分的东西,不能完全帮忙到你了。

解决方案 »

  1.   


    可以先试试将gdata-sample.java-1.41.1.zip中的jar包放到里面,直接编译试试。
      

  2.   

    那就用发送请求的方式做了
    下面是登陆请求的详细介绍 (可以跳过去不看)ClientLogin can be used with any application that can make an HTTPS POST request. The POST request should be structured as a form post with the default encoding application/x-www-form-urlencoded. Parameters should be included in the body of the post. Action URL parameter: https://www.google.com/accounts/ClientLoginParameter Description 
    accountType Type of account to request authorization for. Possible values are:GOOGLE (get authorization for a Google account only) 
    HOSTED (get authorization for a hosted account only) 
    HOSTED_OR_GOOGLE (get authorization first for a hosted account; if attempt fails, get authorization for a Google account)Use HOSTED_OR_GOOGLE if you're not sure which type of account you want authorization for. If the user information matches both a hosted and a Google account, only the hosted account is authorized.  
    Email User's full email address. It must include the domain (i.e. [email protected]). 
    Passwd
     User's password. 
    service Name of the Google service you're requesting authorization for. Each service using the Authorization service is assigned a name value; for example, the name associated with Google Calendar is 'cl'. This parameter is required when accessing services based on Google Data APIs. For specific service names, refer to the service documentation. 
    source Short string identifying your application, for logging purposes. This string should take the form:
    "companyName-applicationName-versionID".  
    logintoken (optional) Token representing the specific CAPTCHA challenge. Google supplies this token and the CAPTCHA image URL in a login failed response with the error code "CaptchaRequired". 
    logincaptcha (optional) String entered by the user as an answer to a CAPTCHA challenge 从这里开始 问题 ????????????????????????????????????其中 service : 
    Name of the Google service you're requesting authorization for. Each service using the Authorization service is assigned a name value; for example, the name associated with Google Calendar is 'cl'. This parameter is required when accessing services based on Google Data APIs. For specific service names, refer to the service documentation. google docs 的service name是什么 ? 是 “writely”吗?这句是我在另一个地方找到的
    The service name for Documents is writely.
      

  3.   

    google docs 的service name是“writely”。这边有所有api的service name,其实你当时点下writely的链接就出来了。
    http://code.google.com/intl/zh-CN/apis/documents/faq_gdata.html#clientlogin
      

  4.   

    恩 这个登陆请求我做出来了, 用
    HttpClient httpclient = new DefaultHttpClient(); 
    //你的URL
    HttpPost httppost = new HttpPost("https://www.google.com/accounts/ClientLogin"); 
    HttpResponse response;能够得到 Auth 
      

  5.   

    但是 用auth发送请求的格式是什么呢?After a successful authentication request, use the Auth value to create an Authorization header for each request:Authorization: GoogleLogin auth=yourAuthValue我是这么做的
    String uriAPI = "https://docs.google.com/feeds/default/private/full"; 
    /*建立HTTP Get对象*/
    HttpGet httpRequest = new HttpGet(uriAPI); 
    try 

    // GoogleLogin auth=  Authorization
    httpRequest.addHeader("GoogleLogin auth", auth);
    /*发送请求并等待响应*/
    HttpResponse httpResponse = new DefaultHttpClient().execute(httpRequest); 
        
    /*若状态码为200 ok*/
    if(httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK)  

    /*读*/
    String strResult = EntityUtils.toString(httpResponse.getEntity());
    /*去没有用的字符*/
    //strResult = eregi_replace("(\r\n|\r|\n|\n\r)","",strResult);
    view_suggest.setText(strResult);
    }但是得到bad request我还试过 httpRequest.addHeader("Authorization", auth); 也是得到 400 bad requestauth = "GoogleLogin auth=" + auth;
    httpRequest.addHeader("Authorization", auth);  
    得到 ssl handshake failure:I/O error during system call, unknown error:0这个 sll handshake failure 和 400 bad request 哪一个更接近正确的请求?????????
      

  6.   

    400  错误请求 — 请求中有语法问题,或不能满足请求。  sll handshake failure看上去是你和服务器建立了链接,只不过没有通过握手验证。看下协议吧,
    http://code.google.com/intl/zh-CN/apis/documents/docs/2.0/developers_guide_protocol.html
      

  7.   


    上面发错了,这个是登陆的建立文档
    http://code.google.com/intl/zh-CN/apis/accounts/docs/AuthForInstalledApps.htmlauth的语句起码是这样的:
    https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fdocs.google.com%2Ffeeds%2F&session=1&secure=0&next=http%3A%2F%2Fwww.example.com%2Fwelcome.html你的auth写得不对。
      

  8.   

    auth的验证在这边:http://code.google.com/intl/zh-CN/apis/accounts/docs/AuthSub.html
      

  9.   

    登陆的建立文档
    http://code.google.com/intl/zh-CN/apis/accounts/docs/AuthForInstalledApps.html
    我就是根据这个写得请求 获得auth
    这是请求的样本
    POST /accounts/ClientLogin HTTP/1.0
    Content-type: application/x-www-form-urlencodedaccountType=HOSTED_OR_GOOGLE&[email protected]&Passwd=north23AZ&service=cl&
       source=Gulp-CalGulp-1.05
    这是返回的格式
    HTTP/1.0 200 OK
    Server: GFE/1.3
    Content-Type: text/plain SID=DQAAAGgA...7Zg8CTN
    LSID=DQAAAGsA...lk8BBbG
    Auth=DQAAAGgA...dk3fA5N
    auth的语句起码是这样的:
    https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fdocs.google.com%2Ffeeds%2F&session=1&secure=0&next=http%3A%2F%2Fwww.example.com%2Fwelcome.html这个地方我是 clientlogin吧 不是web application
    AuthSub for Web Applications
    我的意思是 我是客户端的登录不是通过网页登录的
      

  10.   

    的确没有见到握手,但是在The ClientLogin authorization process这个里面,你可以认为3-6步是在握手吧。仔细的看了下,client的登录,应该是你将
    POST /accounts/ClientLogin HTTP/1.0
    Content-type: application/x-www-form-urlencodedaccountType=HOSTED_OR_GOOGLE&[email protected]&Passwd=north23AZ&service=cl&
       source=Gulp-CalGulp-1.05这些做成一个url。
    另外我想你既然自己去实现登录了,何不去LINUX\android\frameworks\base\core\java\com\google\android\gdata\client下面看看android是如何登录google的账户的,或许比看文档更有用呢。
      

  11.   

    我是在windows下做的 也没有源代码的文件
      

  12.   

    我的csdn个人空间有我的QQ号  牛人 加一下我吧呵呵
      

  13.   


    我就是按照这个做的登录请求 能够等到Auth但是得到Auth后往下做时 请求出问题