Skip to content

mbdroid/tmdb-java

 
 

Repository files navigation

Pull requests (e.g. support for more API endpoints, bugfixes) are welcome!

tmdb-java

A Java wrapper around the TMDb v3 API using retrofit 2.

Usage

Add the following dependency to your Gradle project:

compile 'com.uwetrottmann.tmdb2:tmdb-java:1.6.0'

or your Maven project:

<dependency>
    <groupId>com.uwetrottmann.tmdb2</groupId>
    <artifactId>tmdb-java</artifactId>
    <version>1.6.0</version>
</dependency>

Use like any other retrofit2 based service. For example:

// Create an instance of the service you wish to use
// you can keep this around
Tmdb tmdb = new Tmdb("yourapikey");
MovieService movieService = tmdb.movieService();
//
// Call any of the available endpoints
Call<Movie> call = movieService.summary(550);
Movie movie = call.execute().body();
Call<Trailers> callTrailers = movieService.trailers(550);
Trailers trailers = callTrailers.execute().body();

See test cases in src/test/ for more examples and the retrofit website for configuration options.

Use Proguard!

You likely will not use every method in this library, so it is probably useful to strip unused ones with Proguard. Just apply the Proguard rules for retrofit.

License

Created by Uwe Trottmann. Except where noted otherwise, released into the public domain. Do not just copy, make it better.

About

A Java wrapper around themoviedb.org API v3 using retrofit2.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.8%
  • PowerShell 0.2%