Api Key was obtained from The Movie DB
- add
gradle.properties
into.gitignore
file - Place the api key in
gradle.properties
file
API_KEY="your api key"
- Add following line in app level
build.gradle
file,
android {
...
defaultConfig {
...
buildConfigField("String", "API_KEY", API_KEY)
}
}
- Use API key within code using BuildConfig
val API_KEY :String = BuildConfig.API_KEY