Pobierz pakiet Android Consumer SDK
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wybierz platformę:
Android
iOS
JavaScript
Aby udostępniać trasy przejazdów na żądanie w aplikacjach konsumenckich na Androida, użyj pakietu Consumer SDK. Więcej informacji o śledzeniu przejazdu za pomocą pakietu Consumer SDK znajdziesz w artykule Śledzenie przejazdu na Androidzie.
Aby skonfigurować pakiet Consumer SDK w aplikacji konsumenckiej na Androida, wykonaj te czynności:
- Sprawdź minimalne wymagania systemowe
- Pobieranie pakietu SDK dla konsumentów
- Konfigurowanie projektu w konsoli Google Cloud
- Uzyskiwanie tokenów uwierzytelniania
- Inicjowanie pakietu SDK dla konsumentów
Sprawdź minimalne wymagania systemowe
W informacjach o wersji znajdziesz minimalne wymagania dotyczące używanej wersji pakietu SDK dla konsumentów. Zobacz Informacje o wersji.
Aby korzystać z pakietu SDK dla konsumentów: aplikacja musi być kierowana na interfejs API na poziomie minSdkVersion
23 lub wyższym.
Aby uruchomić aplikację korzystającą z pakietu SDK dla konsumentów: urządzenia mobilne z Androidem muszą spełniać te minimalne wymagania:
Pobieranie pakietu SDK dla konsumentów z repozytorium Google Maven
Pobierz pakiet SDK dla konsumentów w wersji 2.1.0 lub nowszej z repozytorium Google Maven.
Wcześniej używany kanał prywatnego repozytorium został wycofany.
Gradle
Dodaj do pliku build.gradle
te informacje:
repositories {
...
google()
}
Maven
Dodaj do pliku pom.xml
te informacje:
<project>
...
<repositories>
<repository>
<id>google-maven-repository</id>
<url>https://maven.google.com</url>
</repository>
</repositories>
...
</project>
Co dalej?
Konfigurowanie projektu w konsoli Google Cloud
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-08 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-08 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"]]