Tag Archives: instagram

Instagram API wrapper for Android


Instagram(IG) API wrapper for Android for handling an Instagram app lifecycle. Split into 2 sub-projects:

  • InstagramAuth Authentication library, based uppon Facebook for Android library.
  • restig A wrapper arround IG rest API calls. Based upon restFB.


Currently short on documentation, will add more as time permits.



 * Authorize a user in Instagram. Will show up the auth dialog and will
 * allow the user to enter his/her credentials.

* <strong> Pay attention</strong> Use the listener afterwards to save the
 * authentication token.
 * @param listener
 * - A dialog listener that can react to various authentication
 * events. Cannot be null.
 * @param permissions
 * - Use various permissions. Can be empty but not null.
 * @param activity
 * - An activity that will be the parent of the dialog box.
 public void authorize(final DialogListener listener,
 final Activity activity, final String... permissions) {
 InstagramModule module = new InstagramModule();
 final InstagramAuthDialog dialog = new InstagramAuthDialog(activity,
 listener, mAppId, permissions);

public class InstagramModule implements
 DialogListener {
 public void onComplete(final Bundle values) {
 String accessToken = values.getString("access_token");

 public void onError(final DialogError error) {
 // Log error

 public void onCancel() {
 // User canceled.
 authorize(new InstagramModule(), activity, "likes", "comments");


InstagramClient userClient = new DefaultInstagramClient(appId, mAccessToken);
final String endPoint = format("media/%s/comments",
final InstagramCollection comments = client
.fetchCollection(endPoint, Comment.class);

You can download the source from github


Leave a comment

Filed under API