Flickr API

A Java library to access Flickr API (works with Android too!)

License

License

GroupId

GroupId

com.github.fabienbarbero
ArtifactId

ArtifactId

flickr-api
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

jar
Description

Description

Flickr API
A Java library to access Flickr API (works with Android too!)
Project URL

Project URL

https://github.com/fabienbarbero/flickr-api
Source Code Management

Source Code Management

https://github.com/fabienbarbero/flickr-api

Download flickr-api

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.fabienbarbero/flickr-api/ -->
<dependency>
    <groupId>com.github.fabienbarbero</groupId>
    <artifactId>flickr-api</artifactId>
    <version>1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.fabienbarbero/flickr-api/
implementation 'com.github.fabienbarbero:flickr-api:1.2'
// https://jarcasting.com/artifacts/com.github.fabienbarbero/flickr-api/
implementation ("com.github.fabienbarbero:flickr-api:1.2")
'com.github.fabienbarbero:flickr-api:jar:1.2'
<dependency org="com.github.fabienbarbero" name="flickr-api" rev="1.2">
  <artifact name="flickr-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.fabienbarbero', module='flickr-api', version='1.2')
)
libraryDependencies += "com.github.fabienbarbero" % "flickr-api" % "1.2"
[com.github.fabienbarbero/flickr-api "1.2"]

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.httpcomponents : httpmime jar 4.3.5
com.github.scribejava : scribejava-apis jar 4.2.0
org.json : json jar 20090211

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Flickr API

Flickr API is a Java / android API implementation to access the Flickr web services defined here. The API uses only the REST-JSON requests to have the minimum payload size (which is useful with android device which do not have a high speed network access).

Import in your projects

For simple Java apps

<dependency>
    <groupId>com.github.fabienbarbero</groupId>
    <artifactId>flickr-api</artifactId>
    <version>1.2</version>
</dependency>

For android apps

We must exclude the base httpClient dependencies to use the android implementation.

dependencies {
    compile ('com.github.fabienbarbero:flickr-api:1.2') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    ...
}

Getting started

The calls to Flickr are quiet easy:

Flickr flickr = new Flickr("my.api.key", "my.api.secret", "http://localhost/callback", "read", new File("flickr.conf"));

// Check if a user is already logged
if(!flickr.isFirstStart()) {
    // Get the authorization URL to allow the application to use the Flickr services
    String url = flickr.getAuthorizationUrl();
    // Show the previous URL in a browser

    ...

    // Verify the token 
    String verifier = ...;
    String token = ...;
    flickr.verifyToken(verifier, token);
}

// Authenticate the user
UserInfo user = flickr.getUser();

// Use the services
Paginated<Photo> photos = flickr.getPhotosService().getRecentlyUpdated(50, 0);
...

Features

The library do not supports all Flickr features. Here are the supported :

  • get the users contacts
  • get the cameras brand list
  • get the favorites photos of users
  • get the users galleries
  • get the groups and their photos
  • get the people (search user, get users informations ...)
  • get the photos and the sets
  • get the statistics on photos, set ...
  • upload new photos

Versions

Version
1.2
1.1