2GIS SDK integration in mobile app

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
2GIS SDK integration in mobile app
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

2GIS SDK Integration in Mobile App

2GIS SDK (DGis Mobile SDK) — reasonable choice when needing detailed building, office, floor and organization data in Russian cities. 2GIS maps work offline out of the box — user can download region and navigate without internet. This sets it apart from Google Maps and Yandex in scenarios with unstable connectivity.

SDK Connection

API key issued via dev.2gis.ru. SDK available for Android and iOS, Flutter wrapper exists but officially supported less.

Android (build.gradle):

repositories {
    maven { url = uri("https://artifactory.2gis.dev/sdk-maven-release") }
}

dependencies {
    implementation("ru.dgis.sdk:sdk-map:1.3.0")
    // or sdk-full for search and routes
}

iOS (Swift Package Manager):

// Package.swift
.package(url: "https://github.com/2gis/mobile-sdk-full-swift-package", from: "1.3.0")

Android: Initialization and Basic Map

import ru.dgis.sdk.DGis

class App : Application() {
    lateinit var sdkContext: ru.dgis.sdk.Context

    override fun onCreate() {
        super.onCreate()
        sdkContext = DGis.initialize(
            appContext = this,
            apiKey = ApiKeys(directory = "YOUR_DIRECTORY_KEY", map = "YOUR_MAP_KEY")
        )
    }
}

2GIS requires two different keys: directory — for org search and reference, map — for map display. Mixing or using one key for both — common mistake on first integration.

class MapFragment : Fragment() {
    private val mapObjectManager by lazy {
        MapObjectManager(mapView.map)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        val mapView: MapView = view.findViewById(R.id.mapView)

        // Initial position
        mapView.map.move(
            CameraPosition(
                point = GeoPoint(54.9885, 82.9207), // Novosibirsk
                zoom = Zoom(13f)
            )
        )
    }
}

Organization Search

2GIS directory — main SDK advantage. Search by name, category, address within visible area:

val searchManager = SearchManager.createSmartSearchManager(sdkContext)

val searchQuery = QueryBuilder("coffee shop")
    .setSearchArea(mapView.map.visibleArea)
    .build()

val searchTask = searchManager.search(searchQuery, object : SearchListener {
    override fun onSearchCompleted(searchResult: SearchResult) {
        for (item in searchResult.items) {
            item.markerPosition?.let { pos ->
                val marker = DgisMapObject.createMarker(
                    options = MarkerOptions(
                        position = pos,
                        icon = imageFromResource(R.drawable.ic_coffee)
                    )
                )
                mapObjectManager.addObject(marker)
            }
        }
    }
    override fun onSearchError(error: SearchError) {}
})

Search results contain rich data: name, address, category, rating, working hours, contacts — all from 2GIS reference without extra requests.

Offline Maps

Region download — via RegionManager:

val regionManager = sdkContext.getRegionManager()
regionManager.regions.onEach { regions ->
    val novosibirsk = regions.find { it.name.contains("Novosibirsk") }
    novosibirsk?.let { region ->
        regionManager.downloadRegion(region.id)
    }
}.launchIn(lifecycleScope)

After download, map, search and routes work offline. Region size for major city — 200-800 MB. Warn user before download via Wi-Fi.

Routes

val routeSearchManager = RouteSearchManager(sdkContext)

val routeSearchOptions = RouteSearchOptions(
    startPoint = RouteSearchPoint(GeoPoint(54.9885, 82.9207)),
    finishPoint = RouteSearchPoint(GeoPoint(54.9782, 82.8971)),
    transportOptions = RouteSearchTransportOptions.Car
)

routeSearchManager.findRoute(routeSearchOptions, object : RouteSearchListener {
    override fun onRoutesFound(routes: List<TrafficRoute>, routeSearchOptions: RouteSearchOptions) {
        routes.firstOrNull()?.let { route ->
            val routeMapObject = RouteMapObject(route)
            mapObjectManager.addObject(routeMapObject)
        }
    }
    override fun onError(error: SearchError) {}
})

Features and Limitations

2GIS SDK heavier than Google Maps: full version adds ~50-60 MB to APK. For apps with strict size requirements use only sdk-map without reference. Map style customization limited compared to Mapbox — can't fully recolor all layers via JSON-style.

Timeline

1–3 days. Map with markers — 1 day. Organization search + routes — 2–3 days. Cost calculated individually.