The MapQuest Maps SDK is a native library for interactive maps and traffic – built on vector maps and powered by the MapQuest tileset and traffic data.
The following APIs are often used with the Navigation SDK, but note these do incur a transaction cost to use:
In order to use MapQuest APIs and SDKs you will need a MapQuest key. We use this key to associate your requests to APIs with your account. You can find your existing keys or create a new one on the Applications page.
If you don't have a MapQuest Developer Account you can Sign Up Here.
We'll use Android Studio as our IDE in these examples. This install includes the Android SDK Manager required to download and run the Android SDK. Download Android Studio
Open Android Studio and go to File ‣ New ‣ Project or select "Start New Project". If this is your first time running Android Studio, you may be prompted to install the Android SDK - go ahead and follow the prompts to get the SDK installed.
On the following page, set the Application Name to My First MapQuest App. Set the Company Domain as desired and set the Project Location appropriately.
On the Target Android Devices page, leave everything at its default value and select Next.
On the following page, select the Empty Activity and leave the default settings on the Customize the Activity page. Select Finish to finalize the creation of your new app.
Install the MapQuest Android SDK using Gradle.
After creating your project, insert the following into your project's
build.gradle
file:
allprojects {
repositories {
// mq maven repo
maven { url 'https://artifactory.cloud.mapquest.com/artifactory/et-android-binaries' }
}
}
Also, insert the following into your application's build.gradle
file:
android{
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
...
implementation('com.mapquest:mapping-android-sdk:2.0.10') // for Mapping SDK MapView
Add the following to the activity's onCreate method
MapQuest.start(getApplicationContext());
It may be necessary to perform a gradle clean build
from the command line once
to resolve the MapQuest resources.
<com.mapquest.mapping.maps.MapView xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mapquestMapView"
app:mapquest_app_key="YOUR_MAPQUEST_KEY_HERE"
/>
We have provided a variety of examples with how to use the Maps SDK. From how to load a basic map view to runtime styling and user location follow mode. Start off with the basic MapQuest Map View.