取得 Android Consumer SDK
如要在 Android 消費者應用程式中分享隨選行程的旅程,請使用 Consumer SDK。如要進一步瞭解如何使用 Consumer SDK 追蹤行程,請參閱「在 Android 中追蹤行程」。
如要為 Android 消費者應用程式設定 Consumer SDK,請按照下列步驟操作:
- 檢查最低系統需求
- 取得 Consumer SDK
- 設定 Google Cloud 控制台專案
- 取得驗證權杖
- 初始化 Consumer SDK
檢查最低系統需求
請參閱版本資訊,瞭解您所使用的 Consumer SDK 版本的最低需求條件。請參閱版本資訊。
如要使用 Consumer SDK:應用程式必須指定 minSdkVersion
23 以上版本。
如要執行使用 Consumer SDK 的應用程式:Android 行動裝置必須符合下列最低要求:
從 Google Maven 存放區取得 Consumer SDK
請從 Google Maven 存放區取得 Consumer SDK 2.1.0 以上版本。先前使用的私人存放區管道已淘汰。
請將以下內容新增到 build.gradle
檔案中:
repositories {
...
google()
}
請將以下內容新增到 pom.xml
檔案中:
<project>
...
<repositories>
<repository>
<id>google-maven-repository</id>
<url>https://maven.google.com</url>
</repository>
</repositories>
...
</project>
後續步驟
設定 Google Cloud 控制台專案
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-28 (世界標準時間)。
[null,null,["上次更新時間:2025-02-28 (世界標準時間)。"],[[["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"]]