Developer guides

Architecture

Follow the Android entry points and the boundaries between UI, collection, and storage.

Reviewed
On this page

Android entry path

CODE
:app
  M9App
    MainActivity
      AppNavHost
        UiJsonApp
          JSON loader → binding/action → renderer

App initialization, permissions, and plugin wiring live in the app layer. The UI JSON runtime connects packaged assets to screens and actions.

Main modules

ModuleResponsibility
:appEntry points, navigation, UI JSON runtime, permissions, submission/notification/sync wiring
:core:plugin-apiPlugin, common events and extension contracts
:core:registryPlugin configuration parsing and source priority
:core:repoRead/write use cases and repositories
:core:dbRoom entities, DAOs and migrations
:core:storeSupporting preferences, time handling, remote data sources and sync
:plugins:*Surveys, sensors, Samsung Health, Health Connect and cognitive games
:uiShared theme
Shared modules used by AndroidReusable contracts and Compose rendering

UI state flow

Screens focus on rendering and forwarding events. Durable screen state follows the ViewModel-centered architecture. Persistence and synchronization use repository and data-source boundaries. Do not add database writes or remote upload responsibilities to composables for a new feature.

Data flow

CODE
Provider / participant input
  → plugin / submission / ingestion
  → repository and Room
  → existing remote data source / worker
  → configured study backend

Not every plugin persists data by returning a pull() result. Sensors read existing batches; some health plugins perform ingestion and reconciliation during a pull. Surveys use a separate submission contract.

Extension points

Prefer JSON and existing nodes for wording/layout changes. Add provider integration through plugins and storage layers; examine new remote-storage behavior at the data-source boundary. Preserve compatibility paths until their usage is established.

Documentation evidence

Working-tree baseline · source paths · HEAD 8213e6b7

  • app/src/main/java/com/hdil/datacollection/M9App.kt
  • app/src/main/java/com/hdil/datacollection/MainActivity.kt
  • app/src/main/java/com/hdil/datacollection/AppNavHost.kt
  • app/src/main/java/com/hdil/datacollection/uijson/v1/UiJsonApp.kt
  • settings.gradle.kts
  • AGENTS.md
DTRAC AndroidYonsei University · Bongshin Lee’s research team