If you haven't used AndroidAsync yet, you should. It's a powerful NIO based socket and HTTP library for Android. Super fast, easy to use, and asynchronous.

The initial implementation was entirely callback based. So, you'd do something like, this:

I got a few request for Futures, which are also a nice pattern. So I added that transparently by making all the asynchronous calls return a Future instead of void.

So, now:

Futures can also have callbacks...

For brevity...


Futures in AndroidAsync<p>If you haven't used <a href="http://koush.com/AndroidAsync">AndroidAsync</a> yet, you should. It's a powerful <a href="http://en.wikipedia.org/wiki/New_I/O">NIO</a> based</p><p><a href="/post/android-async-futures" title="Read more of Futures in AndroidAsync">read more</a></p>