Consuming HTTP Services

Android applications and mobile applications in general are small apps with a lot of functionality. One of the ways that mobile apps deliver such rich functionality on such a small device is that they pull information from various sources. For example, the T-Mobile G1 comes with the Maps application, which provides seemingly sophisticated mapping functionality. We, however, know that the application is integrated with Google Maps and other services, which provide most of the sophistication.

That said, it is likely that the applications you write will also leverage information from other applications. A common integration strategy is to use HTTP. For example, you might have a Java servlet that provides services you want to leverage from one of your Android applications. How do you do that with Android? Interestingly, the Android SDK ships with Apache's HttpClient (, which is universally used within the J2EE space. The Android SDK ships with a version of the HttpClient that has been modified for Android, but the APIs are very similar to the APIs in the J2EE version.

The Apache HttpClient is a comprehensive HTTP client. Although it offers full support for the HTTP protocol, you will likely utilize HTTP GET and POST. In this section, we will discuss using the HttpClient to make HTTP GET and HTTP POST calls.

Iphone Apps Profit Formula

Iphone Apps Profit Formula

The Easy Formula To Making Money With Iphone Apps. The exemplary development of technology from then till now has helped everyone in all aspects of our lives. Essential factors including social, physical, mental, and the like have been touched by these mechanics making our existence so easier.

Get My Free Ebook

Post a comment