Skip to main content
The LOCI Map SDK for Android puts a map in your Kotlin app for field data collection. Your users draw points, lines and polygons inside their work areas, and you get the GeoJSON back, checked against the boundaries. The map works on its own with boundaries you already hold. To fill it from LOCI instead, you give the SDK an API key and it preloads frames and the data recorded on them over the same public API this site documents. The map never calls the network itself: every request happens in an explicit preload step before the map appears.
This is the standalone native SDK, for apps not built with Flutter. If your app is built with Flutter, use the Flutter SDK instead. A native iOS SDK (Swift) is coming soon.

Quickstart

Three steps to a working map, plus the example screen.

The map

Work areas, layers, drawing, events, the controller, and styling.

Frames

Initialise with a key and preload frames. The part that uses this API.

Flutter SDK

Building with Flutter? The Flutter SDK is the same map, driven from Dart.

Install

Add the dependency to your app module.
app/build.gradle.kts
The library gives you Esri and GeoJSON in, DataFromMap out, built-in controls or your own, and a plain Kotlin API. No map key is needed for the map to render; the only credential you supply is an API key, and only if you use frames.

Platform setup

Requirements

  • Minimum Android 5.0 (API 21).

Location permission

The map uses the device location for geofencing and Locate Me. Declare the permissions, and request ACCESS_FINE_LOCATION at run time before the map is used.
AndroidManifest.xml
SurveyActivity.kt

Lifecycle

  • Create the LociMapView in onCreate and call release() in onDestroy.
  • Use the view and the controller on the main thread. Events arrive on it.

Two ways to use it

Both use the same view properties and callbacks. Your own buttons call commands on view.controller.

Prebuilt view

LociMapView draws the map and the controls — options, locate, zoom, undo, redo, work areas, imagery, navigate, Draw and Save. Rename, hide or replace any of them.

Your own

Set controls = LociMapControls.NONE and call commands on view.controller from your own buttons.
prebuilt
your own buttons

What the map needs, and what it does not

  • No map key to render. The map works out of the box.
  • An API key only if you preload frames from LOCI. See Frames.
  • The location permission, granted at run time before the map is used.