sevar83/tmdb-java


Kotlin wrapper around themoviedb.org API v3 using Retrofit 2 and RxJava 2

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.sevar83:tmdb-java:v1.6.0'
	}
	dependencies {
		implementation("com.github.sevar83:tmdb-java:v1.6.0")
	}
	<dependency>
	    <groupId>com.github.sevar83</groupId>
	    <artifactId>tmdb-java</artifactId>
	    <version>v1.6.0</version>
	</dependency>

                            
    libraryDependencies += "com.github.sevar83" % "tmdb-java" % "v1.6.0"
        
        

                            
    :dependencies [[com.github.sevar83/tmdb-java "v1.6.0"]]
        
        

Readme


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

<a href="https://search.maven.org/#search%7Cga%7C1%7Ctmdb-java"><img src="https://img.shields.io/maven-central/v/com.uwetrottmann.tmdb2/tmdb-java.svg?style=flat-square"></a>

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>

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.

License

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