Android app that displays the upcoming movies using The Movie Database (TMDb) API.
This app was developed using The Movie Database (TMDb) API. The API is very extensive and very well documented and provides for us developers some endpoints to retrieve info from movies like title, release date, overview, poster image, backdrop image and much more. I'll encourage you to read the documentation to see more details about the endpoints, authorization and other stuffs.
But first, you will need to create an developer account to get the API Key that must be sent on every request to API's endpoints.
- Go to TMDb Developer Portal and read from there how to get your API Key.
- Fill all your information and then will be redirected to your account page. Please copy the API Key because you will need them on your requests.
Now you can clone the repo. You can use any Git clients or just type this in command line:
git clone https://github.com/ramonrabello/Upcoming-Movies-App.git
Go to the build.gradle
file and search for these two build config fields:
buildConfigField "String", "API_KEY", '"GET_YOUR_API_KEY_AT_TMDB_DEVELOPER_PORTAL"'
Just copy/paste your API keys and sync your project. Congratulations, now you can run the app!
The project was built using the Model-View-ViewModel (MVVM) presentation pattern that eases the development by decoupling the app layers by providing more testability and promoting more reuse. The main difference between the other presentation patterns like the Model-View-Presenter (MVP) is that the MVVM has a reactive approach and implements the Observer pattern, where the UI observes model changes that are notified by ViewModel to update the UI. The overview of the MVVM presentation pattern is shown in the following image.
The project is entirely written using Kotlin language and it was created based on feature package convention:
- core: All classes related the the listing of movies.
- core/ktx: Some Kotlin Extension Functions for overall project.
- data: All classes related to data like repository implementations (local and/or remote).
- details: All classes related the details of a movie.
- di: All classes related to Dependency Injection (DI) using Dagger 2 like
@Module
s,@Component
s,@ContributesAndroidInjector
s, etc. - home: All classes related the the listing of movies.
- model: Package that holds all JSON models.
for
Adapter
,ViewHolder
, etc. - view: Contains all classes related to the view layer like
Activities
,Fragments
,Adapters
, ...
The following image shows how the project is structured in terms of components level.
The file buildsystem/dependencies.gradle
contains all the library dependencies used
in the project. It is organized by region
s according to context like support library,
architecture, UI, network, testing (unit and instrumentation).
- Kotlin Standard Library 1.2.51
- appcompat-v7 27.1.1
- Design 27.1.1
- cardview-v7 27.1.1
- support-fragment 27.1.1
- constraint-layout 1.1.0
- Glide 4.7.1
- Glide Compiler 4.7.1 (for kapt)
- Moshi
- OkHttp 3
- Retrofit 2
- RxJava 2
- Okio 1.14.0
- Architecture Components (Lifecycle, Room & LiveData)
- Dagger 2
- JUnit 4.1.2
- Mockito-Android 2.19.0
- Hamcrest 1.3
- espresso-core 3.0.2
- espresso-intents 3.0.2
- espresso-contrib 3.0.2
- espresso-idling-resource 3.0.2
Copyright 2018 Ramon Rabello
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.