campyre
campyre copied to clipboard
Consider using Retrofit
Retrofit is a handy framework for going from a java interface to a remote service. Handles threading and it can parse json responses directly into java objects pretty seamlessly.
Disclaimer: I work on Retrofit for my day job.
If you think it'd clean up the code, go for it. Is this in use in Square's own Android app?
Yep, both Wallet and Register make use of the library. There is a small trick we use Guice (actually, Dagger, though in the same way) to make it easier, but this shouldn't be necessary.
Very rough work-in-progress at https://github.com/pforhan/campyre/compare/master...retrofit-fun
Not hooked up at all, or tested, but that's about all that's required to have multithreading and automatic gson deserialization. Two big missing pieces:
- The part that constructs the proxy service implementations (See RestAdapter.create())
- Verifying upload/download formats.
If I get a chance tomorrow, I'll move farther on this.
Nice syntax, I like where it's going.
On Thu, Dec 13, 2012 at 11:05 PM, Patrick Forhan [email protected]:
Very rough work-in-progress at https://github.com/pforhan/campyre/compare/master...retrofit-fun
Not hooked up at all, or tested, but that's about all that's required to have multithreading and automatic gson deserialization. Two big missing pieces:
- The part that constructs the proxy service implementations (See RestAdapter.create())
- Verifying upload/download formats.
If I get a chance tomorrow, I'll move farther on this.
— Reply to this email directly or view it on GitHubhttps://github.com/konklone/campyre/issues/147#issuecomment-11364580.