如何访问固定用户';通过android中的Picasa API获取数据

如何访问固定用户';通过android中的Picasa API获取数据,android,picasa,google-api-java-client,Android,Picasa,Google Api Java Client,我正在编写一个android应用程序,它将访问用户(功能帐户)的照片。 如果可能,甚至硬编码功能帐户id和密码也可以。不需要最终用户交互 无法使用谷歌数据api,因为android不支持 因此,我发现的最接近的东西是单用户“安装”客户端身份验证 在里面 要使用ClientLogin(也称为“已安装应用程序的身份验证”),请创建PicasawebService对象,然后调用setUserCredentials方法来设置用户ID和密码 PicasawebService myService = new

我正在编写一个android应用程序,它将访问用户(功能帐户)的照片。 如果可能,甚至硬编码功能帐户id和密码也可以。不需要最终用户交互

无法使用谷歌数据api,因为android不支持 因此,我发现的最接近的东西是单用户“安装”客户端身份验证 在里面 要使用ClientLogin(也称为“已安装应用程序的身份验证”),请创建PicasawebService对象,然后调用setUserCredentials方法来设置用户ID和密码

PicasawebService myService = new PicasawebService("exampleCo-exampleApp-1"); 
myService.setUserCredentials("liz@gmail.com", "mypassword");
API控制台中没有Picasa服务。

同时,当我尝试使用OAuth2.0时,它是不可用的

我想知道Picasa应该很受欢迎,做这样简单的访问最好的方法是什么

官方picasa atom oauth样本

是我找到的官方picasa atom oauth样本。有一个定制的回调服务器类,但是它似乎在利用浏览器获取令牌。是否可以硬编码其中的密码

我看了,似乎令牌上也有问题。
是否有人成功使用了oauth2:https://picasaweb.google.com/data/“如建议的那样?

最后,在谷歌搜索了更多的示例后,旧客户端登录是一个不错的选择

我使用了谷歌api客户端1.10.1-beta

  private static String getTokenByAuthenticatingWithClientLogin(HttpTransport transport) throws IOException {
    ClientLogin authenticator = new ClientLogin();
    authenticator.authTokenType = "lh2";
    authenticator.username = "username";
    authenticator.password = "password";
    authenticator.transport = transport;
    return authenticator.authenticate().getAuthorizationHeaderValue();
  }
在标头中设置标记

GoogleHeaders headers = new GoogleHeaders();
headers.setApplicationName("APOD/1.0");
headers.setGDataVersion("2");
  String token = getTokenByAuthenticatingWithClientLogin(transport);
  headers.setAuthorization(token);

然后使用com.google.api.client.http.HttpRequestFactory来构造请求。

共享一些代码,这对我非常有用。我找不到
googleapi客户端1.10.1_beta
给我链接。我们有任何例子分享给我。。。