Ensure that you've downloaded a copy of your airmap.config.json configured for your mobile app. Specifically make sure that you've added your application ID.
Start by adding the AirMap Android SDK to your project:
-
Add
maven { url "https://jitpack.io" }
to your project-levelbuild.gradle
file in theallprojects.repositories
block -
Add
implementation 'com.airmap.airmapsdk:airmapsdk:3.0.0
to your module-levelbuild.gradle
file -
Add
manifestPlaceholders = ['appAuthRedirectScheme': applicationId]
to thedefaultConfig
section of your module levelbuild.gradle
file


Top-level build.gradle
file
Place the airmap.config.json
file that you previously downloaded inside your /assets
directory. If you don't already have an assets
directory, create it. It should be at the same level in the file structure as your java
and res
directories.


The location of the airmap.config.json
file
Now, initialize the SDK in your Activity or Application. The SDK will get your API key from the config file that was added to the project.
Additionally if you want to use AirMapMapView, add your MapBox API key to your airmap.config.json
and reference it when instantiating MapBox.
AirMap.init(MainActivity.this);
// Add this line when using Mapbox
Mapbox.getInstance(this, AirMapConfig.getMapboxApiKey());
Updated 2 years ago