Android Getting Started

At this time version 6 of the Mappedin SDK is available exclusively for Web (TypeScript & JavaScript). Mappedin SDK for Android version 5 is available for Enterprise customers with Enterprise tier maps. Maps created using the Mappedin Editor at the Free, Plus or Pro tiers must use SDK version 6 or higher as these maps are not supported in earlier versions of the SDK. Therefore Free, Plus or Pro tier are unable to use the Mappedin SDK for Android at this time.

It is possible to use the version 6 Mappedin SDK within a WebView in a native Android app. This approach enables an application to leverage the TypeScript/JavaScript Mappedin APIs to display a map.

The following code sample illustrates a class that enables the required WebView features and populates the WebView with inline HTML that initializes the WebView and displays a map. For simplicity, the HTML is included inline in this example. In a production app, it is recommended to store the HTML and TypeScript content in separate files within the app's assets folder and load from there.

package com.mappedin.demo.v6inawebview
import android.annotation.SuppressLint
import android.os.Bundle
import android.webkit.WebView
import androidx.activity.enableEdgeToEdge
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
ViewCompat.setOnApplyWindowInsetsListener(findViewById( { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left,, systemBars.right, systemBars.bottom)
// Create a WebView with the required features enabled.
// The layout contains a WebView with the id mappedinWebView.
val mappedinWebView: WebView = findViewById(
mappedinWebView.settings.javaScriptEnabled = true
mappedinWebView.settings.databaseEnabled = true
mappedinWebView.settings.domStorageEnabled = true
mappedinWebView.settings.mixedContentMode = 0
// Content to be loaded in the WebView. It's recommended to place this content in a
// file in the assets folder and load from there. This example includes it inline
// to provide sample code within a single class.
val htmlData = """
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mappedin Web SDK v6 Getting Started with JSDelivr</title>
<div id="mappedin-map"></div>
<script type="module">
import {
} from "";
const options = {
key: "65ca6d27d53f21f234ae6395",
secret: "0b25fc24d564c644443663d0b4d083605090d349975d0983fc96e06a5b1934dd",
mapId: "660c0c6e7c0c4fe5b4cc484c",
const mapData = await getMapData(options);
const mapView = await show3dMap(
mappedinWebView.loadData(htmlData, "text/html", "UTF-8")

© 2024 Mappedin Inc.

All Rights Reserved.

Sign up for developer updates

Get early access to release notes, major version changes, version migration guides, and our developer focused blog posts.


For more information

Read the Developer Blog

Explore the Playground

Talk to Sales

Maps for Good 🤍