Simple app to consumer api movies with retrofit and save result in database with room using android jetpack
- Log Up in https://www.themoviedb.org/signup
- Get api key in https://www.themoviedb.org/settings/api
- Up your api key in local.properties in yout app file, remember name.In this case is keyApiMovies
keyApiMovies="your_api_key_xxxx"
- In the build.gradle in defaultConfig put:
def localProperties = new Properties()
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
buildConfigField "String", "API_KEY_MOVIES",localProperties['keyApiMovies']
where keyApiMovies is the name that yout put in the step 3, and API_KEY_MOVIES is the name for your api key, for use in the inner code.
With that caun you user BuildConfig.API_KEY_MOVIES in MoviesApiServices