Created
April 1, 2024 20:34
-
-
Save ElianFabian/7aaf095931d57211dc085a296fbab49d to your computer and use it in GitHub Desktop.
How to read a property from local.properties file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
namespace = "" | |
compileSdk = 34 | |
defaultConfig { | |
applicationId = "" | |
minSdk = 21 | |
targetSdk = 34 | |
versionCode = 1 | |
versionName = "1.0" | |
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | |
val properties = Properties().apply { | |
load(rootProject.file("local.properties").inputStream()) | |
} | |
resValue("string", "GoogleMapsApiKey", properties["GoogleMapsApiKey"] as String) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment