2GIS Android Native SDK is an SDK that allows you to add a 2GIS map to your Android application. It can be used to display the map in your layout, add custom markers to it, and highlight various objects on the map, such as buildings, roads, and others.
⚠️ 2GIS Android Native SDK is under development. It is not ready for production usage.
Usage of this SDK requires an API key to connect to 2GIS servers and retrieve the geographical data. This API key is unique to the SDK and cannot be used with other 2GIS SDKs.
Additionally, if you plan to draw routes on the map, you will need a separate key—a Directions API key—to calculate and display an optimal route.
To obtain either of these API keys, fill in the form at dev.2gis.ae.
To install the SDK:
- Declare a custom repository in your
build.gradle
file:
repositories {
maven {
url "http://maven.2gis.dev/sdk-maven-release"
}
}
- Add a build dependency:
dependencies {
implementation 'ru.dgis.sdk:sdk:latest.release'
}
To run the example app, clone this Git repository and add your API keys to the local.properties file in your project:
dgisMapApiKey=YOUR_MAP_KEY
dgisDirectoryApiKey=YOUR_DIRECTIONS_KEY
Full documentation, including usage examples and API reference with detailed descriptions of all classes and methods, can be found at docs.2gis.com.