After much fiddling with trying to import the libraries myself, I finally managed to find out that I can do so using the Google Plugin for Eclipse, here.
However, I
application node:google-api-client-1.17.0-rc.jar
google-api-client-android-1.17.0-rc.jar
google-api-services-urlshortener-v1-rev22-1.17.0-rc.jar
google-http-client-1.17.0-rc.jar
google-http-client-android-1.17.0-rc.jar
method:
String shorten(String longUrl){
Urlshortener.Builder builder = new Urlshortener.Builder (AndroidHttp.newCompatibleTransport(), AndroidJsonFactory.getDefaultInstance(), null);
Urlshortener urlshortener = builder.build();
com.google.api.services.urlshortener.model.Url url = new Url();
url.setLongUrl(longUrl);
try {
url = urlshortener.url().insert(url).execute();
return url.getId();
} catch (IOException e) {
return null;
}
}