mirror of
https://github.com/googlemaps/android-samples.git
synced 2025-12-08 18:02:20 +00:00
chore: update build.gradle comments for adding an API key (#1756)
This commit is contained in:
parent
710c6ee148
commit
8e47cfbe21
@ -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">
|
||||
|
||||
@ -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
|
||||
-->
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
-->
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user