FlickrFree-Library is a project mainly written in Java, it's free.
Android library which provides access to the Flickr API (forked from FlickrFree project)
FlickrFree Library is an Android library which aims to provide access to the Flickr API.
It has been forked from FlickrFree project
Clone the library sources
git clone [email protected]:tbruyelle/FlickrFree-Library.git
Import the sources in Eclipse File -> New -> Android Project
Add the library in your project properties -> Android -> Library -> Add -> FlickrFree-Library
To authenticate you need to :
Instantiate a FlickrConnect
class
FlickrConnect flickrConnect = new FlickrConnect( this );
check if already logged in, if not, call the authorize
method, and pass your Flickr app parameters.
/* check the authentification */
if ( mFlickrConnect.IsLoggedIn() )
{
/* auth OK */
(...)
}
else
{
/* auth need to be done */
flickrConnect.authorize( this, getString( R.string.app_name ),
getString( R.string.api_key ),
getString( R.string.api_secret ),
getString( R.string.auth_url ),
AUTHENTICATE );
}
Override the onActivityResult
to retrieve the authentication result.
@Override
protected void onActivityResult( int requestCode, int resultCode, Intent data )
{
super.onActivityResult( requestCode, resultCode, data );
switch ( requestCode )
{
case AUTHENTICATE:
if ( resultCode == FlickrConnect.AUTH_SUCCESS )
{
Toast.makeText( this, "Auth OK !", Toast.LENGTH_SHORT ).show();
}
else
{
Toast.makeText( this, "Auth KO !", Toast.LENGTH_SHORT ).show();
}
break;
}
}
You can also look at the FlickrWidget project, to see how to use this library.
flickr.auth.checkToken
with flickrConnect.isLoggedIn()
flickr.photos.getInfo
with flickrConnect.getPhotoInfo( String photoId )
flickr.activity.userPhotos
with flickrConnect.getActivityUserPhotos( String userId, String timeFrame, String perPage, String page )
flickr.activity.userComments
with flickrConnect.getActivityUserComments( String userId, String perPage, String page )