-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
77 additions
and
52 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,49 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
// Set the properties within `local.properties` into a `Properties` class so | ||
// that values within `local.properties` (e.g. Maps API key) are accessible in | ||
// this file. | ||
Properties properties = new Properties() | ||
if (rootProject.file("local.properties").exists()) { | ||
properties.load(rootProject.file("local.properties").newDataInputStream()) | ||
plugins { | ||
id 'com.android.application' | ||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' | ||
} | ||
def mapsApiKey = properties.getProperty("MAPS_API_KEY", "") | ||
|
||
android { | ||
compileSdkVersion 33 | ||
compileSdk 33 | ||
defaultConfig { | ||
applicationId "com.example.styledmap" | ||
minSdkVersion 19 | ||
targetSdkVersion 33 | ||
minSdk 21 | ||
targetSdk 33 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
|
||
// Read the API key from local.properties into R.string.maps_api_key | ||
resValue "string", "maps_api_key", mapsApiKey | ||
|
||
// To add your Maps API key to this project: | ||
// 1. Open the root project's local.properties file | ||
// 2. Add this line, where YOUR_API_KEY is your API key: | ||
// MAPS_API_KEY=YOUR_API_KEY | ||
} | ||
buildFeatures { | ||
buildConfig = true | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_17 | ||
targetCompatibility JavaVersion.VERSION_17 | ||
} | ||
namespace "com.example.styledmap" | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation 'androidx.appcompat:appcompat:1.6.1' | ||
implementation 'com.google.android.gms:play-services-maps:18.1.0' | ||
implementation 'com.google.android.gms:play-services-maps:18.2.0' | ||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.5' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' | ||
} | ||
|
||
secrets { | ||
// Optionally specify a different file name containing your secrets. | ||
// The plugin defaults to "local.properties" | ||
propertiesFileName = "secrets.properties" | ||
|
||
// A properties file containing default secret values. This file can be | ||
// checked in version control. | ||
defaultPropertiesFileName = 'local.defaults.properties' | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
MAPS_API_KEY=STUB_API_KEY |
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
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
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
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
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