Goodreads Developers discussion

1390 views
examples / showcase > GoodReads Android App

Comments Showing 1-50 of 72 (72 new)    post a comment »
« previous 1

message 1: by Adam (new)

Adam (jademason) | 66 comments I've been working on a GoodReads client for Android. I've published a very early rev here:

http://code.google.com/p/goodreads/

It is very rough around the edges, but I'm eager to hear what folks would like to see in a client. I'm also curious as to what would qualify as a commercial effort with regards to the terms of service for the API (i.e. if I added an ad bar at the bottom, would it be considered commercial?).

Some features I hope to add soon:

- Post an update.
- Add / Move books on shelves
- Rate a book
- Review a book.

Any and all feedback is appreciated.

Thanks!


message 2: by Adam (new)

Adam (jademason) | 66 comments Currently the app force stops after the initial oauth exchange, but subsequent runs work fine. Is there a way to perform the authentication by getting the username and pass from the user, or is displaying the oauth authorization page the only option?


message 3: by Michael (new)

Michael Economy (michaeleconomy) Adam wrote: "Currently the app force stops after the initial oauth exchange, but subsequent runs work fine. Is there a way to perform the authentication by getting the username and pass from the user, or is di..."

Oauth is required, for security.


message 4: by Michael (new)

Michael Economy (michaeleconomy) I'm checking in regard to ads, I don't remember if we've made a decision on that yet.


message 5: by Adam (new)

Adam (jademason) | 66 comments Thanks for the quick feedback Michael!

Is there any documentation for all of the response possibilities from the API? The API page gives a great description of all the requests and request options, but I didn't see anything on the responses. I want to be sure that I am covering all potential cases (for instance, all possible object types in an update element).


message 6: by Michael (new)

Michael Economy (michaeleconomy) We try and use pretty standard http response codes, but you should definetly have a catch all.


message 7: by Otis (new)

Otis Chandler | 18 comments We define commercial as if you are charging someone to use your app. So if it's free to download/use and you are just monetizing on ads or affiliate, you are fine.


message 8: by Adam (new)

Adam (jademason) | 66 comments That is great news, thanks Otis!


This Is Not The Michael You're Looking For Adam, I tried to install your app to take a look and it simply says that it cannot install (no explanation given). Are there OS restrictions?


message 10: by Adam (new)

Adam (jademason) | 66 comments I had it set to target 2.1. I fixed the force close on oauth and retargeted to 1.5. I'll post that install shortly.


message 11: by Adam (new)

Adam (jademason) | 66 comments Posted an updated installer that no longer force closes after using the Login screen. Also modified the settings to require android 1.5 rather than 2.1. I've been testing on a Moto DROID v1 with Froyo. This_Is_Not_The_Michael - what device are you using? I'll setup a virtual device to simulate yours to see if I can reproduce any issues you are seeing.


This Is Not The Michael You're Looking For MyTouch 3G running 1.6 (I no longer believe the promised 2.2 update will ever actually occur, but haven't broken down to root it yet).

There is a competing Goodreads app for android on my phone...could that be causing the problem? The apk is completely different, but does the app name have to be unique?


This Is Not The Michael You're Looking For Oh...and the new version you loaded still won't install.


message 14: by Adam (new)

Adam (jademason) | 66 comments This Is Not The Michael You're Looking For wrote: "MyTouch 3G running 1.6 (I no longer believe the promised 2.2 update will ever actually occur, but haven't broken down to root it yet).

There is a competing Goodreads app for android on my phone......"


That's a great question. I'll check the docs to see if it might cause issues, but I suspect since the package names are different (mine is com.onesadjam.GoodReads), they should not conflict.

I updated the apk on the project site. You may need to hit menu and logon/logout if you don't get prompted to authorize the app right away.


message 15: by Adam (new)

Adam (jademason) | 66 comments This Is Not The Michael You're Looking For wrote: "Oh...and the new version you loaded still won't install."

Fixed the manifest to allow installation on 1.5 and later. I setup a virtual device running 1.6 and it installed. Let me know if this still gives you an error.

Thanks!


This Is Not The Michael You're Looking For Hmmm...still not working.

"Application not installed: GoodReads could not be installed on this phone."

Wish I could guess what the problem was.


message 17: by Adam (new)

Adam (jademason) | 66 comments This Is Not The Michael You're Looking For wrote: "Hmmm...still not working.

"Application not installed: GoodReads could not be installed on this phone."

Wish I could guess what the problem was."


Hmm, sorry for the frustration.

The app requires
- SD Card Access
- Sense Phone State
- Internet Access

In the phone application settings you must enable installation from unknown sources.

What is the other GoodReads app you have installed? I can try installing that on the emulator and see if I get a conflict as well.


This Is Not The Michael You're Looking For It's not the unknown sources issue. And I get past the "approval" stage for the app. After that it puts up the progress bar with "Installing" runs for a few seconds, then quits with the message from #16.

The other app can be found at http://github.com/caspergasper/Gready...


message 19: by Adam (new)

Adam (jademason) | 66 comments This Is Not The Michael You're Looking For wrote: "It's not the unknown sources issue. And I get past the "approval" stage for the app. After that it puts up the progress bar with "Installing" runs for a few seconds, then quits with the message fro..."

I'm stumped. I can install in the emulator without issue, regardless of whether Casper's (very nice) app is installed or not. I uploaded a new apk that is targeted at 1.6 and is marked to handle various screen densities. It is a shot in the dark, but maybe this will help?


message 20: by Adam (new)

Adam (jademason) | 66 comments I have modified the name of the app to YAGRAC - Yet Another GoodReads Android Client in order to comply with the API terms. The project hosting site has moved here:

http://code.google.com/p/yagrac/

If you have installed the previous version, please uninstall it prior to installing this one.


This Is Not The Michael You're Looking For Adam, not sure which part fixed it but the program now installs! I'm having a little bit of a problem logging into GoodReads, but I'm pretty sure that has nothing to do with the client and everything to do with GoodReads and/or some password problems I had a few weeks ago. When I get a chance I'll play with it a bit and let you know what I think.


message 22: by Adam (new)

Adam (jademason) | 66 comments This Is Not The Michael You're Looking For wrote: "Adam, not sure which part fixed it but the program now installs! I'm having a little bit of a problem logging into GoodReads, but I'm pretty sure that has nothing to do with the client and everythi..."

That's great news! I'm still curious what it was that caused it not to install (possibly screen density issues?) but I'm glad it is working now.


message 23: by Adam (new)

Adam (jademason) | 66 comments My app is now available from the Android Market.
Searching for either GoodReads or YAGRAC will find it.


message 24: by Michael (new)

Michael Economy (michaeleconomy) FYI:

Offical capitalization is "Goodreads" not "GoodReads" or "goodreads".


It took me a year an a half of working here to get this right.


message 25: by Adam (new)

Adam (jademason) | 66 comments MICHAEL wrote: "FYI:

Offical capitalization is "Goodreads" not "GoodReads" or "goodreads".


It took me a year an a half of working here to get this right."


Wow, I never knew! Thanks for the tip, Michael, I will update the text in my app to match that casing.


message 26: by Michael (new)

Michael Economy (michaeleconomy) :D Otis will be thrilled.


message 27: by Jeremy (new)

Jeremy | 1 comments It looks like it'll be pretty great. I've installed both this and Casper's. This is better from a full collection management perspective.

However, I'm going to need to use both until YAGRAC can use barcode scanning to add books to shelves more simply (just using ZXing is fine), which is what I'd tell folks when they ask me about GR & Android: Get both.

I'll put together some specs on how I would think it would work, and use case scenarios that'd be helpful over on your Issues Tracker.


message 28: by Adam (new)

Adam (jademason) | 66 comments Jeremy wrote: "It looks like it'll be pretty great. I've installed both this and Casper's. This is better from a full collection management perspective.

However, I'm going to need to use both until YAGRAC ca..."


Thanks! I'll keep on eye on the issues board for those items. I'd really like to be able to integrate with Google Goggles, but I don't think there are published intents for that app.


message 29: by Adam (new)

Adam (jademason) | 66 comments Published rev 1.1 of YAGRAC which includes ability to search for a book by scanning the barcode.


message 30: by This Is Not The Michael You're Looking For (last edited Sep 08, 2010 10:39AM) (new)

This Is Not The Michael You're Looking For I'm having problems getting YAGRAC authorized by Goodreads. I click login, get taken to the Goodreads authorization page, log in there, press the "Allow access" button...and am returned to the YAGRAC login page. There is a very brief message which says "authorized request token or token not set. Did you receive (request?) an authorized token before?"

Any idea why it won't let me authorize?


message 31: by Adam (new)

Adam (jademason) | 66 comments Try uninstalling both YAGRAC, and if you have it, the first app (com.onesadjam.goodreads). Also, when you uninstall if you are given the option to clear out the user data for the app, do that as well. I saw an issue when moving from the old app to YAGRAC that resulted in mismatched data in the cache, and it caused behavior similar to what you describe. The solution was to uninstall everything and then re-install fresh. One other thing that worked was to use the Logout / Logon options from the home screen a couple of times.


This Is Not The Michael You're Looking For I'll try but I don't know that it will fix it. When I first tried to install the new version of YAGRAC it failed, I think because the old version was there. Therefore, I uninstalled the old version (which I had never successfully connected to Goodreads anyway) (and no option was given for clearing user data) and then installed the new version. From there, it immediately gave me that error when I tried to authorize. I have successfully authorized two other apps with Goodreads, Casper's app a few months ago and something called MyBookDroid today (after yours failed to work).

I also tried clearing my browser cache, but that didn't help. I even considered manually trying to delete any user data but couldn't figure out where it was hidden.

I'll uninstall/install again and see if that works.


This Is Not The Michael You're Looking For Nope, same error. It definitely seems to think that it's already authorized, although it is not authorized. I checked my GR account and it does not list the app as authorized. Even though I'm telling it to authorize something is preventing the authorization from going through.


message 34: by Adam (new)

Adam (jademason) | 66 comments Hmmm....

On startup, YAGRAC reads from the applications preferences a few strings: user ID, token, and token secret. It then checks the value of token to see if it is empty or zero-length. If this is the case, rather than displaying the home screen, it immediately displays the Login screen. On the login screen, when you click Login it launches the browser to the Goodreads oauth page. When you click to allow the app access, the browser then fires an intent which the Login screen receives with the valid oauth access token and token secret. Next, the login screen attempts to retrieve your user ID using the token and token secret it just received. I think this is where the app is hitting a snag. For some reason, the request to get your user ID is failing, but it already retrieved a token and token secret.

Out of curiousity, when you get to the Goodreads oauth page, what happens if you deny the application access? I wonder if there is some combination of Logon / Logoff / Allow / Deny that will get you running again. I realize I'm grasping at straws, I'll post again if I can think of something that might help.


message 35: by Curtis (last edited Sep 08, 2010 05:17PM) (new)

Curtis Schofield (robot) | 39 comments we want to change the goodreads auth page to : http://cooncap.ytmnd.com/


message 36: by Curtis (new)

Curtis Schofield (robot) | 39 comments to answer your question - if your user denies the request there is a oauth_callback URL PARAM that you can set that will be redirected to - the same param exists for success - and both of them will include the request token as a param and an authorize param.

authorize=0 for fail
authorize=1 for pass

you may want to use the callback.


This Is Not The Michael You're Looking For Could the failure to get my userid be due to the fact that I'm an author? This does cause occasional weirdness, although i don't know why it would here.

I tried denying out of curiosity this afternoon to see if that would somehow clear out something and I think it just put me into a loop where it kept trying to reauthorize again.

I also tried clearing the cookies and that didn't work either (didn't seem very likely, but you never know).


message 38: by Adam (new)

Adam (jademason) | 66 comments One way to isolate your specific account as an author as the issue would be to create a dummy Goodreads account and see if you get a different result logging in that way.

I've added a beta installer to the list of downloads. This won't resolve your issue, but it will give a slightly different error message that will help me in determining where things are going wrong.


message 39: by Curtis (new)

Curtis Schofield (robot) | 39 comments I'll check-out your api keys in the morning.


message 40: by Curtis (new)

Curtis Schofield (robot) | 39 comments @this_is_not_the_michael - you have 2 access token- neither of them are registered to YAGRAC

@adam : what are using to implement the oauth spec?


message 41: by Adam (new)

Adam (jademason) | 66 comments Curtis wrote: "@this_is_not_the_michael - you have 2 access token- neither of them are registered to YAGRAC

@adam : what are using to implement the oauth spec?"


I am using the signpost oauth library
for android. I am using a version with a fix for POST parameter signing that Casper recommended. Not_Michael is the only case of this issue I have had reported, and unfortunately I am not able to reproduce it.


This Is Not The Michael You're Looking For Any idea what I might do to try to figure out why it's failing to authorize? I'm certainly telling it to authorize.


message 43: by Adam (new)

Adam (jademason) | 66 comments This Is Not The Michael You're Looking For wrote: "Any idea what I might do to try to figure out why it's failing to authorize? I'm certainly telling it to authorize."

I posted a beta installer for YAGRAC on the project download page. Could you give this a try and note the specific error message? I've added some text here to allow for differentiating between the different types of oauth error cases. I appreciate your help with getting this solved.


message 44: by Casper (new)

Casper Gasper (caspergasper) | 32 comments Adam,
I saw someone in the office fail to authenticate today with your app so it's not just Michael.

I haven't checked your code but I'm going to guess you're not storing the authorizationToken and authorizationTokenSecret before going to the Goodreads site? On some lower-end devices the app gets garbage collected whilst waiting for the callback so you need to recreate the provider with the authorizationToken and authorizationTokenSecret.

Casper.


message 45: by Adam (new)

Adam (jademason) | 66 comments here are some of relevant sections of code:

public class LoginActivity extends Activity
{
private final static String _ConsumerKey = "myConsumerKey";
private final static String _ConsumerSecret = "myConsumerSecret";
private final static String _CallbackUrl = "onesadjam://goodreads";
private final static CommonsHttpOAuthConsumer _Consumer = new CommonsHttpOAuthConsumer(_ConsumerKey, _ConsumerSecret);

private final static OAuthProvider _Provider = new DefaultOAuthProvider(
"http://www.goodreads.com/oauth/reques...",
"http://www.goodreads.com/oauth/access...",
"http://www.goodreads.com/oauth/author...

onClick function for the login button:

String authUrl = _Provider.retrieveRequestToken(_Consumer, _CallbackUrl);
Context context = v.getContext();
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));

onResume method

Uri uri = this.getIntent().getData();
if (uri != null && uri.toString().startsWith(_CallbackUrl))
{
String oauthToken = uri.getQueryParameter(OAuth.OAUTH_TOKEN);
// this will populate token and token_secret in consumer
try
{
_Provider.retrieveAccessToken(_Consumer, oauthToken);
}


I ran into trouble when I first started the app for precisely the reason you describe. My activity got garbage collected while the browser was active, and when re-created in response my instance variables were no longer initialized. I switched them to static members and the issue was resolved. That may not be the appropriate approach. I also played around with setting my activity to different instancing types (e.g. single top) but that did not seem to have the desired affect.


This Is Not The Michael You're Looking For I tried the beta. Same error, except that it now starts with "Expectation failed exception:" followed by the rest of the same error message, and it stays on the authorize screen rather than going back to the login as before.


message 47: by Casper (new)

Casper Gasper (caspergasper) | 32 comments Yep, you need to permanently store the request tokens, and recreate the provider object with them if it's been garbage collected. You can recreate the bug -- just kill the app before you click on "allow access".

Casper.


message 48: by Adam (new)

Adam (jademason) | 66 comments Wow, you are a ROCK STAR Casper!

I didn't even consider that my entire app was getting garbage collected. So when the browser window comes up my app doesn't just get paused, it is getting destroyed. It is restarted by the intent from the browser. The newly started app moves immediately to the LoginActivity which (and this boggles my mind since the _Consumer and _Provider are both instantiated via the static constructors) are no longer properly initialized!

@Casper - thank you very much for giving me a way to recreate this issue.

@This_Is_Not_The_Michael_You_Are_Looking_For - I'll get this fixed ASAP and let you know when it is ready.


message 49: by Casper (new)

Casper Gasper (caspergasper) | 32 comments np, if you're ever in London you owe me a beer :-)

Casper.


message 50: by Adam (new)

Adam (jademason) | 66 comments @Casper - Deal! :-)

@This_Is_Not_The_Michael_You_Are_Looking_For - I've posted a new beta download for you to try that includes the fix Casper recommended. Based on his tip, I was able to recreate the bug exactly as you describe. After changing the code, I can no longer repeat the issue. Please let me know if this allows you to authenticate.


« previous 1
back to top