Skip to content

Configure Android Example

In this guide you will learn how to configure an Android example to get it ready to build.

Android Examples

Maps SDK for Android Examples can be downloaded or cloned with Git

Setup

First, get an API key token, see the Getting Started guide.
Download the Maps & Navigation SDK for Android archive file

Download the example project archive file or clone the project with git

If the archive was downloaded, extract/unzip the archive to a directory of your choice. You can create a new directory where to unzip it.

Extract the Maps SDK for Android. This will create a new directory containing a file with the .aar extension.

Copy or move the Maps SDK for Android .aar file to the HelloMap/app/libs/ directory, where HelloMap is the name of the example project directory.

Android Studio should be installed to continue.

Open the Project

Android Studio welcome dialog

Start Android Studio, and in the welcome dialog, choose Open an Existing Project.

Android Studio open project dialog

Select the directory of the project you want to open and click OK. In this case, HelloMap is selected.

Android SDK change dialog

A dialog may appear, informing you that the Android SDK you have will be used.

Set the API key token

AndroidManifest.xml

On the left margin, doubleclick Project, then app->manifests->AndroidManifest.xml

Set your GeneralMagic API key

In AndroidManifest.xml, replace YOUR_TOKEN with your actual GeneralMagic API key copied above.

Configure the example

Android studio sync gradle

In Android Studio, from the File menu, select Sync Project with Gradle Files

The project is now ready to build, deploy on a device and run.