Tải SDK Android cho người tiêu dùng
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Để chia sẻ hành trình cho các chuyến đi theo yêu cầu trong ứng dụng tiêu dùng Android, hãy sử dụng Consumer SDK. Để biết thêm thông tin về cách theo dõi chuyến đi bằng Consumer SDK, hãy xem phần Theo dõi chuyến đi trên Android.
Để thiết lập Consumer SDK cho ứng dụng tiêu dùng Android, hãy làm theo các bước sau:
- Kiểm tra các yêu cầu tối thiểu về hệ thống
- Tải Consumer SDK xuống
- Định cấu hình một dự án trên Google Cloud Console
- Lấy mã thông báo xác thực
- Khởi chạy Consumer SDK
Kiểm tra các yêu cầu tối thiểu về hệ thống
Hãy xem ghi chú phát hành để biết các yêu cầu tối thiểu đối với phiên bản Consumer SDK mà bạn đang sử dụng. Xem Ghi chú phát hành.
Để sử dụng Consumer SDK: Ứng dụng của bạn phải nhắm đến minSdkVersion
23 trở lên.
Để chạy một ứng dụng sử dụng Consumer SDK: Thiết bị di động Android phải đáp ứng các yêu cầu tối thiểu sau:
Tải Consumer SDK từ kho lưu trữ Google Maven
Tải Consumer SDK phiên bản 2.1.0 trở lên từ kho lưu trữ Maven của Google.
Kênh kho lưu trữ riêng tư đã dùng trước đây không còn được dùng nữa.
Gradle
Thêm đoạn mã sau vào tệp build.gradle
của bạn:
repositories {
...
google()
}
Maven
Thêm đoạn mã sau vào tệp pom.xml
của bạn:
<project>
...
<repositories>
<repository>
<id>google-maven-repository</id>
<url>https://maven.google.com</url>
</repository>
</repositories>
...
</project>
Bước tiếp theo
Định cấu hình dự án trên Google Cloud Console
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-16 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-16 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"]]