An Android Java, JSON, and Twitter REST API example

I don't get to parse too much JSON code with Java because the biggest JSON source I work with is Twitter, and I always use the Twitter4J project to interact with their web services. But a few days ago while working on an Android project, I just wanted to access their "Twitter Trends" REST service, and I used Java and the Java library that comes with Android to parse the Twitter Trends JSON feed like this:

A Scala REST 'get content' client function using Apache HttpClient

As quick post here today, if you need a Scala REST client function, the following source code should be able to work for you, or at least be a good starting point. I'm using it in several applications today, and the only thing I think it needs is the ability to set a connection timeout and socket timeout, and I share the code for that down below.

Here's my Scala REST 'get content' client function, using the Apache HttpClient library:

Syndicate content