Watchlist is a movie and tv series database for getting the latest information about trending or specific movies. Add a movie or tv series to your favourite to reference it later
- Jetpack Compose
- TMDB API
- Retrofit
- Firebase
- Dagger-Hilt
- Material 3 Design
Firebase is Excellent. But it has a few limitations.
- You cannot store a document value as a data object. So to get around that I stored the document values to Json.
- You cannot just add an entry to a document. You first have to get the document as a Hashmap, update the hashmap, and then push the updated hashmap as the document (that's 2 network calls instead of 1). So I had to do those when adding to favourites, and when removing from favourites
My first idea was to over-engineer the whole thing 😅 I made a Thread in X about it. You can check it out but don't forget to like and follow
First of all, add a navigation animation from the favourite screen details screens.
Also I might use a custom database so that getting and updating favourites will just be a single network call.
finally I should also probably call more APIs to display more details about movies and tv, like credits, video trailer, and add ratings
- Get an API key from TMDB's Website.
- In the project's root directory, Create a file named apikey.properties
- Then in the apikey.properties file, set the api key as below
TMDB_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Now you have 2 options here:
-
Option 1 - If you want to be able to get release build variant
- In Android Studio, create a new keystore file under Build > Genetare Signes Bundle/APK
- In the project's root directory, Create a file named keystore.properties
- Then in the keystore.properties file, set the key alias, key password, store password, and store file path as below
KEY_ALIAS=xxxx KEY_PASSWORD=xxxxxxxx STORE_PASSWORD=xxxxxxxx STORE_FILE=C\:\\xxxx\\xxxx\\xxxx\\xxxx.jks
-
Option 2 - If you're okay with debug variant
If you don't want to go through all that stress, In the Module's build.gradle file, just comment out the following lines of code
val keystorePropertiesFile: File = rootProject.file("keystore.properties") val keystoreProperties = Properties() keystoreProperties.load(FileInputStream(keystorePropertiesFile))
Also
signingConfigs { create("release") { keyAlias = keystoreProperties.getProperty("KEY_ALIAS") keyPassword = keystoreProperties.getProperty("KEY_PASSWORD") storePassword = keystoreProperties.getProperty("STORE_PASSWORD") storeFile = file(keystoreProperties.getProperty("STORE_FILE")) } }
And Finally
buildTypes { release { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) signingConfig = signingConfigs.getByName("release") } }
Just make sure the build variant in android studio is set to debug and you're done.