Library / SDK
googlemaps-samples/android-samples avatar
googlemaps-samples/android-samples

googlemaps-samples/android-samples: what the Maps SDK sample repo actually gives you

Samples demonstrating how to use Maps SDK for Android

2,505 stars3,050 forksKotlinApache-2.0

At a glance

What is it?
A Google-maintained collection of Kotlin samples for the Maps SDK for Android, plus a build script that verifies every sample in one pass. Useful as a working reference, not as a library you add to your app.
Who is it for?
Adopt it if you are starting a Maps SDK for Android integration and want runnable reference code for markers, maps on Wear OS, or Firebase-driven synchronized animations; the ApiDemos module alone covers most SDK features. Do not adopt it if you need a maintained library to depend on, since the README states the code is not a Google Maps Platform Core Service and is excluded from the Deprecation Policy and SLA.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Kotlin, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 1, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What problem the android-samples repository solves

The Maps SDK for Android ships as a dependency, not as an application. That leaves a gap: the documentation describes API surface, but a developer still has to assemble a manifest, a Google Cloud project with the SDK enabled, an API key, and a working Activity before a single map tile appears. This repository closes that gap with runnable projects rather than prose. The README lists five groups: ApiDemos, FireMarkers, WearOS, the tutorials directory, and snippets keyed to pages under developers.google.com/maps/documentation/android-sdk. The intended reader is an Android developer who already knows the platform and wants to see a specific SDK feature wired up correctly. It is not aimed at people who want a map component they can drop into an existing app without reading code.

The module layout: ApiDemos, FireMarkers, WearOS, snippets

ApiDemos is described as a collection of small demos showing most features of the Maps SDK, so it functions as the reference implementation and is the first place to look when a specific capability is unclear. FireMarkers takes a different shape: it uses Firebase Realtime Database to drive synchronized, live animations on a map across multiple devices, with what the README calls a controller/agent architecture. That is a distributed-state sample, not a map-rendering sample, and it is the one module whose interesting logic lives outside the Maps SDK. WearOS demonstrates the basic Gradle-based setup needed to display a map on a Wear OS device, which is a smaller surface than the phone samples and mostly about project configuration. The snippets directory holds fragments tied to specific documentation pages, so it is a lookup index rather than a runnable app. Read the modules as four different answers to four different questions, not as one cohesive product.

Prerequisites before the first build

Nothing here runs without a Google Maps Platform account. The README requires signing up with Google Maps Platform, a project with the Maps SDK for Android enabled, and an API key associated with that project. It points to the API key instructions for anyone new to the process and notes that each sample lists its own prerequisites. The repository also expects up-to-date Android build tools and the Android support repository. The presence of check_api_key.gradle.kts at the repository root and local.defaults.properties suggests the build reads the key from a local, non-committed file rather than from a checked-in constant, which is the right default but means a fresh clone will not build until that file is populated. The README does not spell out the exact key name or file format, so expect to read the Gradle scripts to find it.

Cloning, opening and running a sample

The README gives an Android Studio workflow rather than a command line one. Clone the repository, then in the Android Studio welcome screen choose Open an Existing project and select the root directory of the repository. That opens the multi-module Gradle build containing all the samples at once.

bash
git clone https://github.com/googlemaps-samples/android-samples.git
cd android-samples

After opening the project, you still need a Maps API key associated with a Google Cloud project where the Maps SDK for Android is enabled. The README directs you to the API key instructions; it does not print the key into a config file for you. Once the key is in place, select the module you want in the run configuration and deploy to a device or emulator.

To confirm the whole repository builds and its tests pass, the README provides one script:

bash
./scripts/verify_all.sh

That script is the fastest way to find out whether your local toolchain is current enough. For device-side tests there are two flags, one per form factor:

bash
# For Wear OS devices/emulators
./scripts/verify_all.sh --connected-wear

# For Mobile (Handheld) devices/emulators
./scripts/verify_all.sh --connected-mobile

If you would rather not use the script, the README says gradlew build works directly, and prebuilt APKs are attached to the repository releases.

Where the samples stop being useful

Two limitations are worth stating plainly. First, the repository is sample code, and the README is explicit that it is not a Google Maps Platform Core Service: the Technical Support Services, Service Level Agreements and Deprecation Policy do not apply to it. That is a meaningful boundary. You get an open source licence and GitHub issues, not a support contract, and the samples can change without the notice guarantees that apply to the SDK itself. Second, samples are written to demonstrate one feature at a time. ApiDemos in particular is a catalogue, so its Activities are not structured the way a production app would be, and copying a demo wholesale into a shipping app imports that structure. The WearOS module is about getting a map on a watch face at all, not about the constraints you hit once you add interaction and battery limits. If you need a supported component with a deprecation policy, this is the wrong artifact; the Maps SDK for Android dependency itself is the thing you actually ship.

How this differs from a maps library or a Maps Compose wrapper

The closest alternative in practice is a library that wraps the SDK behind a declarative API, such as the Maps Compose artifacts that Google publishes separately for Jetpack Compose. The difference is structural. A Compose wrapper gives you composable functions that manage the map's lifecycle for you, at the cost of an abstraction layer between your code and the SDK. This repository gives you the SDK directly, in Kotlin, with no wrapper, so every call you see is a real SDK call and every workaround you find is a workaround you would write yourself. Choose the samples when you want to understand the underlying API or debug something the wrapper hides. Choose a wrapper when you want less boilerplate and are willing to depend on a third party's abstraction. The samples will not give you the latter, and they are not trying to.

Licence, maintenance and the cost of upgrading

The repository is Apache-2.0, which permits commercial use and modification, but the README adds a layer on top of the licence: use of Google Maps Platform services through the sample is subject to the Google Maps Platform Terms of Service, and for billing addresses in the European Economic Area the EEA Terms of Service apply from 8 July 2025, with functionality varying by region. That is a services question, not a code question, and it is worth reading before you assume the Apache grant settles everything. On maintenance, the last push was on 2026-09-24 and the most recent release is v2.1.0 from 2026-09-09, so the repository is being touched. Upgrade cost is low by design: there is nothing to upgrade, because you copy code rather than depend on a version. The real cost appears when you copy a demo and the underlying SDK moves on, since the sample is not covered by the Deprecation Policy and you will not get advance notice of a change that breaks your copied code.

Editorial conclusion

Adopt it if you are starting a Maps SDK for Android integration and want runnable reference code for markers, maps on Wear OS, or Firebase-driven synchronized animations; the ApiDemos module alone covers most SDK features. Do not adopt it if you need a maintained library to depend on, since the README states the code is not a Google Maps Platform Core Service and is excluded from the Deprecation Policy and SLA. Before wiring it into anything, verify that your Google Cloud project has the Maps SDK for Android enabled and an API key associated with it, then run ./scripts/verify_all.sh to confirm the samples build against your local Android build tools.

Frequently asked questions

Where can I find Android app samples for the Maps SDK for Android?

The googlemaps-samples/android-samples repository is the collection the README points to, containing ApiDemos, FireMarkers, WearOS, tutorials and snippets. It is the sample set referenced by the Maps SDK for Android documentation.

What do I need before I can run googlemaps-samples/android-samples?

The README requires a Google Maps Platform sign-up, a project with the Maps SDK for Android enabled, an API key associated with that project, and up-to-date Android build tools plus the Android support repository. Each sample may list additional prerequisites of its own.

How do I verify that googlemaps-samples/android-samples builds correctly?

The README gives ./scripts/verify_all.sh to build and test all samples, with --connected-wear and --connected-mobile for instrumentation tests on a connected device or emulator. gradlew build also works directly.

Is googlemaps-samples/android-samples covered by a support SLA or deprecation policy?

No. The README states the sample is not a Google Maps Platform Core Service, so the Technical Support Services Guidelines, the SLA and the Deprecation Policy do not apply to the code. Any Google Maps Platform services the sample uses remain subject to the Google Maps Platform Terms of Service.

Official sources

  1. googlemaps-samples/android-samples on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/googlemaps-samples-android-samples.svg)](https://hysenlabs.com/projects/googlemaps-samples-android-samples)