คู่มือนี้แสดงข้อกำหนดการกำหนดค่าบิลด์สำหรับการใช้ Navigation SDK สำหรับ Android วิธีการเหล่านี้ถือว่าคุณได้ติดตั้ง Android IDE และคุ้นเคยกับการพัฒนา Android แล้ว
ข้อกำหนดขั้นต่ำสำหรับการใช้ Navigation SDK
ข้อกำหนดเหล่านี้มีผลกับ Navigation SDK สำหรับ Android เวอร์ชัน 4.99 และเก่ากว่า
-
โปรเจ็กต์ที่เปิดใช้ Navigation SDK หากต้องการจัดสรร โปรดสอบถามตัวแทน Google Maps Platform
แอปของคุณต้องกำหนดเป้าหมายเป็น API ระดับ 30 ขึ้นไป
หากต้องการเรียกใช้แอปที่สร้างด้วย Navigation SDK อุปกรณ์ Android ต้องติดตั้งและเปิดใช้บริการ Google Play
ต้องเพิ่มข้อความการระบุแหล่งที่มาและการอนุญาตให้ใช้สิทธิลงในแอป
ตั้งค่าโปรเจ็กต์: โปรเจ็กต์ Cloud Console และโปรเจ็กต์ Android
ก่อนที่จะสร้างหรือทดสอบแอป คุณต้องสร้างโปรเจ็กต์คอนโซล Cloud และเพิ่มข้อมูลเข้าสู่ระบบคีย์ API โปรเจ็กต์ต้องมีการจัดสรรเพื่อเข้าถึง Navigation SDK คีย์ทั้งหมดภายในโปรเจ็กต์คอนโซล Cloud จะได้รับสิทธิ์เข้าถึง Navigation SDK เหมือนกัน คีย์หนึ่งๆ อาจมีโปรเจ็กต์การพัฒนาที่เชื่อมโยงอยู่มากกว่า 1 โปรเจ็กต์ หากคุณมีโปรเจ็กต์คอนโซลอยู่แล้ว คุณสามารถเพิ่มคีย์ลงในโปรเจ็กต์ปัจจุบันได้
วิธีตั้งค่า
- ในเว็บเบราว์เซอร์ที่ต้องการ ให้ลงชื่อเข้าใช้ Cloud Console และสร้างโปรเจ็กต์ Cloud Console
- ใน IDE เช่น Android Studio ให้สร้างโปรเจ็กต์การพัฒนาแอป Android และจดชื่อแพ็กเกจไว้
- ติดต่อตัวแทน Google Maps Platform เพื่อให้สิทธิ์เข้าถึง Navigation SDK สำหรับโปรเจ็กต์ Cloud Console
- ขณะอยู่ในแดชบอร์ดคอนโซล Cloud ในเว็บเบราว์เซอร์ ให้สร้างข้อมูลเข้าสู่ระบบเพื่อสร้างคีย์ API ที่มีข้อจำกัด
- ในหน้าคีย์ API ให้คลิกแอป Android ในส่วนข้อจำกัดของแอปพลิเคชัน
- คลิกเพิ่มชื่อแพ็กเกจและลายนิ้วมือ แล้วป้อนชื่อแพ็กเกจของโปรเจ็กต์การพัฒนาและลายนิ้วมือ SHA-1 สำหรับคีย์นั้น
- คลิกบันทึก
เพิ่ม Navigation SDK ลงในโปรเจ็กต์
Navigation SDK พร้อมใช้งานโดยใช้ Maven หรือเป็นแพ็กเกจ AAR หลังจากสร้างโปรเจ็กต์การพัฒนาแล้ว คุณจะผสานรวม SDK เข้ากับโปรเจ็กต์ได้โดยใช้วิธีใดวิธีหนึ่งต่อไปนี้
ใช้ Maven สำหรับ Navigation SDK v4.5 ขึ้นไป (แนะนำ)
ตัวอย่างต่อไปนี้ใช้ที่เก็บ Maven ของ google() ซึ่งเป็นวิธีที่ง่ายที่สุดและแนะนำในการเพิ่ม Navigation SDK ลงในโปรเจ็กต์
เพิ่มทรัพยากร Dependency ต่อไปนี้ลงในการกำหนดค่า Gradle หรือ Maven โดยแทนที่ตัวยึดตำแหน่ง
VERSION_NUMBERด้วยเวอร์ชันของ Navigation SDK สำหรับ AndroidGradle
เพิ่มโค้ดต่อไปนี้ใน
build.gradleระดับโมดูลdependencies { ... implementation 'com.google.android.libraries.navigation:navigation:VERSION_NUMBER' }หากอัปเกรดจากที่เก็บ Maven เดิม โปรดทราบว่าชื่อกลุ่มและอาร์ติแฟกต์มีการเปลี่ยนแปลง และไม่จำเป็นต้องใช้ปลั๊กอิน
com.google.cloud.artifactregistry.gradle-pluginอีกต่อไปและเพิ่มโค้ดต่อไปนี้ลงใน
build.gradleระดับบนสุดallprojects { ... // Required: you must exclude the Google Play service Maps SDK from // your transitive dependencies to make nsure there won't be // multiple copies of Google Maps SDK in your binary, as the Navigation // SDK already bundles the Google Maps SDK. configurations { implementation { exclude group: 'com.google.android.gms', module: 'play-services-maps' } } }Maven
เพิ่มโค้ดต่อไปนี้ใน
pom.xml<dependencies> ... <dependency> <groupId>com.google.android.libraries.navigation</groupId> <artifactId>navigation</artifactId> <version>VERSION_NUMBER</version> </dependency> </dependencies>หากคุณมีทรัพยากร Dependency ที่ใช้ Maps SDK คุณต้องยกเว้นทรัพยากร Dependency ในทรัพยากร Dependency ที่ประกาศแต่ละรายการซึ่งใช้ Maps SDK
<dependencies> <dependency> <groupId>project.that.brings.in.maps</groupId> <artifactId>MapsConsumer</artifactId> <version>1.0</version> <exclusions> <!-- Navigation SDK already bundles Maps SDK. You must exclude it to prevent duplication--> <exclusion> <!-- declare the exclusion here --> <groupId>com.google.android.gms</groupId> <artifactId>play-services-maps</artifactId> </exclusion> </exclusions> </dependency> </dependencies>
ใช้ Maven สำหรับ Navigation SDK เวอร์ชันก่อน v4.5 หรือใช้กับ Driver SDK
Navigation SDK จะยังคงพร้อมใช้งานโดยใช้ที่เก็บ Maven เดิมตลอดเวอร์ชัน v4 ที่เหลือ ไลบรารีนี้เป็นไลบรารีเดียวกันกับการอัปเดตทั้งหมดที่เหมือนกับเวอร์ชันด้านบน และให้ความเข้ากันได้กับ Driver SDK และไลบรารีอื่นๆ ในระหว่างการเปลี่ยนผ่าน
การใช้ทรัพยากร Dependency นี้ต้องเข้าสู่ระบบโปรเจ็กต์ที่อยู่ในระบบคลาวด์โดยใช้ gcloud เมื่อคอมไพล์
- ตั้งค่าสภาพแวดล้อมเพื่อเข้าถึงที่เก็บ Maven ของ Google ตามที่อธิบายไว้ในส่วนข้อกำหนดเบื้องต้นของเอกสารประกอบ Consumer SDK สิทธิ์เข้าถึง Navigation SDK จะควบคุมผ่านกลุ่ม Workspace
เพิ่มทรัพยากร Dependency ต่อไปนี้ลงในการกำหนดค่า Gradle หรือ Maven โดยแทนที่ตัวยึดตำแหน่ง
VERSION_NUMBERด้วยเวอร์ชันของ Navigation SDKGradle
เพิ่มโค้ดต่อไปนี้ใน
build.gradleระดับโมดูลdependencies { ... implementation 'com.google.android.maps:navsdk:VERSION_NUMBER' }และเพิ่มโค้ดต่อไปนี้ลงใน
build.gradleระดับบนสุดallprojects { ... // Required: you must exclude the Google Play service Maps SDK from // your transitive dependencies to make sure there won't be // multiple copies of Google Maps SDK in your binary, as the Navigation // SDK already bundles the Google Maps SDK. configurations { implementation { exclude group: 'com.google.android.gms', module: 'play-services-maps' } } }Maven
เพิ่มโค้ดต่อไปนี้ใน
pom.xml<dependencies> ... <dependency> <groupId>com.google.android.maps</groupId> <artifactId>navsdk</artifactId> <version>VERSION_NUMBER</version> </dependency> </dependencies>หากคุณมีทรัพยากร Dependency ที่ใช้ Maps SDK คุณต้องยกเว้นทรัพยากร Dependency ในทรัพยากร Dependency ที่ประกาศแต่ละรายการซึ่งใช้ Maps SDK
<dependencies> <dependency> <groupId>project.that.brings.in.maps</groupId> <artifactId>MapsConsumer</artifactId> <version>1.0</version> <exclusions> <!-- Navigation SDK already bundles Maps SDK. You must exclude it to prevent duplication--> <exclusion> <!-- declare the exclusion here --> <groupId>com.google.android.gms</groupId> <artifactId>play-services-maps</artifactId> </exclusion> </exclusions> </dependency> </dependencies>
ใช้แพ็กเกจ AAR ที่ดาวน์โหลด (ไม่แนะนำ)
Navigation SDK ยังพร้อมใช้งานเป็นแพ็กเกจ AAR ด้วย หลังจากสร้างโปรเจ็กต์การพัฒนาแล้ว คุณจะผสานรวม SDK ได้ วิธีการเหล่านี้ถือว่าคุณใช้ Android Studio สำหรับ IDE
ดาวน์โหลด Navigation SDK เวอร์ชันล่าสุดจาก Google ไดรฟ์ที่แชร์ แล้วแตกไฟล์ หากไม่มีสิทธิ์เข้าถึง โปรดติดต่อตัวแทนของคุณ
ใน Android Studio ให้เปิดโปรเจ็กต์และเพิ่มแพ็กเกจบริการ Google Play โดยใช้เครื่องมือจัดการ SDK
จากไดเรกทอรีไฟล์ ZIP ให้คัดลอก
libs/google_navigation_navmap.aarไปยังไดเรกทอรีapp/libsของโปรเจ็กต์เพิ่มโค้ดต่อไปนี้ใน
build.gradleระดับโมดูลimplementation(name: 'google_navigation_navmap', ext: 'aar')และเพิ่มโค้ดต่อไปนี้ลงใน
build.gradleระดับบนสุดallprojects { ... // Required: you must exclude the Google Play service Maps SDK from // your transitive dependencies to make sure there won't be // multiple copies of Google Maps SDK in your binary, as the Navigation // SDK already bundles the Google Maps SDK. configurations { implementation { exclude group: 'com.google.android.gms', module: 'play-services-maps' } } }
กำหนดค่าบิลด์
หลังจากสร้างโปรเจ็กต์แล้ว คุณสามารถกำหนดการตั้งค่าสำหรับการสร้างและการใช้ Navigation SDK ที่ประสบความสำเร็จได้
อัปเดตพร็อพเพอร์ตี้ในพื้นที่
- ในโฟลเดอร์ Gradle Scripts ให้เปิดไฟล์
local.propertiesและเพิ่มandroid.useDeprecatedNdk=true
อัปเดตสคริปต์บิลด์ Gradle
เปิดไฟล์
build.gradle (Module:app)และใช้หลักเกณฑ์ต่อไปนี้เพื่ออัปเดตการตั้งค่าให้เป็นไปตามข้อกำหนดสำหรับ Navigation SDK และพิจารณาตั้งค่าตัวเลือกการเพิ่มประสิทธิภาพด้วยการตั้งค่าที่จำเป็นสำหรับ Navigation SDK
- ตั้งค่า
minSdkVersionเป็น 23 ขึ้นไป - ตั้งค่า
targetSdkVersionเป็น 30 ขึ้นไป - เพิ่มการตั้งค่า
dexOptionsที่เพิ่มjavaMaxHeapSize - กำหนดตำแหน่งสำหรับไลบรารีเพิ่มเติม
- เพิ่ม
repositoriesและdependenciesสำหรับ Navigation SDK - แทนที่หมายเลขเวอร์ชันในทรัพยากร Dependency ด้วยเวอร์ชันล่าสุดที่มีอยู่
การตั้งค่าที่ไม่บังคับเพื่อลดเวลาในการสร้าง
- เปิดใช้การลดขนาดโค้ดและการลดขนาดทรัพยากรโดยใช้ R8/ProGuard เพื่อนำโค้ดและทรัพยากรที่ไม่ได้ใช้งานออกจากทรัพยากร Dependency หากขั้นตอน R8/ProGuard ใช้เวลาในการรันนานเกินไป ให้พิจารณาเปิดใช้ Multidex สำหรับงานพัฒนา
- ลดจำนวนคำแปลภาษาที่รวมอยู่ในบิลด์: ตั้งค่า
resConfigsสำหรับภาษาเดียวในระหว่างการพัฒนา สำหรับบิลด์สุดท้าย ให้ตั้งค่าresConfigsสำหรับภาษาที่คุณใช้จริง โดยค่าเริ่มต้น Gradle จะรวมสตริงทรัพยากรสำหรับทุกภาษาที่ Navigation SDK รองรับ
- ตั้งค่า
ด้านล่างนี้คือตัวอย่างสคริปต์บิลด์ Gradle สำหรับแอปพลิเคชัน ตรวจสอบแอปตัวอย่างเพื่อดูชุดทรัพยากร Dependency ที่อัปเดตแล้ว เนื่องจาก Navigation SDK เวอร์ชันที่คุณใช้อาจล้ำหน้าหรือล้าหลังกว่าเอกสารประกอบนี้เล็กน้อย
apply plugin: 'com.android.application'
apply plugin: 'com.google.cloud.artifactregistry.gradle-plugin'
ext {
androidxVersion = "1.0.0"
lifecycle_version = "1.1.1"
}
android {
compileSdkVersion 30
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "<your id>"
// Navigation SDK supports SDK 23 and later.
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
// Set this to the languages you actually use, otherwise you'll include resource strings
// for all languages supported by the Navigation SDK.
resConfigs "en"
multiDexEnabled true
}
dexOptions {
// This increases the amount of memory available to the dexer. This is required to build
// apps using the Navigation SDK.
javaMaxHeapSize "4g"
}
buildTypes {
// Run ProGuard. Note that the Navigation SDK includes its own ProGuard configuration.
// The configuration is included transitively by depending on the Navigation SDK.
// If the ProGuard step takes too long, consider enabling multidex for development work
// instead.
all {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
// This tells Gradle where to look to find additional libraries - in this case, the
// google_navigation_navmap.aar file.
repositories {
flatDir {
dirs 'libs'
}
google()
// Required for accessing the Navigation SDK on Google's Maven repository.
maven {
url "artifactregistry://us-west2-maven.pkg.dev/gmp-artifacts/transportation"
}
}
dependencies {
// Include the Google Navigation SDK
implementation 'com.google.android.maps:navsdk:4.4.0'
// The included AAR file under libs can be used instead of the Maven repository.
// Uncomment the line below and comment out the previous dependency to use
// the AAR file instead. Make sure that you add the AAR file to the libs directory.
// implementation(name: 'google_navigation_navmap', ext: 'aar')
// These dependencies are required for the Navigation SDK to function
// properly at runtime.
implementation 'org.chromium.net:cronet-fallback:69.3497.100'
// Optional for Cronet users:
// implementation 'org.chromium.net:cronet-api:69.3497.100'
implementation 'androidx.appcompat:appcompat:${androidxVersion}'
implementation 'androidx.cardview:cardview:${androidxVersion}'
implementation 'com.google.android.material:material:${androidxVersion}'
implementation 'androidx.mediarouter:mediarouter:${androidxVersion}'
implementation 'androidx.preference:preference:${androidxVersion}'
implementation 'androidx.recyclerview:recyclerview:${androidxVersion}'
implementation 'androidx.legacy:legacy-support-v4:${androidxVersion}'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.github.bumptech.glide:okhttp-integration:4.9.0'
implementation 'android.arch.lifecycle:common-java8:$lifecycle_version'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.datatransport:transport-api:2.2.0'
implementation 'com.google.android.datatransport:transport-backend-cct:2.2.0'
implementation 'com.google.android.datatransport:transport-runtime:2.2.0'
implementation 'joda-time:joda-time:2.9.9'
annotationProcessor 'androidx.annotation:annotation:1.1.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
เพิ่มคีย์ API ลงในแอป
ส่วนนี้จะอธิบายวิธีจัดเก็บคีย์ API เพื่อให้แอปอ้างอิงได้อย่างปลอดภัย คุณไม่ควรตรวจสอบคีย์ API ในระบบควบคุมเวอร์ชัน เราจึงขอแนะนำให้จัดเก็บไว้ในไฟล์ secrets.properties ในไดเรกทอรีรากของโปรเจ็กต์และยกเว้นไฟล์นั้นจากการควบคุมเวอร์ชัน ดูข้อมูลเพิ่มเติมเกี่ยวกับไฟล์พร็อพเพอร์ตี้ Gradle ได้ที่ไฟล์พร็อพเพอร์ตี้ Gradle
เราขอแนะนำให้ใช้ปลั๊กอินข้อมูลลับ Gradle สำหรับ Android เพื่อให้งานนี้ง่ายขึ้น
วิธีติดตั้งปลั๊กอินข้อมูลลับ Gradle สำหรับ Android และจัดเก็บคีย์ API
-
ใน Android Studio ให้เปิดไฟล์
build.gradle.ktsหรือbuild.gradleระดับบนสุด แล้วเพิ่มโค้ดต่อไปนี้ลงในบล็อกpluginsKotlin
plugins { // ... id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") version "2.0.1" apply false }
ดึงดูด
plugins { // ... id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false }
-
เปิดไฟล์
build.gradle.ktsหรือbuild.gradleระดับโมดูล แล้วเพิ่มโค้ดต่อไปนี้ลงในองค์ประกอบpluginsKotlin
plugins { id("com.android.application") // ... id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") }
ดึงดูด
plugins { id 'com.android.application' // ... id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' }
- หากใช้ Android Studio ให้ซิงค์โปรเจ็กต์กับ Gradle
-
เปิดไฟล์
secrets.propertiesในไดเรกทอรีระดับบนสุด แล้วเพิ่มโค้ดต่อไปนี้ แทนที่YOUR_API_KEYด้วยคีย์ API ของคุณ อย่าลืมเพิ่มsecrets.propertiesลงในไฟล์.gitignore(หรือยกเว้นจากระบบควบคุมเวอร์ชัน) เพื่อไม่ให้คุณตรวจสอบคีย์ API ในการควบคุมเวอร์ชันMAPS_API_KEY=YOUR_API_KEY
-
สร้างไฟล์
local.defaults.propertiesในไดเรกทอรีระดับบนสุด ซึ่งเป็นโฟลเดอร์เดียวกับไฟล์secrets.propertiesแล้วเพิ่มโค้ดต่อไปนี้MAPS_API_KEY=DEFAULT_API_KEY
วัตถุประสงค์ของไฟล์นี้คือการระบุตำแหน่งสำรองสำหรับคีย์ API หากไม่พบไฟล์
secrets.propertiesเพื่อไม่ให้บิลด์ล้มเหลว กรณีนี้อาจเกิดขึ้นหากคุณโคลนแอปจากระบบควบคุมเวอร์ชันที่ละเว้นsecrets.propertiesและคุณยังไม่ได้สร้างไฟล์secrets.propertiesในเครื่องเพื่อระบุคีย์ API -
คุณสามารถเพิ่มคีย์ API ลงในไฟล์
AndroidManifest.xmlหรือระบุคีย์ API โดยใช้โปรแกรมก็ได้- เพิ่มคีย์ API ลงใน
AndroidManifest.xmlโดยทำดังนี้<meta-data android:name="com.google.android.geo.API_KEY" android:value="${MAPS_API_KEY}" />หมายเหตุ:
com.google.android.geo.API_KEYคือชื่อข้อมูลเมตาที่แนะนำสำหรับคีย์ API คีย์ที่มีชื่อนี้สามารถใช้เพื่อตรวจสอบสิทธิ์กับ API ที่อิงตาม Google Maps หลายรายการในแพลตฟอร์ม Android รวมถึง Navigation SDK สำหรับ Android นอกจากนี้ API ยังรองรับชื่อcom.google.android.maps.v2.API_KEYเพื่อให้เข้ากันได้แบบย้อนหลังด้วย ชื่อเดิมนี้อนุญาตให้ตรวจสอบสิทธิ์กับ Android Maps API v2 เท่านั้น แอปพลิเคชันสามารถระบุชื่อข้อมูลเมตาของคีย์ API ได้เพียงชื่อเดียวเท่านั้น หากระบุทั้ง 2 รายการ API จะแสดงข้อยกเว้น - ระบุคีย์ API แบบเป็นโปรแกรมโดยทำดังนี้
ปลั๊กอิน Secrets Gradle จะทำให้คีย์พร้อมใช้งานในคลาส
BuildConfigในการเริ่มต้นแอป (เช่น ในเมธอดApplication.onCreate()) ให้เรียกใช้เมธอดดังนี้Kotlin
- เพิ่มคำสั่งนำเข้าต่อไปนี้
import com.google.android.libraries.navigation.NavigationApi
- เพิ่มโค้ดต่อไปนี้ในเมธอด
Application.onCreate()NavigationApi.setApiKey(BuildConfig.MAPS_API_KEY)
Java
- เพิ่มคำสั่งนำเข้าต่อไปนี้
import com.google.android.libraries.navigation.NavigationApi;
- เพิ่มโค้ดต่อไปนี้ในเมธอด
Application.onCreate()NavigationApi.setApiKey(BuildConfig.MAPS_API_KEY);
หมายเหตุ: โปรดคำนึงถึงสิ่งต่อไปนี้เมื่อใช้setApiKey()- ระบุคีย์ API ที่ไม่ใช่ค่า Null และไม่ว่างเปล่า
- เรียกใช้
setApiKey()เพียงครั้งเดียวตลอดอายุการใช้งานของแอปพลิเคชัน เมธอดจะแสดงIllegalStateExceptionหากมีการเรียกใช้มากกว่า 1 ครั้ง - เรียกใช้
setApiKey()ก่อนเริ่มต้นคอมโพเนนต์ Navigation SDK อื่นๆ เช่นNavigator - คีย์ที่คุณระบุด้วยวิธีนี้จะลบล้างคีย์ API ใน
AndroidManifest.xml - ใช้ Navigation SDK เวอร์ชัน 7.6 ขึ้นไป
- เพิ่มคำสั่งนำเข้าต่อไปนี้
- เพิ่มคีย์ API ลงใน
-
ใน Android Studio ให้เปิดไฟล์
build.gradle.ktsหรือbuild.gradleระดับโมดูล แล้วแก้ไขพร็อพเพอร์ตี้secretsหากไม่มีพร็อพเพอร์ตี้secretsให้เพิ่มพร็อพเพอร์ตี้ดังกล่าวแก้ไขพร็อพเพอร์ตี้ของปลั๊กอินเพื่อตั้งค่า
propertiesFileNameเป็น"secrets.properties", ตั้งค่าdefaultPropertiesFileNameเป็น"local.defaults.properties"และตั้งค่าพร็อพเพอร์ตี้อื่นๆKotlin
secrets { // To add your Maps API key to this project: // 1. If the secrets.properties file does not exist, create it in the root directory (the same folder as the root 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" }
ดึงดูด
secrets { // To add your Maps API key to this project: // 1. If the secrets.properties file does not exist, create it in the root directory (the same folder as the root 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" }
รวมการระบุแหล่งที่มาที่จำเป็นในแอป
หากใช้ Navigation SDK สำหรับ Android ในแอป คุณต้องใส่ข้อความแสดงแหล่งที่มาและใบอนุญาตโอเพนซอร์สเป็นส่วนหนึ่งของส่วนประกาศทางกฎหมายของแอป
คุณดูข้อความแสดงแหล่งที่มาและใบอนุญาตโอเพนซอร์สที่จำเป็นได้ในไฟล์ ZIP ของ Navigation SDK สำหรับ Android ดังนี้
NOTICE.txtLICENSES.txt