tags:

views:

99

answers:

2

Hi,

I need to write an Android application that allows a user to connect to multiple social networking sites like MySpace, LinkedIn, FaceBook etc. and fetch friends list.

I know that most of these applications have Java libraries or functionalities exposed as REST based WebServices. But since there is a lot of variety and disparity in the ways that these libaries are written or service that can be consumed, is there any single, integrated service or middleware component that I can use to provide a unified interface in my mobile application?

What would be the best way to go about writing such an application? Any links or pointers to tutorials and documents would be helpful.

Thanks.

A: 

Just think what you want to accomplish and search for documentation of the libararies you want to use... And there are a few tutorials for android apps. (google me)

Without more information you'll not get better answers...

Patrick Cornelissen
A: 

Well, that pretty much depends on the service APIs exposed by these sites. If they're RESTful, it would be easy and straight forward to write the API accessors yourself using the Apache HttpClient implementation shipped with Android.

If you want to make your life easier you may want to look at Droid-Fu's HTTP abstractions, and maybe Signpost, if you require OAuth message signing (which you need for many popular sites like Netflix, LinkedIn, Twitter, ...).

Here is some code that fetches mentions from Twitter using these two libraries:

// configure an OAuthConsumer with Twitter credentials
oauthConsumer.setTokenWithSecret(accessToken, tokenSecret);

// get Twitter mentions for the user identified by accessToken
String endpointUrl = "http://twitter.com/statuses/mentions.xml?since_id=12345";
BetterHttpResponse response = BetterHttp.get(endpointUrl).expecting(200, 404).signed(oauthConsumer).send();

if (response.getStatusCode() == 200) {
   ... // consume response
}

That stuff worked pretty well for me with the Qype API.

Matthias