Skip to content
vineetmobile edited this page Sep 18, 2013 · 2 revisions

SocialAuth Android lets you get user albums and photos after authentication. Facebook and Twitter support this functionality.

Album

###Implementation

private final class ResponseListener implements DialogListener 
{
   public void onComplete(Bundle values) {
   
     adapter.getAlbumsAsync(new AlbumDataListener());	
   }
}

// To receive the album response after authentication
private final class AlbumDataListener implements SocialAuthListener<List<Album>> {

@Override
public void onExecute(List<Album> t) {

  Log.d("Custom-UI", "Receiving Data");
  List<Album> albumList = t;
  if (albumList != null && albumList.size() > 0) {

  // Get Photos inside Album
  for (Album a : albumList) {

  Log.d("Custom-UI", "Album ID = " + a.getId());
  Log.d("Custom-UI", "Album Name = " + a.getName());
  Log.d("Custom-UI", "Cover Photo = " + a.getCoverPhoto());
  Log.d("Custom-UI", "Photos Count = " + a.getPhotosCount());

  photosList = a.getPhotos();
  if (photosList != null && photosList.size() > 0) {

  for (Photo p : photosList) {
        Log.d("Custom-UI", "Photo ID = " + p.getId());
	Log.d("Custom-UI", "Name     = " + p.getTitle());
	Log.d("Custom-UI", "Thumb Image = " + p.getThumbImage());
	Log.d("Custom-UI", "Small Image = " + p.getSmallImage());
	Log.d("Custom-UI", "Medium Image = " + p.getMediumImage());
	Log.d("Custom-UI", "Large Image = " + p.getLargeImage());
       }
     }
  }
}

  @Override
  public void onError(SocialAuthError e) {
  }
}
Clone this wiki locally