This file provides guidance to AI agents when working with code in this repository.
Thin Android library that wraps Organic Maps deep links (om://...) so client apps can show POIs on the OM map and receive a selected point back. Distributed as an AAR via :lib; the two sample-* modules are demo apps, not tests.
Public surface is documented in README.md. The library does not require Organic Maps to be installed — when no resolver is found, DownloadDialog prompts the user to install it.
Gradle wrapper 9.4.1 (AGP 9.2.1, Java 17, minSdk 21, targetSdk 36). Modules: :lib, :sample-app-capitals, :sample-pick-point.
./gradlew assemble # build everything
./gradlew :lib:assembleRelease # AAR only
./gradlew :sample-pick-point:installDebug # install a sample on a connected device
./gradlew cleanThere is no test suite, no lint task wired up beyond -Xlint:unchecked -Xlint:deprecation on JavaCompile, and no CI.
Request/response flow over Android Intents:
- Request builders construct an
om://-schemeUriand wrap it inIntent.ACTION_VIEW:MapRequest→om://map?appname=&z=&ll=lat,lon&n=&id=&s=&...(onell=/n=/id=/s=group per point). SettingpickPointModealso adds theEXTRA_PICK_POINTboolean extra.CrosshairRequest→om://crosshair?appname=, always withEXTRA_PICK_POINT.
OrganicMapsApiis the entry point: convenienceshowPointOnMap/showPointsOnMapwrapMapRequest, andsendRequesteitherstartActivitys the intent or showsDownloadDialogifresolveActivityreturns null.canHandleOrganicMapsIntentsresolves the intent;isOrganicMapsPackageInstalledchecks known package IDs (app.organicmaps,.beta,.debug,.web).- Response parsing:
PickPointResponse.extractFromIntentreads theEXTRA_POINT_*andEXTRA_ZOOM_LEVELextras into aPoint. Const.javais the wire-format contract — URI scheme, authority, andEXTRA_*keys. Any change here must match the consuming Organic Maps app, so treat it as a versioned public ABI.AndroidManifest.xmlin:libdeclares a<queries><package android:name="app.organicmaps"/>so package-visibility on Android 11+ permitsresolveActivity. The hard-coded literal is required —@string/is not allowed in<queries>.
Point.Style enumerates the placemark colors OM understands (see TODOs in Point.java for unmapped styles).
Sources live under <module>/src/main/. The repo's .gitignore excludes the Eclipse-era module-root layout (/*/AndroidManifest.xml, /*/build.xml, /*/project.properties, /*/res/, /*/src/com/) so the legacy com.mapswithme.* tree cannot be reintroduced. Edit src/main/java/app/organicmaps/api/.
- Java only; package
app.organicmaps.apifor the library,app.organicmaps.api.sample.*for samples. - Fluent builders:
MapRequest/CrosshairRequestsetters return@NonNullself. - Brace style is Allman (braces on their own line) in existing files — match it when editing.
- Per-file BSD-2-clause headers are kept on every source file.