use of com.googlecode.flickrjandroid.Flickr in project glimmr by brk3.
the class LoadContactsPhotosTask method doInBackground.
@Override
protected List<Photo> doInBackground(OAuth... params) {
OAuth oauth = params[0];
if (oauth != null) {
OAuthToken token = oauth.getToken();
Flickr f = FlickrHelper.getInstance().getFlickrAuthed(token.getOauthToken(), token.getOauthTokenSecret());
try {
return f.getPhotosInterface().getContactsPhotos(Constants.FETCH_PER_PAGE, Constants.EXTRAS, false, false, false, mPage, Constants.FETCH_PER_PAGE);
} catch (Exception e) {
e.printStackTrace();
mException = e;
}
} else {
Log.e(TAG, "LoadContactsPhotosTask requires authentication");
}
return null;
}
use of com.googlecode.flickrjandroid.Flickr in project glimmr by brk3.
the class LoadFavoritesTask method doInBackground.
@Override
protected List<Photo> doInBackground(OAuth... params) {
OAuth oauth = params[0];
if (oauth != null) {
OAuthToken token = oauth.getToken();
Flickr f = FlickrHelper.getInstance().getFlickrAuthed(token.getOauthToken(), token.getOauthTokenSecret());
if (BuildConfig.DEBUG)
Log.d(TAG, "Fetching page " + mPage);
try {
return f.getFavoritesInterface().getList(mUser.getId(), null, null, Constants.FETCH_PER_PAGE, mPage, Constants.EXTRAS);
} catch (Exception e) {
e.printStackTrace();
mException = e;
}
} else {
try {
return FlickrHelper.getInstance().getFavoritesInterface().getPublicList(mUser.getId(), null, null, Constants.FETCH_PER_PAGE, mPage, Constants.EXTRAS);
} catch (Exception e) {
e.printStackTrace();
mException = e;
}
}
return null;
}
use of com.googlecode.flickrjandroid.Flickr in project glimmr by brk3.
the class LoadFlickrActivityTask method doInBackground.
@Override
protected List<Item> doInBackground(OAuth... params) {
OAuth oauth = params[0];
if (oauth != null) {
OAuthToken token = oauth.getToken();
try {
Flickr f = FlickrHelper.getInstance().getFlickrAuthed(token.getOauthToken(), token.getOauthTokenSecret());
String timeFrame = "100d";
int page = 1;
return f.getActivityInterface().userPhotos(Constants.FETCH_PER_PAGE, page, timeFrame);
} catch (Exception e) {
e.printStackTrace();
mException = e;
}
} else {
Log.e(TAG, "LoadFlickrActivityTask requires authentication");
}
return null;
}
use of com.googlecode.flickrjandroid.Flickr in project glimmr by brk3.
the class LoadGroupPoolTask method doInBackground.
@Override
protected List<Photo> doInBackground(OAuth... params) {
OAuth oauth = params[0];
if (oauth != null) {
OAuthToken token = oauth.getToken();
Flickr f = FlickrHelper.getInstance().getFlickrAuthed(token.getOauthToken(), token.getOauthTokenSecret());
if (BuildConfig.DEBUG)
Log.d(TAG, "Fetching page " + mPage);
try {
return f.getPoolsInterface().getPhotos(mGroup.getId(), null, Constants.EXTRAS, Constants.FETCH_PER_PAGE, mPage);
} catch (Exception e) {
e.printStackTrace();
mException = e;
}
} else {
if (BuildConfig.DEBUG)
Log.d(TAG, "Making unauthenticated call");
if (BuildConfig.DEBUG)
Log.d(TAG, "Fetching page " + mPage);
try {
return FlickrHelper.getInstance().getPoolsInterface().getPhotos(mGroup.getId(), null, Constants.EXTRAS, Constants.FETCH_PER_PAGE, mPage);
} catch (Exception e) {
e.printStackTrace();
mException = e;
}
}
return null;
}
use of com.googlecode.flickrjandroid.Flickr in project glimmr by brk3.
the class LoadPhotosetPhotosTask method doInBackground.
@Override
protected List<Photo> doInBackground(OAuth... params) {
OAuth oauth = params[0];
if (oauth != null) {
OAuthToken token = oauth.getToken();
Flickr f = FlickrHelper.getInstance().getFlickrAuthed(token.getOauthToken(), token.getOauthTokenSecret());
if (BuildConfig.DEBUG)
Log.d(TAG, "Fetching page " + mPage);
try {
return f.getPhotosetsInterface().getPhotos("" + mPhotoset.getId(), Constants.EXTRAS, Flickr.PRIVACY_LEVEL_NO_FILTER, Constants.FETCH_PER_PAGE, mPage).getPhotoList();
} catch (Exception e) {
e.printStackTrace();
mException = e;
}
} else {
if (BuildConfig.DEBUG)
Log.d(TAG, "Making unauthenticated call");
if (BuildConfig.DEBUG)
Log.d(TAG, "Fetching page " + mPage);
try {
return FlickrHelper.getInstance().getPhotosetsInterface().getPhotos("" + mPhotoset.getId(), Constants.EXTRAS, Flickr.PRIVACY_LEVEL_NO_FILTER, Constants.FETCH_PER_PAGE, mPage).getPhotoList();
} catch (Exception e) {
e.printStackTrace();
mException = e;
}
}
return null;
}
Aggregations