What v1 Covers
What every 1.x release keeps, what a 1.x release may add, and what your app should rely on.
Overview
The Wemap SDKs follow Semantic Versioning: a patch release fixes bugs, a minor release adds features, and a change that breaks your code waits for 2.0. Semantic Versioning leaves each library to say what its API is and what counts as breaking it. This page says it for the Wemap SDKs.
What v1 covers
The public API of core, map, map-compose, geo-ar, geo-ar-compose, and the wemap-vps-arcore, gps,
fused-gms and android-fused-adaptive location sources, called from Kotlin, and the behavior their documentation
describes.
Not covered, so any release may change it:
map-widgets, which ships on its own0.xversion line. Pin its exact version, see Getting started § Map widgets.wemap-vps-local, the offline VPS, which is alpha: its API needs an explicit opt-in, and it carries its own-alpha.Nversion.- Symbols marked
@InternalWemapApi, which compile only with an explicit opt-in. - Calls from Java. Members that take or return a value class, such as
kotlin.time.Durationor the SDKs' enum-like types, have mangled JVM names that Java can't call. - Behavior the documentation doesn't describe, and the text of log messages and error descriptions.
What a minor release may add
None of these breaks code that follows Using the API as intended:
- New types, members, and constructor parameters with a default value.
- A new case in a public enum-like or sealed type, except
LoadPhaseandLevels, which are closed. See Getting started § Handling SDK enums and sealed types. - A new member in a public interface the SDK implements, such as
NavigationManager. A new member ofLocationSourcealways comes with a default body, so your own location source keeps compiling as long as it follows the naming rule below. - A higher minimum Kotlin or Android Gradle plugin version. The CHANGELOG announces it. A patch release never raises it.
- A new permission merged into your app's manifest for a feature it already uses. The CHANGELOG announces it.
- A newer minor or patch version of the libraries below.
Any 1.x release, a patch release included, may raise the minimum compileSdk when a dependency requires it. The
CHANGELOG announces it.
What stays fixed until 2.0
- The minimum Android version,
minSdk24, and the JVM target, 11 (17 forgeo-arandgeo-ar-compose). See Getting started § Requirements. - The major versions of the libraries whose types appear in the SDKs' API: MapLibre Android (13), Kotlin coroutines (1), AndroidX Lifecycle (2), Jetpack Compose (1) and ARCore (1).
- Every public symbol. Nothing public is removed, renamed or changed in a way that stops your code compiling.
- Analytics on by default. See Data safety § Usage analytics.
Deprecations
A renamed or replaced symbol keeps its old name, deprecated, until 2.0. The old name keeps doing what its documentation
says. It carries @Deprecated at the default WARNING level, never ERROR or HIDDEN, so the compiler warns on every
call and keeps compiling it. Where the new symbol is a drop-in replacement, the annotation's ReplaceWith lets Android
Studio apply the fix. The CHANGELOG lists each deprecation in the release that makes it, under Deprecated.
Using the API as intended
The promises above hold for code that follows these rules:
- Give every
whenover an SDK enum-like or sealed type anelsebranch. See Getting started § Handling SDK enums and sealed types. - Don't implement the SDK's manager, provider and service interfaces, such as
NavigationManagerorPointOfInterestManager. Implementing one needs@OptIn(InternalWemapApi::class)and comes with no compatibility guarantee, because a minor release may add members to them.LocationSourceis the interface meant for your own types, see Custom Location Source. - Rely only on the stream behavior the documentation describes. See Getting started § Collecting the SDK's streams.
- Don't keep a reference to an SDK constructor or function in a variable without a function type, such as
val make = ::RecalculationOptionsorval stop = NavigationManager::stopNavigation. A new constructor parameter changes the reference's type, and a new overload makes it ambiguous, so it stops compiling. A reference passed where a function type is expected, such as an argument tomapor a variable with a declared function type, keeps compiling, and so does a lambda. - Give the members you add to SDK types names of your own, such as with your app's prefix: extension functions
and properties, the members of your subclasses of an open SDK class such as
WemapMapView, and the members of your ownLocationSource. A minor release may add a member with the same name and signature. Kotlin then calls the SDK's member instead of your extension, with no error at the call, and the member of your class stops compiling.
Threading and lifecycle
Call the SDKs from the main thread. Views, sessions, managers and location sources are annotated @MainThread,
for Android Lint to check. Creating a session, reading a view's managers, starting or stopping a location source or a
navigation, and selecting points of interest also throw IllegalStateException straight away when called from
another thread. You can collect the SDKs' streams from any thread or coroutine.
Wait for a view to load before using its managers. Call the suspending awaitLoaded() first, or use onLoaded
in Compose.
- Reading a
WemapMapViewmanager before the map has loaded, aGeoARViewmember beforeconfigure(session), or either after the view is destroyed, is a programmer error, and throwsIllegalStateException. Don't catch it to keep going: fix the order of your calls. - A points-of-interest download failure is not one of these. The view reports it through its load phase, and its managers still work.
What fails as an error, and what crashes.
- Errors your app handles: a network failure, no itinerary found, a map that fails to load, an offline map the SDK can't read (creating the session throws), and a configuration value out of range (the SDK clamps it).
- Crashes from misuse: a call from another thread to one of the entry points above, and using a view's members before it has loaded or after it is destroyed.
- The promise: nothing you can't prevent from your own code crashes your app.
One map view and one AR view per session. A second view of the same kind takes the session over from the first, and the SDK logs an error. To show two independent maps, create two sessions.
What the SDKs add to your manifest
The manifest merger adds these permissions to your app. The runtime ones, in bold, are yours to request, and only for the feature that uses them.
| Module | Permissions merged into your manifest |
|---|---|
core, and every module through it | INTERNET |
map (from MapLibre) | ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION, ACCESS_NETWORK_STATE, ACCESS_WIFI_STATE |
geo-ar | CAMERA |
wemap-vps-arcore | CAMERA, ACTIVITY_RECOGNITION, HIGH_SAMPLING_RATE_SENSORS |
gps, fused-gms, android-fused-adaptive | ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION, ACCESS_NETWORK_STATE |
map's location permissions come from MapLibre. The map uses them only to show the user's location from its
default source, the system location providers: when you turn on userLocationManager.isEnabled without attaching
a location source. An app that does neither that nor use a location source that needs them (gps, fused-gms,
android-fused-adaptive) doesn't request them, and can remove them from its manifest with tools:node="remove",
which removes them whichever module declared them. Without the permission granted, the default source shows no
user location; nothing crashes.
geo-ar and wemap-vps-arcore also declare the camera and ARCore as optional features, so the Play Store doesn't
filter out devices without them. Requesting the runtime permissions is covered in
VPS Location Source § Permissions and
GPS Location Source § Permissions; your Play Console declarations
in Data safety.
Getting help
If the SDKs break one of these promises, that's a bug: report it to the Wemap team with the SDK version, which
WemapSDKs.version returns.