Alongside with the SoundCloud Android app we’ve created a new Java Wrapper for the SoundCloud API and today we can finally release it to the public!
It is simple to use, supports OAuth2 and requires a minimum of external dependencies so it should be easily embeddable in both desktop and mobile applications.
Here is a quick demonstration how easy it is to use it:
// Create a wrapper instance
ApiWrapper wrapper = new ApiWrapper("client_id", "client_secret",
null, null, Env.LIVE);
// Obtain a token
wrapper.login("username", "password");
// Execute a request
HttpResponse resp = wrapper.get(Request.to("/me"));
// Update a resource
HttpResponse resp =
wrapper.put(Request.to("/me")
.with("user[full_name]", "Che Flute",
"user[website]", "http://cheflute.com")
.withFile("user[avatar_data]", new File("flute.jpg")));
You’ll find the wrapper on GitHub and more infos and examples in the Readme. Let us know what you think!