Skip To Content ArcGIS for Developers Sign In Dashboard


You will learn: how to build an app that loads a basemap and feature layers from a mobile map package file.

The ArcGIS Runtime SDK for Android allows you to provide offline maps to your users so they can be productive when their network connectivity is poor or offline. The mobile map package is a .mmpk file created with another tool, such as ArcGIS Pro, and loaded to your user's device.

In this tutorial, you will use the ArcGIS Runtime SDK for Android to open a mobile map package on a device when offline. The package is created with ArcGIS Pro, ArcGIS Online or ArcGIS Enterprise using the ArcGIS REST API and loaded to your device as part of application deployment.

Before you begin

Make sure you have installed the latest version of Android Studio.

Reuse the starter project

If you have completed the Create a starter app tutorial, then copy the project into a new empty folder. Otherwise, download and unzip the project solution. Open, run, and verify the map displays in the device simulator.

Prepare your data

Complete the tutorial Prepare your data for offline use. You will use the map package file created in that tutorial for the offline map data required in this tutorial.


Load your map package on to your device

  1. You created a map package in the tutorial Prepare your data for offline use. Load the map package file created in that tutorial on to your device. If you did not complete that tutorial, download the map package we prepared.

Load and display the map package

  1. In the file app > java > {} >, add a new method named setupOfflineMap to load the mmpk file into an ArcGISMap object and then update your MapView to display it.

     private void setupOfflineMap() {
         if (mMapView != null) {
             File path = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
             File mmpkFile = new File(path, "offline-maps-package.mmpk");
             final MobileMapPackage mapPackage = new MobileMapPackage(mmpkFile.getAbsolutePath());
             mapPackage.addDoneLoadingListener(() -> {
                 if (mapPackage.getLoadStatus() == LoadStatus.LOADED && !mapPackage.getMaps().isEmpty()) {
                 } else {
                     Log.e("setupOfflineMap", "Cannot load " + path.toString() + "/offline-maps-package.mmpk");
  2. In the same file, find the onCreate() method. Replace the call to setupMap() with a call your new method setupOfflineMap().

     protected void onCreate(Bundle savedInstanceState) {
         mMapView = findViewById(;
         // *** ADD ***
  3. Run your app and test the code in the Android emulator to see the map.

Congratulations, you're done!

Your map, as it was designed in ArcGIS Pro, should load and display with the view point centered on the Los Angeles area. Compare your solution with our completed solution project.


Change map contents

Learn how you can change many elements of your map without writing any code. Return to ArcGIS Pro and alter your map: change the extent, add or remove layers, change symbology. Republish your map package and load it on your device.