TMDB Movies is an Android application that fetches data from The Movie Database (TMDB) API to display popular movies. Users can search for any movie and view its details.
- Display popular movies on the home screen.
- Search for movies using the search functionality.
- View detailed information about a selected movie.
Screenrecorder-2024-08-19-01-36-16-535.mp4






-
Clone the repository:
git clone https://github.com/aaimran236/TMDB-Movies
-
Open the project in Android Studio:
- Open Android Studio.
- Click on
File > Open
and navigate to the cloned directory.
-
Add your TMDB API Key:
- Obtain an API key from The Movie Database.
- Open
gradle.properties
and add your TMDB API key:TMDB_API_KEY="your_api_key_here"
-
Build and run the project:
- Click on
Run > Run 'app'
or pressShift + F10
.
- Click on
- The home screen displays a list of popular movies in a
RecyclerView
. - Each movie item shows the movie poster, title, and rating.
- Click on the search icon in the toolbar.
- Enter the keyword(s) to search for movies.
- The search results replace the popular movies in the
RecyclerView
.
- Click on any movie item in the
RecyclerView
to view its details. - The details screen shows the movie poster, title, rating bar, and an overview of the movie.
- After closing the search view, the home screen will revert to displaying the popular movies.
- Retrofit for network requests.
- Glide for image loading.
- Gson for JSON parsing.
- LiveData for LiveData.
- ViewModel for ViewModel.
Add the necessary dependencies to your build.gradle
file:
dependencies {
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
def lifecycle_version = "2.8.3"
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
}
Contributions are welcome! Please fork this repository and submit a pull request for any improvements.
This project is licensed under the MIT License - see the LICENSE file for details.
- The Movie Database (TMDB) for providing the API.
- Retrofit for network request handling.
- Glide for image loading.
- Gson for JSON parsing.