Skip to main content
GuidesAPI ReferenceExamples

Configure Android Example

Estimated reading time: 2 minutes

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

  1. Get your Magic Lane API key token: if you do not have a token, see the Getting Started guide.
  2. Download the Maps & Navigation SDK for Android archive file.
  3. Download the example project archive file or clone the project with git.
  4. 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.
  5. Extract the Maps SDK for Android. This will create a new directory containing a file with the .aar extension.
  6. 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.
  7. Android Studio should be installed to continue.

Configure

1. Open the Project

Step 1 Image

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

Open Project Image

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

Step2 Image

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

2. Set the API key token

Step3 Image

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

Open Project

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

3. Configure the example

Menu Image

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

Example Run Image

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

In Android Studio, select Run app from the Run menu, or press SHIFT+F10 to compile, install and run the example on the android device.