Usage of unofficial Google Reader API on Android

41 views
Skip to first unread message

bobygerm

unread,
Nov 26, 2010, 9:38:33 AM11/26/10
to Friends of the Unofficial Google Reader API
0 down vote favorite


Hello,

I am trying to develop a Google Reader app for Android. This app was
working fine before today with the following code :

monTransport = GoogleTransport.create();
GoogleHeaders entete = (GoogleHeaders) monTransport.defaultHeaders;
entete.setApplicationName("ActuXml");
entete.gdataVersion = "2";
entete.setGoogleLogin(jeton);
XmlHttpParser parseur = new XmlHttpParser();
parseur.contentType = "text/xml; charset=UTF-8";
parseur.namespaceDictionary = NAMESPACE_DICTIONARY;
monTransport.addParser(parseur);
HttpRequest requete = monTransport.buildGetRequest();
requete.url = new GenericUrl("http://www.google.com/reader/atom/" +
finurl);
try {
flux = requete.execute().parseAs(ReaderItems.class);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

I get a valid token by using the android API 2.0 code :

AccountManager manageurcomptes = AccountManager.get(getBaseContext());
Bundle bundle = manageurcomptes.getAuthTokenByFeatures("com.google",
AUTH_TOKEN_TYPE, null, moi, null, null, null,
null).getResult();
if (bundle.containsKey(AccountManager.KEY_AUTHTOKEN)) {
authJeton = bundle.getString(AccountManager.KEY_AUTHTOKEN);
util = bundle.getString(AccountManager.KEY_ACCOUNT_NAME);

Yesterday this code was working, today it doesn't work anymore. Any
change on the server side for the unofficial Google Reader API ?

ubikdroid

unread,
Nov 26, 2010, 10:55:49 AM11/26/10
to Friends of the Unofficial Google Reader API
Hi Bobby,
If a token stops working it might have timed out. This usually happens
every 2 weeks. You should check the response from the API for HTTP 401
"noauth" error and when its received invalidate the token and get a
new one:

accountManager.invalidateAuthToken("com.google", authToken);

Mark

bobygerm

unread,
Nov 27, 2010, 10:34:26 AM11/27/10
to Friends of the Unofficial Google Reader API
Thank you !

bobygerm

unread,
Nov 30, 2010, 5:07:29 AM11/30/10
to Friends of the Unofficial Google Reader API
If you want to see the result on my app :

https://sites.google.com/site/bobygerm/applications-android/actuxml
Reply all
Reply to author
Forward
0 new messages