Coder Social home page Coder Social logo

tmdb-java's Introduction

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

tmdb-java

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

Usage

Available on Maven Central

Add the following dependency to your Gradle project:

implementation("com.uwetrottmann.tmdb2:tmdb-java:2.10.0")

or your Maven project:

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

Use like any other retrofit2 based service. For example:

// Create an instance of the service you wish to use
// you should re-use these
Tmdb tmdb = new Tmdb(API_KEY);
MoviesService moviesService = tmdb.moviesService();
// Call any of the available endpoints
try {
    Response<Movie> response = moviesService
        .summary(550)
        .execute();
    if (response.isSuccessful()) {
        Movie movie = response.body();
        System.out.println(movie.title + " is awesome!");
    }
} catch (Exception e) {
    // see execute() javadoc 
}

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

Android

This library ships Java 8 bytecode. This requires Android Gradle Plugin 3.2.x or newer.

Proguard / R8

It is likely not every method in this library is used, so it is probably useful to strip unused ones with Proguard. Apply the Proguard rules for retrofit.

The specific rules for this library are already bundled into the release which can be interpreted by R8 automatically, ProGuard users must manually add the rules.

License

This work by Uwe Trottmann is licensed under the Apache License 2.0.

Contributors and changes are tracked by Git.

Do not just copy, make it better.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.