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ć przejazdy na żądanie w aplikacjach dla użytkowników na Androida, użyj pakietu SDK dla konsumentów. Więcej informacji o śledzeniu przejazdu za pomocą pakietu Consumer SDK znajdziesz w artykule Śledzenie przejazdu na urządzeniu z Androidem.
Aby skonfigurować pakiet Consumer SDK w aplikacji dla konsumentów na Androida, wykonaj te czynności:
- Sprawdzanie minimalnych wymagań systemowych
- Pobierz pakiet SDK dla konsumentów
- Konfigurowanie projektu w konsoli Google Cloud
- Uzyskiwanie tokenów uwierzytelniania
- Inicjowanie pakietu Consumer SDK
Sprawdź minimalne wymagania systemowe
Minimalne wymagania dotyczące wersji pakietu Consumer SDK, z której korzystasz, znajdziesz w notatkach do wersji. Zobacz informacje o wersji.
Aby korzystać z pakietu Consumer SDK: aplikacja musi być kierowana na pakiet minSdkVersion
23 lub nowszy.
Aby uruchomić aplikację korzystającą z pakietu Consumer SDK: urządzenia mobilne z Androidem muszą spełniać te minimalne wymagania:
Pobierz pakiet SDK dla konsumentów z repozytorium Google Maven
Pobierz pakiet Consumer SDK w wersji 2.1.0 lub nowszej z repozytorium Google Maven.
Wycofany został wcześniej używany kanał prywatnego repozytorium.
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-03-11 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-03-11 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"]]