How to build an offline app

1. Select a type of offline app

There are two types of offline apps you can build with ArcGIS Maps SDKs for Native Apps:

  1. Partially offline apps are suitable if you will have periods of disconnectivity and connectivity or if you want to use online services in the offline app.
  2. Fully offline apps are suitable if you will be disconnected at all times or if your data is too large and impractical to transfer over the network.

2. Prepare a mobile data source

Mobile data sources provide your offline app with the data and maps that it needs to function. Examples of mobile data sources are offline maps, offline data, mobile packages, and data files. Different types of offline apps have different options for mobile data sources. You can choose from various mobile data sources that suit your type of offline app.

Partially offline apps support a wider selection of mobile data sources. This type of offline app has network access to download data, such as offline-enabled web maps to generate offline maps or data services to generate offline data.

Fully offline apps have more limited options for mobile data sources. These apps rely primarily on locally stored data, such as mobile packages authored in ArcGIS Pro or data files then sideloaded onto the device.

Refer to the chart below to prepare the correct mobile data source for your offline app.

You can build a partially offline app using offline maps, offline data, mobile packages, or data files. See the chart below to determine which mobile data source fits your app requirements best.

Offline mapsOffline dataMobile packagesData files
2D maps11
3D scenes22
Edit data while offline3
Synchronize offline edits4
Fully disconnected apps/devices44
Offline geocoding5
Offline routing6
Offline analysis
Set expiration date for data access
Full supportPartial supportNo support
  • 1. Map constructed in code
  • 2. Scene constructed in code
  • 3. Shapefiles, GeoPackages, and KML
  • 4. Custom sideloading workflows required
  • 5. Locator exported from ArcGIS Pro
  • 6. Network Analysis dataset exported from ArcGIS Pro

The general steps to prepare a mobile data source are:

  1. Select a type of mobile data source for your offline app.
  2. Prepare the data using tools such as ArcGIS Pro, Map Viewer, or the portal.
  3. For data hosted in the portal, such as a web map or a feature service, enable it for offline use in the item page.
  4. Obtain the item ID to download the data to your device, or export the data to sideload it onto your device.

3. Build the app

After preparing a mobile data source, the next step is to create an application with ArcGIS Maps SDKs for Native Apps for your preferred platform. Your application will access the mobile data source you have prepared, and can then be expanded with additional functionalities, such as geocoding or routing.

The following examples show how to access different mobile data sources in partially offline and fully offline apps.

You can use offline maps in a partially offline app only.

ArcGIS Maps SDK for .NETArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for Qt (C++)
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var portal = await ArcGISPortal.CreateAsync();
var portalItem = await PortalItem.CreateAsync(portal, "YOUR_ITEM_ID"); // Replace with your web map ID
var map = new Map(portalItem);

OfflineMapTask offlineTask = await OfflineMapTask.CreateAsync(map);

GenerateOfflineMapParameters generateParameters =
    await offlineTask.CreateDefaultGenerateOfflineMapParametersAsync(areaOfInterest);

GenerateOfflineMapJob job = offlineTask.GenerateOfflineMap(generateParameters, "path\\to\\map\\directory");

GenerateOfflineMapResult result = await job.GetResultAsync();

if (result.OfflineMap is Map offlineMap)
{
    MainMapView.Map = offlineMap;
}

Tutorials

Create an offline-enabled web map

Use Map Viewer and ArcGIS Online to create an offline-enabled web map.


Create an offline map area

Use ArcGIS Online or ArcGIS Enterprise to create an offline map area from an offline-enabled web map.


Create a mobile map package

Use ArcGIS Pro to create a mobile map package.


Workflows

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.