From 8e47cfbe21e6e701c362e71cd9fd51c0b6bd2f69 Mon Sep 17 00:00:00 2001 From: Angela Yu <5506675+wangela@users.noreply.github.com> Date: Fri, 16 Aug 2024 12:26:28 -0700 Subject: [PATCH] chore: update build.gradle comments for adding an API key (#1756) --- .../java/app/src/main/AndroidManifest.xml | 28 +++++++++---------- .../com/example/mapdemo/MainActivity.java | 2 +- .../com/example/kotlindemos/MainActivity.kt | 2 +- .../kotlin/app/src/main/AndroidManifest.xml | 2 +- .../com/example/kotlindemos/MainActivity.kt | 2 +- .../CurrentPlaceDetailsOnMap/app/build.gradle | 6 ++-- tutorials/java/MapWithMarker/app/build.gradle | 6 ++-- tutorials/java/Polygons/app/build.gradle | 6 ++-- tutorials/java/StyledMap/app/build.gradle | 8 ++++-- .../CurrentPlaceDetailsOnMap/app/build.gradle | 6 ++-- .../kotlin/MapWithMarker/app/build.gradle | 8 ++++-- tutorials/kotlin/Polygons/app/build.gradle | 6 ++-- 12 files changed, 48 insertions(+), 34 deletions(-) diff --git a/ApiDemos/java/app/src/main/AndroidManifest.xml b/ApiDemos/java/app/src/main/AndroidManifest.xml index 87e29a0a..92fb8dc4 100644 --- a/ApiDemos/java/app/src/main/AndroidManifest.xml +++ b/ApiDemos/java/app/src/main/AndroidManifest.xml @@ -1,18 +1,18 @@ @@ -41,7 +41,7 @@ diff --git a/ApiDemos/java/app/src/v3/java/com/example/mapdemo/MainActivity.java b/ApiDemos/java/app/src/v3/java/com/example/mapdemo/MainActivity.java index e308c30f..ad79897f 100644 --- a/ApiDemos/java/app/src/v3/java/com/example/mapdemo/MainActivity.java +++ b/ApiDemos/java/app/src/v3/java/com/example/mapdemo/MainActivity.java @@ -86,7 +86,7 @@ public final class MainActivity extends AppCompatActivity list.setEmptyView(findViewById(R.id.empty)); if (BuildConfig.MAPS_API_KEY.isEmpty()) { - Toast.makeText(this, "Add your own API key in local.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show(); + Toast.makeText(this, "Add your own API key in secrets.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show(); } } diff --git a/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/MainActivity.kt b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/MainActivity.kt index 333c814c..bd0257c5 100644 --- a/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/MainActivity.kt +++ b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/MainActivity.kt @@ -52,7 +52,7 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener { } if (BuildConfig.MAPS_API_KEY.isEmpty()) { - Toast.makeText(this, "Add your own API key in local.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show() + Toast.makeText(this, "Add your own API key in secrets.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show() } } diff --git a/ApiDemos/kotlin/app/src/main/AndroidManifest.xml b/ApiDemos/kotlin/app/src/main/AndroidManifest.xml index ee42e89d..fede1a68 100644 --- a/ApiDemos/kotlin/app/src/main/AndroidManifest.xml +++ b/ApiDemos/kotlin/app/src/main/AndroidManifest.xml @@ -32,7 +32,7 @@ android:theme="@style/AppTheme"> diff --git a/ApiDemos/kotlin/app/src/v3/java/com/example/kotlindemos/MainActivity.kt b/ApiDemos/kotlin/app/src/v3/java/com/example/kotlindemos/MainActivity.kt index f65bc27e..f11c5136 100644 --- a/ApiDemos/kotlin/app/src/v3/java/com/example/kotlindemos/MainActivity.kt +++ b/ApiDemos/kotlin/app/src/v3/java/com/example/kotlindemos/MainActivity.kt @@ -57,7 +57,7 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener { } if (BuildConfig.MAPS_API_KEY.isEmpty()) { - Toast.makeText(this, "Add your own API key in local.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show() + Toast.makeText(this, "Add your own API key in secrets.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show() } } diff --git a/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle b/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle index cadc32bf..636cdf01 100644 --- a/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle +++ b/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle @@ -37,8 +37,10 @@ dependencies { } secrets { - // Optionally specify a different file name containing your secrets. - // If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY propertiesFileName = "secrets.properties" // A properties file containing default secret values. This file can be diff --git a/tutorials/java/MapWithMarker/app/build.gradle b/tutorials/java/MapWithMarker/app/build.gradle index 012017a5..ed548f0f 100644 --- a/tutorials/java/MapWithMarker/app/build.gradle +++ b/tutorials/java/MapWithMarker/app/build.gradle @@ -35,8 +35,10 @@ dependencies { } secrets { - // Optionally specify a different file name containing your secrets. - // If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY propertiesFileName = "secrets.properties" // To add your Maps API key to this project: diff --git a/tutorials/java/Polygons/app/build.gradle b/tutorials/java/Polygons/app/build.gradle index 8ed67a12..e509a2cc 100644 --- a/tutorials/java/Polygons/app/build.gradle +++ b/tutorials/java/Polygons/app/build.gradle @@ -35,8 +35,10 @@ dependencies { } secrets { - // Optionally specify a different file name containing your secrets. - // If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY propertiesFileName = "secrets.properties" // To add your Maps API key to this project: diff --git a/tutorials/java/StyledMap/app/build.gradle b/tutorials/java/StyledMap/app/build.gradle index 6ccc9f1d..1c99151d 100644 --- a/tutorials/java/StyledMap/app/build.gradle +++ b/tutorials/java/StyledMap/app/build.gradle @@ -39,11 +39,13 @@ dependencies { } secrets { - // Optionally specify a different file name containing your secrets. - // If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY propertiesFileName = "secrets.properties" // A properties file containing default secret values. This file can be // checked in version control. defaultPropertiesFileName = 'local.defaults.properties' -} \ No newline at end of file +} diff --git a/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle b/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle index 11eaf1cd..ac1048e4 100644 --- a/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle +++ b/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle @@ -48,8 +48,10 @@ dependencies { } secrets { - // Optionally specify a different file name containing your secrets. - // If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY propertiesFileName = "secrets.properties" // To add your Maps API key to this project: diff --git a/tutorials/kotlin/MapWithMarker/app/build.gradle b/tutorials/kotlin/MapWithMarker/app/build.gradle index 7ea9c3de..68ba7e1b 100644 --- a/tutorials/kotlin/MapWithMarker/app/build.gradle +++ b/tutorials/kotlin/MapWithMarker/app/build.gradle @@ -43,10 +43,12 @@ dependencies { } secrets { - // Optionally specify a different file name containing your secrets. - // If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY propertiesFileName = "secrets.properties" - + // 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: diff --git a/tutorials/kotlin/Polygons/app/build.gradle b/tutorials/kotlin/Polygons/app/build.gradle index 3d200a09..519b1ded 100644 --- a/tutorials/kotlin/Polygons/app/build.gradle +++ b/tutorials/kotlin/Polygons/app/build.gradle @@ -41,8 +41,10 @@ dependencies { } secrets { - // Optionally specify a different file name containing your secrets. - // If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY propertiesFileName = "secrets.properties" // To add your Maps API key to this project: