Skip to content

Commit

Permalink
chore: update build.gradle comments for adding an API key (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangela authored Aug 16, 2024
1 parent 710c6ee commit 8e47cfb
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 34 deletions.
28 changes: 14 additions & 14 deletions ApiDemos/java/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2020 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
Copyright 2024 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

Expand Down Expand Up @@ -41,7 +41,7 @@

<!--
To add your Maps API key to this project:
1. Open the root project's local.properties file
1. Open the root project's secrets.properties file
2. Add this line, where YOUR_API_KEY is your API key:
MAPS_API_KEY=YOUR_API_KEY
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected void onCreate(Bundle savedInstanceState) {
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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
2 changes: 1 addition & 1 deletion ApiDemos/kotlin/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
android:theme="@style/AppTheme">
<!--
To add your Maps API key to this project:
1. Open the root project'sl local.properties file
1. Open the root project'sl secrets.properties file
2. Add this line, where YOUR_API_KEY is your API key:
MAPS_API_KEY=YOUR_API_KEY
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

}
Expand Down
6 changes: 4 additions & 2 deletions tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tutorials/java/MapWithMarker/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions tutorials/java/Polygons/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions tutorials/java/StyledMap/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
6 changes: 4 additions & 2 deletions tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions tutorials/kotlin/MapWithMarker/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions tutorials/kotlin/Polygons/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8e47cfb

Please sign in to comment.