Skip to content

Commit 8e47cfb

Browse files
authored
chore: update build.gradle comments for adding an API key (#1756)
1 parent 710c6ee commit 8e47cfb

File tree

12 files changed

+48
-34
lines changed

12 files changed

+48
-34
lines changed

ApiDemos/java/app/src/main/AndroidManifest.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
~ Copyright 2020 Google LLC
4-
~
5-
~ Licensed under the Apache License, Version 2.0 (the "License");
6-
~ you may not use this file except in compliance with the License.
7-
~ You may obtain a copy of the License at
8-
~
9-
~ https://www.apache.org/licenses/LICENSE-2.0
10-
~
11-
~ Unless required by applicable law or agreed to in writing, software
12-
~ distributed under the License is distributed on an "AS IS" BASIS,
13-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
~ See the License for the specific language governing permissions and
15-
~ limitations under the License.
3+
Copyright 2024 Google LLC
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
https://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
1616
-->
1717
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1818

@@ -41,7 +41,7 @@
4141

4242
<!--
4343
To add your Maps API key to this project:
44-
1. Open the root project's local.properties file
44+
1. Open the root project's secrets.properties file
4545
2. Add this line, where YOUR_API_KEY is your API key:
4646
MAPS_API_KEY=YOUR_API_KEY
4747
-->

ApiDemos/java/app/src/v3/java/com/example/mapdemo/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected void onCreate(Bundle savedInstanceState) {
8686
list.setEmptyView(findViewById(R.id.empty));
8787

8888
if (BuildConfig.MAPS_API_KEY.isEmpty()) {
89-
Toast.makeText(this, "Add your own API key in local.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show();
89+
Toast.makeText(this, "Add your own API key in secrets.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show();
9090
}
9191
}
9292

ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener {
5252
}
5353

5454
if (BuildConfig.MAPS_API_KEY.isEmpty()) {
55-
Toast.makeText(this, "Add your own API key in local.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show()
55+
Toast.makeText(this, "Add your own API key in secrets.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show()
5656
}
5757
}
5858

ApiDemos/kotlin/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
android:theme="@style/AppTheme">
3333
<!--
3434
To add your Maps API key to this project:
35-
1. Open the root project'sl local.properties file
35+
1. Open the root project'sl secrets.properties file
3636
2. Add this line, where YOUR_API_KEY is your API key:
3737
MAPS_API_KEY=YOUR_API_KEY
3838
-->

ApiDemos/kotlin/app/src/v3/java/com/example/kotlindemos/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener {
5757
}
5858

5959
if (BuildConfig.MAPS_API_KEY.isEmpty()) {
60-
Toast.makeText(this, "Add your own API key in local.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show()
60+
Toast.makeText(this, "Add your own API key in secrets.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show()
6161
}
6262

6363
}

tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ dependencies {
3737
}
3838

3939
secrets {
40-
// Optionally specify a different file name containing your secrets.
41-
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
40+
// To add your Maps API key to this project:
41+
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
42+
// 2. Add this line, where YOUR_API_KEY is your API key:
43+
// MAPS_API_KEY=YOUR_API_KEY
4244
propertiesFileName = "secrets.properties"
4345

4446
// A properties file containing default secret values. This file can be

tutorials/java/MapWithMarker/app/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ dependencies {
3535
}
3636

3737
secrets {
38-
// Optionally specify a different file name containing your secrets.
39-
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
38+
// To add your Maps API key to this project:
39+
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
40+
// 2. Add this line, where YOUR_API_KEY is your API key:
41+
// MAPS_API_KEY=YOUR_API_KEY
4042
propertiesFileName = "secrets.properties"
4143

4244
// To add your Maps API key to this project:

tutorials/java/Polygons/app/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ dependencies {
3535
}
3636

3737
secrets {
38-
// Optionally specify a different file name containing your secrets.
39-
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
38+
// To add your Maps API key to this project:
39+
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
40+
// 2. Add this line, where YOUR_API_KEY is your API key:
41+
// MAPS_API_KEY=YOUR_API_KEY
4042
propertiesFileName = "secrets.properties"
4143

4244
// To add your Maps API key to this project:

tutorials/java/StyledMap/app/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ dependencies {
3939
}
4040

4141
secrets {
42-
// Optionally specify a different file name containing your secrets.
43-
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
42+
// To add your Maps API key to this project:
43+
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
44+
// 2. Add this line, where YOUR_API_KEY is your API key:
45+
// MAPS_API_KEY=YOUR_API_KEY
4446
propertiesFileName = "secrets.properties"
4547

4648
// A properties file containing default secret values. This file can be
4749
// checked in version control.
4850
defaultPropertiesFileName = 'local.defaults.properties'
49-
}
51+
}

tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ dependencies {
4848
}
4949

5050
secrets {
51-
// Optionally specify a different file name containing your secrets.
52-
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
51+
// To add your Maps API key to this project:
52+
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
53+
// 2. Add this line, where YOUR_API_KEY is your API key:
54+
// MAPS_API_KEY=YOUR_API_KEY
5355
propertiesFileName = "secrets.properties"
5456

5557
// To add your Maps API key to this project:

0 commit comments

Comments
 (0)