Skip to content

Repository files navigation

c4ds Tool Samples

Sample Gallery hub in ComBat 4

A copy-pasteable reference for every public SDK surface exposed to external ComBat 4 Dismounted Soldier (C4DS) tools — 27 runnable samples across 14 categories, launched from an in-app Sample Gallery hub.

Kotlin AGP c4ds-sdk minSdk License


What this demonstrates

  • Every tool componentOverlay, Status/ExpandableStatus, Window, MapWindow, Underlay, and EndBar — each with a runnable, minimal sample.
  • Domain interactors (CommonMapInteractor, CommonModelInteractor, CommonSessionStorageInteractor, CommonLocaleSettingsInteractor) used the way a real tool would.
  • Tool lifecycle & managementAbstractToolService, ToolManager, PanelManager, and session-scoped storage (files, SharedPreferences, Room).
  • Remote data — a tool-owned Ktor HttpClient (all classes host-provided, nothing bundled) fetching JSON and mapping it to a domain model behind a repository.
  • UI building blocks — the promoted public SDK Compose component catalog plus all four ToolDialog variants.
  • Plugin isolation — per-APK ClassLoader, resource resolution, Material 2 composition fallback, native .so loading, and cross-APK tool activation.
  • A single hub pattern — one launcher-visible tool activates the other (hidden) tools via ToolManager; copy it for multi-tool APKs.

Quick start

Item Requirement
Host app ComBat 4 DS
Maven access support@combat.visionNexus SDK
SDK c4ds-sdk 0.5.1 (see gradle/libs.versions.toml)
Kotlin 2.4.0 — must match host for binary compatibility
Compose TBD — not pinned in this repo; use the Kotlin K2 Compose compiler shipped with kotlin = "2.4.0"
NDK + CMake Only for :isolation

Add Nexus credentials to ~/.gradle/gradle.properties:

c4ds_sdk_username=<your-username>
c4ds_sdk_password=<your-password>

Build and install:

./gradlew :gallery:assembleRelease :isolation:assembleRelease
adb install -r gallery/build/outputs/apk/release/gallery-release.apk
adb install -r isolation/build/outputs/apk/release/isolation-release.apk

Neither APK declares an Activity. Install both, launch ComBat 4, then open Sample Gallery from the Tools list. Full setup: Getting started.


Screen layout

The host divides the screen into tool components your tool declares:

Component Region Use
Overlay Red — over the main map Heads-up content, cursor readouts
Status Blue — bottom info strip Non-critical info; ExpandableStatus variant available
Window Green — side/bottom panel Full screens with optional nested navigation
MapWindow Variant of Window Embedded secondary map inside the panel
Underlay Full layer under the main map AR and background layers
End bar Yellow — map's right edge Custom action/toggle/menu buttons
Tool component screen layout

Details: Getting started → Tool screen layout


Sample catalog

All 28 samples — with screenshots, SDK APIs, source paths, and verification steps — live in the Samples guidebook, one collapsible section per category in on-screen order. Registry source of truth: CatalogEntry.kt.

  1. Map View — map taps, WorldWind renderables, and the CommonMapInteractor API · 3 samples
  2. Map Overlays — overlays, status bars, expandable status, EndBar buttons, and default-overlay replace/restore · 5 samples
  3. Map Underlay — composables rendered behind the map layer in AR mode · 1 sample
  4. Panel Windows — single-screen, multi-screen, and secondary-map panel windows · 3 samples
  5. Panel Management — open, close, and observe panel state via PanelManager · 1 sample
  6. UI Components Catalog — promoted public SDK components: form fields, buttons, inputs, and more · 1 sample
  7. Tool DialogsToolDialog variants: Confirmation, Destructive, Info, and Custom · 1 sample
  8. Tool Management — activate, deactivate, and inspect tools via ToolManager · 1 sample
  9. Model ManagementCommonModelInteractor create/consume/commit, symbol keys, and selection events · 1 sample
  10. Data Management — isolated file I/O, plugin-scoped SharedPreferences, Room, and Ktor network requests · 2 samples
  11. Lifecycle & Services — a session AbstractToolService, unread badge, and live lifecycle log · 1 sample
  12. Host Services — sharing, clipboard, in-app notifications, and opening a file in another app, and the host-provided library surface · 3 samples
  13. Resources & Isolation — config-qualified resources, M2 widgets, R.string collision, and native/cross-APK · 4 samples
  14. Architecture — a multi-module tool (domain/data/app) launched from the hub via cross-APK activation · 1 sample

Documentation

Document Contents
Getting started Requirements, Gradle/Nexus setup, tool screen layout, integration steps, Android Studio run config
Samples guidebook Every sample: screenshot, description, SDK APIs, source path, verification steps
Plugin isolation Asset/JNI smoke tests, isolation cases (a–e, g, h), cross-APK activation

Questions or issues: open an issue or email support@combat.vision.


License

Licensed under the Apache License, Version 2.0 — see LICENSE for the full text. You may obtain a copy at http://www.apache.org/licenses/LICENSE-2.0.

Copyright © 2026 ComBat Vision.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Disclaimer

This is an early version and may contain bugs or incomplete features. Feedback and contributions are welcome — if you encounter any issues, please open an issue.

About

A copy-pasteable reference for every public SDK surface exposed to external ComBat 4 Dismounted Soldier (C4DS) tools — browsable in an in-app Sample Gallery.

Topics

Resources

Stars

17 stars

Watchers

1 watching

Forks

Contributors

Languages