mirror of
https://github.com/googlemaps/android-samples.git
synced 2025-12-08 18:02:20 +00:00
feat: tooling modernization (#1753)
* feat: tooling modernization * chore: headers * chore: headers * feat: tooling modernization * removed script
This commit is contained in:
parent
8e47cfbe21
commit
42f3887bac
@ -33,7 +33,7 @@ If prompted for a gradle configuration accept the default settings.
|
||||
|
||||
Alternatively use the `gradlew build` command to build the project directly.
|
||||
|
||||
This demo app requires that you add your own Google Maps API key. See [Get an API Key](../../docs/GET_AN_API_KEY.md) for more instructions.
|
||||
This demo app requires that you add your own Google Maps API key. See [Get an API key](https://developers.google.com/maps/documentation/android-sdk/get-api-key) for more instructions.
|
||||
|
||||
Support
|
||||
-------
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
import org.apache.tools.ant.filters.ConcatFilter
|
||||
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'project-report'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.mapdemo"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
multiDexEnabled true
|
||||
}
|
||||
buildFeatures {
|
||||
compose true
|
||||
buildConfig = true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
flavorDimensions "version"
|
||||
productFlavors {
|
||||
gms {
|
||||
dimension "version"
|
||||
applicationIdSuffix ".gms"
|
||||
versionNameSuffix "-gms"
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
namespace "com.example.mapdemo"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation "androidx.recyclerview:recyclerview:1.3.2"
|
||||
implementation 'com.android.volley:volley:1.2.1'
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0"))
|
||||
// GMS
|
||||
gmsImplementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
|
||||
// Tests
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
90
ApiDemos/java/app/build.gradle.kts
Normal file
90
ApiDemos/java/app/build.gradle.kts
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("project-report")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 34
|
||||
|
||||
productFlavors {
|
||||
create("gms") {
|
||||
dimension = "version"
|
||||
applicationIdSuffix = ".gms"
|
||||
versionNameSuffix = "-gms"
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.mapdemo"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
multiDexEnabled = true
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
getByName("release") {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions.add("version")
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
namespace = "com.example.mapdemo"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.recyclerview)
|
||||
implementation(libs.volley)
|
||||
implementation(platform(libs.kotlinBom))
|
||||
|
||||
// GMS
|
||||
implementation(libs.playServicesMaps)
|
||||
|
||||
// Tests
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidxJunit)
|
||||
androidTestImplementation(libs.espressoCore)
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
43
ApiDemos/java/build.gradle.kts
Normal file
43
ApiDemos/java/build.gradle.kts
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:8.5.1")
|
||||
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.projectDirectory)
|
||||
}
|
||||
20
ApiDemos/java/gradle/libs.versions.toml
Normal file
20
ApiDemos/java/gradle/libs.versions.toml
Normal file
@ -0,0 +1,20 @@
|
||||
[versions]
|
||||
appcompat = "1.7.0"
|
||||
recyclerview = "1.3.2"
|
||||
volley = "1.2.1"
|
||||
kotlinBom = "2.0.0"
|
||||
playServicesMaps = "19.0.0"
|
||||
junit = "4.13.2"
|
||||
androidxJunit = "1.2.1"
|
||||
espresso = "3.6.1"
|
||||
|
||||
|
||||
[libraries]
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" }
|
||||
volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
|
||||
kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" }
|
||||
playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidxJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxJunit" }
|
||||
espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" }
|
||||
@ -1 +0,0 @@
|
||||
include ':app'
|
||||
17
ApiDemos/java/settings.gradle.kts
Normal file
17
ApiDemos/java/settings.gradle.kts
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
include(":app")
|
||||
@ -34,7 +34,7 @@ If prompted for a gradle configuration accept the default settings.
|
||||
|
||||
Alternatively use the `gradlew build` command to build the project directly.
|
||||
|
||||
This demo app requires that you add your own Google Maps API key. See [Get an API Key](../../docs/GET_AN_API_KEY.md) for more instructions.
|
||||
This demo app requires that you add your own Google Maps API key. See [Get an API key](https://developers.google.com/maps/documentation/android-sdk/get-api-key) for more instructions.
|
||||
|
||||
Support
|
||||
-------
|
||||
|
||||
@ -1,83 +0,0 @@
|
||||
import org.apache.tools.ant.filters.ConcatFilter
|
||||
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-parcelize'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
defaultConfig {
|
||||
applicationId "com.example.kotlindemos"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
flavorDimensions "version"
|
||||
productFlavors {
|
||||
gms {
|
||||
dimension "version"
|
||||
applicationIdSuffix ".gms"
|
||||
versionNameSuffix "-gms"
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
|
||||
}
|
||||
namespace "com.example.kotlindemos"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation "androidx.cardview:cardview:1.0.0"
|
||||
implementation "androidx.recyclerview:recyclerview:1.3.2"
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
implementation 'com.android.volley:volley:1.2.1'
|
||||
|
||||
// GMS
|
||||
gmsImplementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3'
|
||||
gmsImplementation 'com.google.maps.android:maps-ktx:5.1.1'
|
||||
|
||||
// Below is used to run the easypermissions library to manage location permissions
|
||||
// EasyPermissions is needed to help us request for permission to access location
|
||||
implementation 'pub.devrel:easypermissions:3.0.0'
|
||||
|
||||
// Tests
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
106
ApiDemos/kotlin/app/build.gradle.kts
Normal file
106
ApiDemos/kotlin/app/build.gradle.kts
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
id("kotlin-parcelize")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.kotlindemos"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled = true
|
||||
}
|
||||
|
||||
productFlavors {
|
||||
create("gms") {
|
||||
dimension = "version"
|
||||
applicationIdSuffix = ".gms"
|
||||
versionNameSuffix = "-gms"
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
getByName("release") {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions.add("version")
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
lint {
|
||||
abortOnError = false
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
namespace = "com.example.kotlindemos"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(libs.appcompat)
|
||||
implementation(libs.kotlinStdlib)
|
||||
implementation(libs.cardview)
|
||||
implementation(libs.recyclerview)
|
||||
implementation(libs.multidex)
|
||||
implementation(libs.volley)
|
||||
|
||||
// GMS
|
||||
implementation(libs.lifecycleRuntimeKtx)
|
||||
implementation(libs.mapsKtx)
|
||||
|
||||
// Below is used to run the easypermissions library to manage location permissions
|
||||
// EasyPermissions is needed to help us request for permission to access location
|
||||
implementation(libs.easypermissions)
|
||||
|
||||
// Tests
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidxJunit)
|
||||
androidTestImplementation(libs.espressoCore)
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '2.0.0'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
43
ApiDemos/kotlin/build.gradle.kts
Normal file
43
ApiDemos/kotlin/build.gradle.kts
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath(libs.gradle)
|
||||
classpath(libs.kotlinGradlePlugin)
|
||||
classpath(libs.secretsGradlePlugin)
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle.kts files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
32
ApiDemos/kotlin/gradle/libs.versions.toml
Normal file
32
ApiDemos/kotlin/gradle/libs.versions.toml
Normal file
@ -0,0 +1,32 @@
|
||||
[versions]
|
||||
gradle = "8.5.1"
|
||||
kotlin = "2.0.0"
|
||||
appcompat = "1.7.0"
|
||||
cardview = "1.0.0"
|
||||
recyclerview = "1.3.2"
|
||||
multidex = "2.0.1"
|
||||
secretsGradlePlugin = "2.0.1"
|
||||
volley = "1.2.1"
|
||||
lifecycle = "2.8.4"
|
||||
mapsKtx = "5.1.0"
|
||||
easypermissions = "3.0.0"
|
||||
junit = "4.13.2"
|
||||
androidxJunit = "1.2.1"
|
||||
espresso = "3.6.1"
|
||||
|
||||
[libraries]
|
||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
||||
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||
kotlinStdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk7", version.ref = "kotlin" }
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
cardview = { group = "androidx.cardview", name = "cardview", version.ref = "cardview" }
|
||||
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" }
|
||||
multidex = { group = "androidx.multidex", name = "multidex", version.ref = "multidex" }
|
||||
secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" }
|
||||
volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
|
||||
lifecycleRuntimeKtx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
|
||||
mapsKtx = { group = "com.google.maps.android", name = "maps-ktx", version.ref = "mapsKtx" }
|
||||
easypermissions = { group = "pub.devrel", name = "easypermissions", version.ref = "easypermissions" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidxJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxJunit" }
|
||||
espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" }
|
||||
@ -1 +0,0 @@
|
||||
include ':app'
|
||||
17
ApiDemos/kotlin/settings.gradle.kts
Normal file
17
ApiDemos/kotlin/settings.gradle.kts
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
include(":app")
|
||||
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.wearos"
|
||||
minSdk 23
|
||||
targetSdk 31
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
namespace 'com.example.wearosmap'
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
}
|
||||
kotlin {
|
||||
jvmToolchain(21)
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_wear_os_dependencies]
|
||||
dependencies {
|
||||
// [START_EXCLUDE]
|
||||
implementation "androidx.core:core-ktx:1.13.1"
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.0'
|
||||
// [END_EXCLUDE]
|
||||
compileOnly 'com.google.android.wearable:wearable:2.9.0'
|
||||
implementation 'com.google.android.support:wearable:2.9.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
|
||||
// This dependency is necessary for ambient mode
|
||||
implementation 'androidx.wear:wear:1.3.0'
|
||||
}
|
||||
// [END maps_wear_os_dependencies]
|
||||
|
||||
secrets {
|
||||
defaultPropertiesFileName 'local.defaults.properties'
|
||||
}
|
||||
69
WearOS/Wearable/build.gradle.kts
Normal file
69
WearOS/Wearable/build.gradle.kts
Normal file
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
kotlin("android") // The Kotlin plugin is applied differently in Kotlin DSL
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.wearos"
|
||||
minSdk = 23
|
||||
targetSdk = 31
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
getByName("release") {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
namespace = "com.example.wearosmap"
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(21)
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_wear_os_dependencies]
|
||||
dependencies {
|
||||
// [START_EXCLUDE]
|
||||
implementation("androidx.core:core-ktx:1.13.1")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.0")
|
||||
// [END_EXCLUDE]
|
||||
compileOnly("com.google.android.wearable:wearable:2.9.0")
|
||||
implementation("com.google.android.support:wearable:2.9.0")
|
||||
implementation("com.google.android.gms:play-services-maps:19.0.0")
|
||||
|
||||
// This dependency is necessary for ambient mode
|
||||
implementation("androidx.wear:wear:1.3.0")
|
||||
}
|
||||
// [END maps_wear_os_dependencies]
|
||||
|
||||
secrets {
|
||||
defaultPropertiesFileName = "local.defaults.properties"
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Google Inc. All Rights Reserved.
|
||||
* 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.
|
||||
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id 'com.android.application' version '8.5.2' apply false
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false
|
||||
id("com.android.application") version "8.5.0" apply false
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") version "2.0.1" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
|
||||
}
|
||||
0
WearOS/gradle/libs.versions.toml
Normal file
0
WearOS/gradle/libs.versions.toml
Normal file
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Google Inc. All Rights Reserved.
|
||||
* 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.
|
||||
@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
@ -20,11 +21,14 @@ pluginManagement {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
include ':Wearable'
|
||||
|
||||
include(":Wearable")
|
||||
@ -1,75 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'org.jetbrains.kotlin.plugin.compose' version "2.0.0"
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.app_compose'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.app_compose"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
buildFeatures {
|
||||
compose true
|
||||
buildConfig = true
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '21'
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_compose_dependency]
|
||||
dependencies {
|
||||
|
||||
// [START_EXCLUDE silent]
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.0'
|
||||
implementation 'androidx.core:core-ktx:1.13.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation "androidx.compose.foundation:foundation:1.7.0-beta04"
|
||||
implementation "androidx.compose.material:material:1.7.0-beta04"
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
|
||||
implementation 'com.android.volley:volley:1.2.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3'
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// Android Maps Compose composables for the Maps SDK for Android
|
||||
implementation 'com.google.maps.android:maps-compose:6.1.0'
|
||||
}
|
||||
// [END maps_android_compose_dependency]
|
||||
|
||||
secrets {
|
||||
// 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'
|
||||
}
|
||||
89
snippets/app-compose/build.gradle.kts
Normal file
89
snippets/app-compose/build.gradle.kts
Normal file
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0"
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.app_compose"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.app_compose"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
buildConfig = true
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_compose_dependency]
|
||||
dependencies {
|
||||
// [START_EXCLUDE silent]
|
||||
implementation(libs.kotlin.stdlib)
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.compose.foundation)
|
||||
implementation(libs.compose.material)
|
||||
implementation(libs.material)
|
||||
implementation(libs.constraintlayout)
|
||||
implementation(libs.navigation.fragment.ktx)
|
||||
implementation(libs.navigation.ui.ktx)
|
||||
implementation(libs.volley)
|
||||
implementation(libs.lifecycle.runtime.ktx)
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// Android Maps Compose composables for the Maps SDK for Android
|
||||
implementation("com.google.maps.android:maps-compose:6.1.0")
|
||||
}
|
||||
// [END maps_android_compose_dependency]
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.app_ktx'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.app_ktx"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary true
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '21'
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_ktx_install_snippet]
|
||||
dependencies {
|
||||
// [START_EXCLUDE silent]
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.0'
|
||||
implementation 'androidx.core:core-ktx:1.13.1'
|
||||
implementation "androidx.appcompat:appcompat:1.7.0"
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3'
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// KTX for the Maps SDK for Android library
|
||||
implementation 'com.google.maps.android:maps-ktx:5.1.1'
|
||||
}
|
||||
// [END maps_android_ktx_install_snippet]
|
||||
|
||||
secrets {
|
||||
// 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'
|
||||
}
|
||||
83
snippets/app-ktx/build.gradle.kts
Normal file
83
snippets/app-ktx/build.gradle.kts
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.app_ktx"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.app_ktx"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_ktx_install_snippet]
|
||||
dependencies {
|
||||
// [START_EXCLUDE silent]
|
||||
implementation(libs.kotlin.stdlib)
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.lifecycle.runtime.ktx)
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// KTX for the Maps SDK for Android library
|
||||
implementation("com.google.maps.android:maps-ktx:5.1.1")
|
||||
}
|
||||
// [END maps_android_ktx_install_snippet]
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.app_places_ktx'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.app_places_ktx"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '21'
|
||||
}
|
||||
}
|
||||
// [START places_android_ktx_install_snippet]
|
||||
dependencies {
|
||||
// [START_EXCLUDE silent]
|
||||
implementation 'androidx.core:core-ktx:1.13.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'com.android.volley:volley:1.2.1'
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// KTX for the Places SDK for Android library
|
||||
implementation 'com.google.maps.android:places-ktx:3.2.0'
|
||||
}
|
||||
// [END places_android_ktx_install_snippet]
|
||||
|
||||
secrets {
|
||||
// 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'
|
||||
}
|
||||
83
snippets/app-places-ktx/build.gradle.kts
Normal file
83
snippets/app-places-ktx/build.gradle.kts
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.app_places_ktx"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.app_places_ktx"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
}
|
||||
}
|
||||
|
||||
// [START places_android_ktx_install_snippet]
|
||||
dependencies {
|
||||
// [START_EXCLUDE silent]
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.volley)
|
||||
implementation(libs.material)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// KTX for the Places SDK for Android library
|
||||
implementation("com.google.maps.android:places-ktx:3.2.0")
|
||||
}
|
||||
// [END places_android_ktx_install_snippet]
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.app_maps_rx'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.app_maps_rx"
|
||||
minSdk 24
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '21'
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_maps_rx_install]
|
||||
dependencies {
|
||||
// RxJava bindings for the Maps SDK
|
||||
implementation 'com.google.maps.android:maps-rx:1.0.0'
|
||||
|
||||
// RxJava bindings for the Places SDK
|
||||
implementation 'com.google.maps.android:places-rx:1.0.0'
|
||||
|
||||
// It is recommended to also include the latest Maps SDK, Places SDK and RxJava so you
|
||||
// have the latest features and bug fixes.
|
||||
implementation "com.google.android.gms:play-services-maps:19.0.0"
|
||||
implementation 'com.google.android.libraries.places:places:3.5.0'
|
||||
implementation 'io.reactivex.rxjava3:rxjava:3.1.8'
|
||||
|
||||
// [START_EXCLUDE silent]
|
||||
implementation "androidx.appcompat:appcompat:1.7.0"
|
||||
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.3"
|
||||
implementation "com.google.android.material:material:1.12.0"
|
||||
implementation "com.trello.rxlifecycle4:rxlifecycle-android-lifecycle-kotlin:4.0.2"
|
||||
implementation "com.google.maps.android:maps-ktx:5.1.1"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.0"
|
||||
// [END_EXCLUDE silent]
|
||||
}
|
||||
// [END maps_android_maps_rx_install]
|
||||
|
||||
secrets {
|
||||
// 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'
|
||||
}
|
||||
91
snippets/app-rx/build.gradle.kts
Normal file
91
snippets/app-rx/build.gradle.kts
Normal file
@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.app_maps_rx"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.app_maps_rx"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_maps_rx_install]
|
||||
dependencies {
|
||||
// RxJava bindings for the Maps SDK
|
||||
implementation("com.google.maps.android:maps-rx:1.0.0")
|
||||
|
||||
// RxJava bindings for the Places SDK
|
||||
implementation("com.google.maps.android:places-rx:1.0.0")
|
||||
|
||||
// It is recommended to also include the latest Maps SDK, Places SDK and RxJava so you
|
||||
// have the latest features and bug fixes.
|
||||
implementation("com.google.android.gms:play-services-maps:19.0.0")
|
||||
implementation("com.google.android.libraries.places:places:3.5.0")
|
||||
implementation("io.reactivex.rxjava3:rxjava:3.1.8")
|
||||
|
||||
// [START_EXCLUDE silent]
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.lifecycle.runtime.ktx)
|
||||
implementation(libs.material)
|
||||
implementation(libs.rxlifecycle.android.lifecycle.kotlin)
|
||||
implementation(libs.maps.ktx)
|
||||
implementation(libs.kotlin.stdlib.jdk8)
|
||||
// [END_EXCLUDE silent]
|
||||
}
|
||||
// [END maps_android_maps_rx_install]
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
@ -1,64 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.app_utils_ktx'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.app_utils_ktx"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '21'
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_utils_ktx_install_snippet]
|
||||
dependencies {
|
||||
// [START_EXCLUDE silent]
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.0'
|
||||
implementation 'androidx.core:core-ktx:1.13.1'
|
||||
implementation "androidx.appcompat:appcompat:1.7.0"
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3'
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// KTX for the Maps SDK for Android Utility Library
|
||||
implementation 'com.google.maps.android:maps-utils-ktx:5.1.1'
|
||||
}
|
||||
// [END maps_android_utils_ktx_install_snippet]
|
||||
|
||||
secrets {
|
||||
// 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'
|
||||
}
|
||||
82
snippets/app-utils-ktx/build.gradle.kts
Normal file
82
snippets/app-utils-ktx/build.gradle.kts
Normal file
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.app_utils_ktx"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.app_utils_ktx"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
getByName("release") {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_utils_ktx_install_snippet]
|
||||
dependencies {
|
||||
// [START_EXCLUDE silent]
|
||||
implementation(libs.kotlin.stdlib)
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.lifecycle.runtime.ktx)
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// KTX for the Maps SDK for Android Utility Library
|
||||
implementation("com.google.maps.android:maps-utils-ktx:5.1.1")
|
||||
}
|
||||
// [END maps_android_utils_ktx_install_snippet]
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.app_utils'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.app_utils"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '21'
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_utils_install_snippet]
|
||||
dependencies {
|
||||
|
||||
// [START_EXCLUDE silent]
|
||||
implementation 'androidx.core:core-ktx:1.13.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// Utility Library for Maps SDK for Android
|
||||
// You do not need to add a separate dependency for the Maps SDK for Android
|
||||
// since this library builds in the compatible version of the Maps SDK.
|
||||
implementation 'com.google.maps.android:android-maps-utils:3.8.0'
|
||||
}
|
||||
// [END maps_android_utils_install_snippet]
|
||||
|
||||
secrets {
|
||||
// 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'
|
||||
}
|
||||
85
snippets/app-utils/build.gradle.kts
Normal file
85
snippets/app-utils/build.gradle.kts
Normal file
@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.app_utils"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.app_utils"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
}
|
||||
}
|
||||
|
||||
// [START maps_android_utils_install_snippet]
|
||||
dependencies {
|
||||
|
||||
// [START_EXCLUDE silent]
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// Utility Library for Maps SDK for Android
|
||||
// You do not need to add a separate dependency for the Maps SDK for Android
|
||||
// since this library builds in the compatible version of the Maps SDK.
|
||||
implementation("com.google.maps.android:android-maps-utils:3.8.2")
|
||||
}
|
||||
// [END maps_android_utils_install_snippet]
|
||||
|
||||
secrets {
|
||||
// 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"
|
||||
}
|
||||
@ -1,89 +0,0 @@
|
||||
// [START maps_android_secrets_gradle_plugin]
|
||||
plugins {
|
||||
// [START_EXCLUDE]
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
// [END_EXCLUDE]
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
// [END maps_android_secrets_gradle_plugin]
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
defaultConfig {
|
||||
applicationId "com.google.maps.example"
|
||||
minSdk 24
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions "version"
|
||||
|
||||
productFlavors {
|
||||
gms {
|
||||
dimension "version"
|
||||
applicationIdSuffix ".gms"
|
||||
versionNameSuffix "-gms"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
namespace 'com.google.maps.example'
|
||||
}
|
||||
|
||||
// [START maps_android_play_services_maps_dependency]
|
||||
dependencies {
|
||||
// [START_EXCLUDE silent]
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.0'
|
||||
implementation 'androidx.core:core-ktx:1.13.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation "androidx.compose.foundation:foundation:1.7.0-beta05"
|
||||
implementation "androidx.compose.material:material:1.7.0-beta05"
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
|
||||
implementation 'com.android.volley:volley:1.2.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3'
|
||||
implementation 'com.google.android.libraries.places:places:3.5.0'
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// Maps SDK for Android
|
||||
implementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
}
|
||||
// [END maps_android_play_services_maps_dependency]
|
||||
|
||||
// [START maps_android_secrets_gradle_plugin_config]
|
||||
secrets {
|
||||
// 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"
|
||||
|
||||
// Configure which keys should be ignored by the plugin by providing regular expressions.
|
||||
// "sdk.dir" is ignored by default.
|
||||
ignoreList.add("keyToIgnore") // Ignore the key "keyToIgnore"
|
||||
ignoreList.add("sdk.*") // Ignore all keys matching the regexp "sdk.*"
|
||||
}
|
||||
// [END maps_android_secrets_gradle_plugin_config]
|
||||
105
snippets/app/build.gradle.kts
Normal file
105
snippets/app/build.gradle.kts
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// [START maps_android_secrets_gradle_plugin]
|
||||
plugins {
|
||||
// [START_EXCLUDE]
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// [END_EXCLUDE]
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
// [END maps_android_secrets_gradle_plugin]
|
||||
|
||||
android {
|
||||
compileSdk = 34
|
||||
defaultConfig {
|
||||
applicationId = "com.google.maps.example"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions.add("version")
|
||||
|
||||
productFlavors {
|
||||
create("gms") {
|
||||
dimension = "version"
|
||||
applicationIdSuffix = ".gms"
|
||||
versionNameSuffix = "-gms"
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
namespace = "com.google.maps.example"
|
||||
}
|
||||
|
||||
// [START maps_android_play_services_maps_dependency]
|
||||
dependencies {
|
||||
// [START_EXCLUDE silent]
|
||||
implementation(libs.kotlin.stdlib)
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.compose.foundation)
|
||||
implementation(libs.compose.material)
|
||||
implementation(libs.material)
|
||||
implementation(libs.constraintlayout)
|
||||
implementation(libs.navigation.fragment.ktx)
|
||||
implementation(libs.navigation.ui.ktx)
|
||||
implementation(libs.volley)
|
||||
implementation(libs.lifecycle.runtime.ktx)
|
||||
implementation(libs.places)
|
||||
// [END_EXCLUDE]
|
||||
|
||||
// Maps SDK for Android
|
||||
implementation("com.google.android.gms:play-services-maps:19.0.0")
|
||||
}
|
||||
// [END maps_android_play_services_maps_dependency]
|
||||
|
||||
// [START maps_android_secrets_gradle_plugin_config]
|
||||
secrets {
|
||||
// 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"
|
||||
|
||||
// Configure which keys should be ignored by the plugin by providing regular expressions.
|
||||
// "sdk.dir" is ignored by default.
|
||||
ignoreList.add("keyToIgnore") // Ignore the key "keyToIgnore"
|
||||
ignoreList.add("sdk.*") // Ignore all keys matching the regexp "sdk.*"
|
||||
}
|
||||
// [END maps_android_secrets_gradle_plugin_config]
|
||||
@ -1,16 +0,0 @@
|
||||
// [START maps_android_secrets_gradle_plugin_project_level_config]
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
}
|
||||
}
|
||||
// [END maps_android_secrets_gradle_plugin_project_level_config]
|
||||
|
||||
plugins {
|
||||
id 'com.android.application' version '8.5.0' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
32
snippets/build.gradle.kts
Normal file
32
snippets/build.gradle.kts
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// [START maps_android_secrets_gradle_plugin_project_level_config]
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
|
||||
}
|
||||
}
|
||||
// [END maps_android_secrets_gradle_plugin_project_level_config]
|
||||
|
||||
plugins {
|
||||
id("com.android.application") version "8.5.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
||||
37
snippets/gradle/libs.versions.toml
Normal file
37
snippets/gradle/libs.versions.toml
Normal file
@ -0,0 +1,37 @@
|
||||
[versions]
|
||||
espressoCore = "3.6.1"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.2.1"
|
||||
kotlin = "2.0.0"
|
||||
coreKtx = "1.13.1"
|
||||
appCompat = "1.7.0"
|
||||
composeFoundation = "1.7.0-beta06"
|
||||
composeMaterial = "1.7.0-beta06"
|
||||
mapsKtx = "5.1.1"
|
||||
material = "1.12.0"
|
||||
constraintLayout = "2.1.4"
|
||||
navigation = "2.7.7"
|
||||
rxlifecycleAndroidLifecycleKotlin = "4.0.2"
|
||||
volley = "1.2.1"
|
||||
lifecycleRuntime = "2.8.4"
|
||||
places = "3.5.0"
|
||||
|
||||
[libraries]
|
||||
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
|
||||
ext-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" }
|
||||
junit = { module = "junit:junit", version.ref = "junit" }
|
||||
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
|
||||
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appCompat" }
|
||||
compose-foundation = { group = "androidx.compose.foundation", name = "foundation", version.ref = "composeFoundation" }
|
||||
compose-material = { group = "androidx.compose.material", name = "material", version.ref = "composeMaterial" }
|
||||
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
|
||||
maps-ktx = { module = "com.google.maps.android:maps-ktx", version.ref = "mapsKtx" }
|
||||
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
|
||||
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintLayout" }
|
||||
navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigation" }
|
||||
navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigation" }
|
||||
rxlifecycle-android-lifecycle-kotlin = { module = "com.trello.rxlifecycle4:rxlifecycle-android-lifecycle-kotlin", version.ref = "rxlifecycleAndroidLifecycleKotlin" }
|
||||
volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
|
||||
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntime" }
|
||||
places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" }
|
||||
@ -1,26 +0,0 @@
|
||||
// [START maps_android_settings_plugin_management]
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
// [END maps_android_settings_plugin_management]
|
||||
// [START maps_android_settings_dependency_resolution_management]
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
// [END maps_android_settings_dependency_resolution_management]
|
||||
include ':app'
|
||||
rootProject.name = "Snippets App"
|
||||
include ':app-ktx'
|
||||
include ':app-utils-ktx'
|
||||
include ':app-compose'
|
||||
include ':app-places-ktx'
|
||||
include ':app-rx'
|
||||
include ':app-utils'
|
||||
44
snippets/settings.gradle.kts
Normal file
44
snippets/settings.gradle.kts
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// [START maps_android_settings_plugin_management]
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
// [END maps_android_settings_plugin_management]
|
||||
|
||||
// [START maps_android_settings_dependency_resolution_management]
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
// [END maps_android_settings_dependency_resolution_management]
|
||||
|
||||
include(":app")
|
||||
rootProject.name = "Snippets App"
|
||||
include(":app-ktx")
|
||||
include(":app-utils-ktx")
|
||||
include(":app-compose")
|
||||
include(":app-places-ktx")
|
||||
include(":app-rx")
|
||||
include(":app-utils")
|
||||
@ -1,49 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
defaultConfig {
|
||||
applicationId "com.example.currentplacedetailsonmap"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
debuggable true
|
||||
}
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
namespace 'com.example.currentplacedetailsonmap'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
implementation 'com.google.android.libraries.places:places:3.5.0'
|
||||
implementation 'com.android.volley:volley:1.2.1'
|
||||
implementation platform("org.jetbrains.kotlin:kotlin-bom:2.0.0")
|
||||
testImplementation'junit:junit:4.13.2'
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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'
|
||||
}
|
||||
62
tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle.kts
Normal file
62
tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle.kts
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.currentplacedetailsonmap"
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||
versionCode = libs.versions.versionCode.get().toInt()
|
||||
versionName = libs.versions.versionName.get()
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
isDebuggable = true
|
||||
}
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
namespace = "com.example.currentplacedetailsonmap"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.playServicesMaps)
|
||||
implementation(libs.places)
|
||||
implementation(libs.volley)
|
||||
implementation(platform(libs.kotlinBom))
|
||||
testImplementation(libs.junit)
|
||||
}
|
||||
|
||||
secrets {
|
||||
propertiesFileName = "secrets.properties"
|
||||
defaultPropertiesFileName = "local.defaults.properties"
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://maven.google.com'
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
43
tutorials/java/CurrentPlaceDetailsOnMap/build.gradle.kts
Normal file
43
tutorials/java/CurrentPlaceDetailsOnMap/build.gradle.kts
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath(libs.gradle)
|
||||
classpath(libs.secretsGradlePlugin)
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://maven.google.com")
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
[versions]
|
||||
compileSdk = "34"
|
||||
gradle = "8.5.2"
|
||||
minSdk = "21"
|
||||
secretsGradlePlugin = "2.0.1"
|
||||
targetSdk = "34"
|
||||
versionCode = "1"
|
||||
versionName = "1.0"
|
||||
appcompat = "1.7.0"
|
||||
playServicesMaps = "19.0.0"
|
||||
places = "3.5.0"
|
||||
volley = "1.2.1"
|
||||
kotlinBom = "2.0.0"
|
||||
junit = "4.13.2"
|
||||
|
||||
[libraries]
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
||||
playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }
|
||||
places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" }
|
||||
secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" }
|
||||
volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" }
|
||||
@ -1 +0,0 @@
|
||||
include ':app'
|
||||
17
tutorials/java/CurrentPlaceDetailsOnMap/settings.gradle.kts
Normal file
17
tutorials/java/CurrentPlaceDetailsOnMap/settings.gradle.kts
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
include(":app")
|
||||
@ -1,49 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
defaultConfig {
|
||||
applicationId "com.example.mapwithmarker"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
namespace "com.example.mapwithmarker"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0"))
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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:
|
||||
// MAPS_API_KEY=YOUR_API_KEY
|
||||
defaultPropertiesFileName 'local.defaults.properties'
|
||||
}
|
||||
59
tutorials/java/MapWithMarker/app/build.gradle.kts
Normal file
59
tutorials/java/MapWithMarker/app/build.gradle.kts
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.mapwithmarker"
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||
versionCode = libs.versions.versionCode.get().toInt()
|
||||
versionName = libs.versions.versionName.get()
|
||||
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
namespace = "com.example.mapwithmarker"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.playServicesMaps)
|
||||
implementation(platform(libs.kotlinBom))
|
||||
implementation(libs.appcompat)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidxTestExtJunit)
|
||||
androidTestImplementation(libs.espressoCore)
|
||||
}
|
||||
|
||||
secrets {
|
||||
defaultPropertiesFileName = "local.defaults.properties"
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
39
tutorials/java/MapWithMarker/build.gradle.kts
Normal file
39
tutorials/java/MapWithMarker/build.gradle.kts
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:8.5.0")
|
||||
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
||||
20
tutorials/java/MapWithMarker/gradle/libs.versions.toml
Normal file
20
tutorials/java/MapWithMarker/gradle/libs.versions.toml
Normal file
@ -0,0 +1,20 @@
|
||||
[versions]
|
||||
compileSdk = "34"
|
||||
minSdk = "21"
|
||||
targetSdk = "34"
|
||||
versionCode = "1"
|
||||
versionName = "1.0"
|
||||
playServicesMaps = "19.0.0"
|
||||
kotlinBom = "2.0.0"
|
||||
appcompat = "1.7.0"
|
||||
junit = "4.13.2"
|
||||
androidxTestExtJunit = "1.2.1"
|
||||
espressoCore = "3.6.1"
|
||||
|
||||
[libraries]
|
||||
playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }
|
||||
kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" }
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" }
|
||||
espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
@ -1 +0,0 @@
|
||||
include ':app'
|
||||
17
tutorials/java/MapWithMarker/settings.gradle.kts
Normal file
17
tutorials/java/MapWithMarker/settings.gradle.kts
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
include(":app")
|
||||
@ -1,49 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
defaultConfig {
|
||||
applicationId "com.example.polygons"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
namespace "com.example.polygons"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0"))
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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:
|
||||
// MAPS_API_KEY=YOUR_API_KEY
|
||||
defaultPropertiesFileName 'local.defaults.properties'
|
||||
}
|
||||
59
tutorials/java/Polygons/app/build.gradle.kts
Normal file
59
tutorials/java/Polygons/app/build.gradle.kts
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.polygons"
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||
versionCode = libs.versions.versionCode.get().toInt()
|
||||
versionName = libs.versions.versionName.get()
|
||||
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
namespace = "com.example.polygons"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.playServicesMaps)
|
||||
implementation(platform(libs.kotlinBom))
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidxTestExtJunit)
|
||||
androidTestImplementation(libs.espressoCore)
|
||||
}
|
||||
|
||||
secrets {
|
||||
defaultPropertiesFileName = "local.defaults.properties"
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
39
tutorials/java/Polygons/build.gradle.kts
Normal file
39
tutorials/java/Polygons/build.gradle.kts
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:8.5.2")
|
||||
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
||||
20
tutorials/java/Polygons/gradle/libs.versions.toml
Normal file
20
tutorials/java/Polygons/gradle/libs.versions.toml
Normal file
@ -0,0 +1,20 @@
|
||||
[versions]
|
||||
compileSdk = "34"
|
||||
minSdk = "21"
|
||||
targetSdk = "34"
|
||||
versionCode = "1"
|
||||
versionName = "1.0"
|
||||
appcompat = "1.7.0"
|
||||
playServicesMaps = "19.0.0"
|
||||
kotlinBom = "2.0.0"
|
||||
junit = "4.13.2"
|
||||
androidxTestExtJunit = "1.2.1"
|
||||
espressoCore = "3.6.1"
|
||||
|
||||
[libraries]
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }
|
||||
kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" }
|
||||
espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
@ -1 +0,0 @@
|
||||
include ':app'
|
||||
17
tutorials/java/Polygons/settings.gradle.kts
Normal file
17
tutorials/java/Polygons/settings.gradle.kts
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
include (":app")
|
||||
@ -1,51 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
defaultConfig {
|
||||
applicationId "com.example.styledmap"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
namespace "com.example.styledmap"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0"))
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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'
|
||||
}
|
||||
65
tutorials/java/StyledMap/app/build.gradle.kts
Normal file
65
tutorials/java/StyledMap/app/build.gradle.kts
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.styledmap"
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||
versionCode = libs.versions.versionCode.get().toInt()
|
||||
versionName = libs.versions.versionName.get()
|
||||
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
targetCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
}
|
||||
|
||||
namespace = "com.example.styledmap"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.playServicesMaps)
|
||||
implementation(platform(libs.kotlinBom))
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidxTestExtJunit)
|
||||
androidTestImplementation(libs.espressoCore)
|
||||
}
|
||||
|
||||
secrets {
|
||||
propertiesFileName = "secrets.properties"
|
||||
defaultPropertiesFileName = "local.defaults.properties"
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
39
tutorials/java/StyledMap/build.gradle.kts
Normal file
39
tutorials/java/StyledMap/build.gradle.kts
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath(libs.gradle)
|
||||
classpath(libs.secretsGradlePlugin)
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
25
tutorials/java/StyledMap/gradle/libs.versions.toml
Normal file
25
tutorials/java/StyledMap/gradle/libs.versions.toml
Normal file
@ -0,0 +1,25 @@
|
||||
[versions]
|
||||
compileSdk = "34"
|
||||
gradle = "8.5.2"
|
||||
minSdk = "21"
|
||||
secretsGradlePlugin = "2.0.1"
|
||||
targetSdk = "34"
|
||||
versionCode = "1"
|
||||
versionName = "1.0"
|
||||
appcompat = "1.7.0"
|
||||
playServicesMaps = "19.0.0"
|
||||
kotlinBom = "2.0.0"
|
||||
junit = "4.13.2"
|
||||
androidxTestExtJunit = "1.2.1"
|
||||
espressoCore = "3.6.1"
|
||||
javaVersion = "21"
|
||||
|
||||
[libraries]
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
||||
playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }
|
||||
kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" }
|
||||
espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" }
|
||||
@ -1 +0,0 @@
|
||||
include ':app'
|
||||
17
tutorials/java/StyledMap/settings.gradle.kts
Normal file
17
tutorials/java/StyledMap/settings.gradle.kts
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
include (":app")
|
||||
@ -1,63 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
defaultConfig {
|
||||
applicationId "com.example.currentplacedetailsonmap"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
debuggable true
|
||||
}
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
namespace 'com.example.currentplacedetailsonmap'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
implementation 'com.google.android.libraries.places:places:3.5.0'
|
||||
implementation 'com.android.volley:volley:1.2.1'
|
||||
testImplementation'junit:junit:4.13.2'
|
||||
implementation "androidx.core:core-ktx:1.13.1"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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:
|
||||
// MAPS_API_KEY=YOUR_API_KEY
|
||||
defaultPropertiesFileName 'local.defaults.properties'
|
||||
}
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.currentplacedetailsonmap"
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||
versionCode = libs.versions.versionCode.get().toInt()
|
||||
versionName = libs.versions.versionName.get()
|
||||
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
isDebuggable = true
|
||||
}
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
targetCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
}
|
||||
|
||||
namespace = "com.example.currentplacedetailsonmap"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
androidTestImplementation(libs.espressoCore) {
|
||||
exclude(group = "com.android.support", module = "support-annotations")
|
||||
}
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.playServicesMaps)
|
||||
implementation(libs.places)
|
||||
implementation(libs.volley)
|
||||
testImplementation(libs.junit)
|
||||
implementation(libs.coreKtx)
|
||||
implementation(libs.lifecycleViewModelKtx)
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${libs.versions.kotlin.get()}")
|
||||
}
|
||||
|
||||
secrets {
|
||||
propertiesFileName = "secrets.properties"
|
||||
defaultPropertiesFileName = "local.defaults.properties"
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '2.0.0'
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://maven.google.com'
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
46
tutorials/kotlin/CurrentPlaceDetailsOnMap/build.gradle.kts
Normal file
46
tutorials/kotlin/CurrentPlaceDetailsOnMap/build.gradle.kts
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
val kotlinVersion by extra("2.0.0")
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath(libs.gradle)
|
||||
classpath(libs.kotlinGradlePlugin)
|
||||
classpath(libs.secretsGradlePlugin)
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://maven.google.com")
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
[versions]
|
||||
compileSdk = "34"
|
||||
gradle = "8.5.2"
|
||||
kotlinGradlePlugin = "2.0.0"
|
||||
minSdk = "21"
|
||||
secretsGradlePlugin = "2.0.1"
|
||||
targetSdk = "34"
|
||||
versionCode = "1"
|
||||
versionName = "1.0"
|
||||
kotlin = "2.0.0"
|
||||
appcompat = "1.7.0"
|
||||
playServicesMaps = "19.0.0"
|
||||
places = "3.5.0"
|
||||
volley = "1.2.1"
|
||||
junit = "4.13.2"
|
||||
coreKtx = "1.13.1"
|
||||
lifecycleViewModelKtx = "2.8.4"
|
||||
espressoCore = "3.0.2"
|
||||
javaVersion = "21"
|
||||
|
||||
[libraries]
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
||||
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
|
||||
playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }
|
||||
places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" }
|
||||
secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" }
|
||||
volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
|
||||
coreKtx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
lifecycleViewModelKtx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewModelKtx" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
espressoCore = { group = "com.android.support.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
@ -1 +0,0 @@
|
||||
include ':app'
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
include(":app")
|
||||
@ -1,57 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
defaultConfig {
|
||||
applicationId "com.example.mapwithmarker"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
namespace "com.example.mapwithmarker"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "androidx.core:core-ktx:1.13.1"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
|
||||
// Tests
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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:
|
||||
// MAPS_API_KEY=YOUR_API_KEY
|
||||
defaultPropertiesFileName 'local.defaults.properties'
|
||||
}
|
||||
68
tutorials/kotlin/MapWithMarker/app/build.gradle.kts
Normal file
68
tutorials/kotlin/MapWithMarker/app/build.gradle.kts
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.mapwithmarker"
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||
versionCode = libs.versions.versionCode.get().toInt()
|
||||
versionName = libs.versions.versionName.get()
|
||||
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
targetCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
}
|
||||
|
||||
namespace = "com.example.mapwithmarker"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.coreKtx)
|
||||
implementation(libs.kotlinStdlib)
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.playServicesMaps)
|
||||
|
||||
// Tests
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidxTestExtJunit)
|
||||
androidTestImplementation(libs.espressoCore)
|
||||
}
|
||||
|
||||
secrets {
|
||||
defaultPropertiesFileName = "local.defaults.properties"
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '2.0.0'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
43
tutorials/kotlin/MapWithMarker/build.gradle.kts
Normal file
43
tutorials/kotlin/MapWithMarker/build.gradle.kts
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath(libs.gradle)
|
||||
classpath(libs.secretsGradlePlugin)
|
||||
classpath(libs.kotlinGradlePlugin)
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
29
tutorials/kotlin/MapWithMarker/gradle/libs.versions.toml
Normal file
29
tutorials/kotlin/MapWithMarker/gradle/libs.versions.toml
Normal file
@ -0,0 +1,29 @@
|
||||
[versions]
|
||||
compileSdk = "34"
|
||||
gradle = "8.5.2"
|
||||
kotlinGradlePlugin = "2.0.0"
|
||||
minSdk = "21"
|
||||
secretsGradlePlugin = "2.0.1"
|
||||
targetSdk = "34"
|
||||
versionCode = "1"
|
||||
versionName = "1.0"
|
||||
kotlin = "2.0.0"
|
||||
coreKtx = "1.13.1"
|
||||
appcompat = "1.7.0"
|
||||
playServicesMaps = "19.0.0"
|
||||
junit = "4.13.2"
|
||||
androidxTestExtJunit = "1.2.1"
|
||||
espressoCore = "3.6.1"
|
||||
javaVersion = "21"
|
||||
|
||||
[libraries]
|
||||
coreKtx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
||||
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
|
||||
kotlinStdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk7", version.ref = "kotlin" }
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" }
|
||||
espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" }
|
||||
@ -1 +0,0 @@
|
||||
include ':app'
|
||||
17
tutorials/kotlin/MapWithMarker/settings.gradle.kts
Normal file
17
tutorials/kotlin/MapWithMarker/settings.gradle.kts
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
include (":app")
|
||||
@ -1,55 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
defaultConfig {
|
||||
applicationId "com.example.polygons"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
namespace "com.example.polygons"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:19.0.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
implementation "androidx.core:core-ktx:1.13.1"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
|
||||
secrets {
|
||||
// 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:
|
||||
// MAPS_API_KEY=YOUR_API_KEY
|
||||
defaultPropertiesFileName 'local.defaults.properties'
|
||||
}
|
||||
68
tutorials/kotlin/Polygons/app/build.gradle.kts
Normal file
68
tutorials/kotlin/Polygons/app/build.gradle.kts
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.polygons"
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||
versionCode = libs.versions.versionCode.get().toInt()
|
||||
versionName = libs.versions.versionName.get()
|
||||
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
targetCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get())
|
||||
}
|
||||
|
||||
namespace = "com.example.polygons"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.playServicesMaps)
|
||||
implementation(libs.coreKtx)
|
||||
implementation(libs.kotlinStdlib)
|
||||
|
||||
// Tests
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidxTestExtJunit)
|
||||
androidTestImplementation(libs.espressoCore)
|
||||
}
|
||||
|
||||
secrets {
|
||||
defaultPropertiesFileName = "local.defaults.properties"
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '2.0.0'
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
44
tutorials/kotlin/Polygons/build.gradle.kts
Normal file
44
tutorials/kotlin/Polygons/build.gradle.kts
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
val kotlinVersion = "2.0.0"
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:8.5.0")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
||||
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
||||
23
tutorials/kotlin/Polygons/gradle/libs.versions.toml
Normal file
23
tutorials/kotlin/Polygons/gradle/libs.versions.toml
Normal file
@ -0,0 +1,23 @@
|
||||
[versions]
|
||||
compileSdk = "34"
|
||||
minSdk = "21"
|
||||
targetSdk = "34"
|
||||
versionCode = "1"
|
||||
versionName = "1.0"
|
||||
kotlin = "1.8.0" # Replace with your Kotlin version if different
|
||||
appcompat = "1.7.0"
|
||||
playServicesMaps = "19.0.0"
|
||||
junit = "4.13.2"
|
||||
androidxTestExtJunit = "1.2.1"
|
||||
espressoCore = "3.6.1"
|
||||
coreKtx = "1.13.1"
|
||||
javaVersion = "21"
|
||||
|
||||
[libraries]
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }
|
||||
coreKtx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" }
|
||||
espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
kotlinStdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk7", version.ref = "kotlin" }
|
||||
17
tutorials/kotlin/Polygons/settings.gradle.kts
Normal file
17
tutorials/kotlin/Polygons/settings.gradle.kts
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* http://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.
|
||||
*/
|
||||
|
||||
include (":app")
|
||||
Loading…
x
Reference in New Issue
Block a user