Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/UweTrottmann/tmdb-java
Java wrapper around themoviedb.org API v3 using retrofit2 (inofficial).
https://github.com/UweTrottmann/tmdb-java
android java movies tmdb tv
Last synced: 14 days ago
JSON representation
Java wrapper around themoviedb.org API v3 using retrofit2 (inofficial).
- Host: GitHub
- URL: https://github.com/UweTrottmann/tmdb-java
- Owner: UweTrottmann
- License: apache-2.0
- Created: 2012-09-29T11:15:22.000Z (about 12 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T13:45:18.000Z (5 months ago)
- Last Synced: 2024-08-01T19:45:49.186Z (3 months ago)
- Topics: android, java, movies, tmdb, tv
- Language: Java
- Homepage:
- Size: 970 KB
- Stars: 171
- Watchers: 14
- Forks: 62
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
**[Pull requests](CONTRIBUTING.md) (e.g. support for more API endpoints, bug fixes) are welcome!**
# tmdb-java
A Java wrapper around the [TMDb v3 API](https://developer.themoviedb.org/reference/intro/getting-started) using [retrofit 2](https://square.github.io/retrofit/).
## Usage
[Available on Maven Central](https://central.sonatype.com/search?q=tmdb-java)Add the following dependency to your Gradle project:
```groovy
implementation("com.uwetrottmann.tmdb2:tmdb-java:2.11.0")
```or your Maven project:
```xml
com.uwetrottmann.tmdb2
tmdb-java
2.11.0```
Use like any other retrofit2 based service. For example:
```java
// 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 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](https://square.github.io/retrofit/) 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](https://square.github.io/retrofit/#download).The specific rules for this library are [already bundled](src/main/resources/META-INF/proguard/tmdb-java.pro) into the
release which can be interpreted by R8 automatically, ProGuard users must manually add the rules.## License
This work by [Uwe Trottmann](https://uwetrottmann.com) is licensed under the [Apache License 2.0](LICENSE.txt).
[Contributors](https://github.com/UweTrottmann/tmdb-java/graphs/contributors) and changes are tracked by Git.
Do not just copy, make it better.