รับ Android Consumer SDK
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หากต้องการแชร์เส้นทางสำหรับการเดินทางแบบออนดีมานด์ในแอปสำหรับผู้บริโภค Android ให้ใช้ Consumer SDK ดูข้อมูลเพิ่มเติมเกี่ยวกับการติดตามการเดินทางโดยใช้ Consumer SDK ได้ที่ติดตามการเดินทางใน Android
หากต้องการตั้งค่า Consumer SDK สําหรับแอปสําหรับผู้บริโภค Android ให้ทําตามขั้นตอนต่อไปนี้
- ตรวจสอบข้อกำหนดขั้นต่ำของระบบ
- รับ Consumer SDK
- กำหนดค่าโปรเจ็กต์คอนโซล Google Cloud
- รับโทเค็นการตรวจสอบสิทธิ์
- เริ่มต้นใช้งาน Consumer SDK
ตรวจสอบข้อกำหนดขั้นต่ำของระบบ
ดูข้อกำหนดขั้นต่ำของ SDK เวอร์ชันสำหรับผู้บริโภคที่คุณใช้ได้จากหมายเหตุประจำรุ่น ดูบันทึกประจำรุ่น
หากต้องการใช้ Consumer SDK: แอปของคุณต้องกำหนดเป้าหมายเป็น minSdkVersion
23 ขึ้นไป
หากต้องการเรียกใช้แอปที่ใช้ Consumer SDK อุปกรณ์เคลื่อนที่ Android ต้องมีคุณสมบัติตรงตามข้อกําหนดขั้นต่ำต่อไปนี้
รับ Consumer SDK จากที่เก็บ Maven ของ Google
รับ Consumer SDK เวอร์ชัน 2.1.0 ขึ้นไปจากที่เก็บ Maven ของ Google
เราได้เลิกใช้งานช่องทางที่เก็บข้อมูลส่วนตัวที่ใช้ก่อนหน้านี้แล้ว
Gradle
เพิ่มโค้ดต่อไปนี้ในไฟล์ build.gradle
repositories {
...
google()
}
Maven
เพิ่มโค้ดต่อไปนี้ในไฟล์ pom.xml
<project>
...
<repositories>
<repository>
<id>google-maven-repository</id>
<url>https://maven.google.com</url>
</repository>
</repositories>
...
</project>
ขั้นตอนถัดไป
กำหนดค่าโปรเจ็กต์คอนโซล Google Cloud
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-02-25 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-02-25 UTC"],[[["The Google Maps Platform Consumer SDK enables journey sharing for on-demand trips in Android consumer apps."],["Android apps using the SDK must target minSdkVersion 23 or higher and have Google Play services installed."],["The Consumer SDK can be obtained from the Google Maven repository (versions 2.1.0 and later)."],["Before implementing, ensure the device meets minimum requirements including Android 6.0 (API level 23) or later."],["Next steps include configuring a Google Cloud Console project and obtaining authentication tokens."]]],["To share on-demand journeys in Android apps, utilize the Consumer SDK. First, verify the minimum system requirements, which include Android 6.0 (API level 23) or later, and Google Play services. Next, retrieve the Consumer SDK (version 2.1.0 or later) from the Google Maven repository by modifying the `build.gradle` or `pom.xml` file to include the Google repository. Finally, configure a Google Cloud console project. Authentication and SDK initialization are also required.\n"]]