Skip to content

feat(service): Overhaul MeshServiceExample#4263

Merged
jamesarich merged 1 commit into
mainfrom
feat/service-example-updates
Jan 20, 2026
Merged

feat(service): Overhaul MeshServiceExample#4263
jamesarich merged 1 commit into
mainfrom
feat/service-example-updates

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

This commit completely revamps the mesh_service_example application, migrating it from an XML-based layout to a modern, feature-rich UI built with Jetpack Compose. It also introduces a FakeIMeshService stub to facilitate easier testing of IMeshService integrations.

Key Changes:

  • Compose UI Rewrite: The mesh_service_example has been rewritten using Jetpack Compose, featuring a MeshServiceViewModel to manage state and interactions with the MeshService. The new UI demonstrates a wider range of IMeshService functionalities, including:

    • Displaying node information and connection status.
    • Sending and receiving broadcast text messages.
    • Requesting actions per-node (Traceroute, Telemetry, Position, etc.).
    • Controlling local device functions (Start/Stop GPS, Reboot Radio).
  • FakeIMeshService Stub:

    • Introduced FakeIMeshService, a stub implementation of the IMeshService AIDL interface.
    • This fake serves as a reliable test double for developers building apps that interact with the Meshtastic service, enabling robust unit testing without a running service.
    • Added a contract test (IMeshServiceContractTest) to ensure the fake implementation stays in sync with the AIDL definition.
  • ViewModel and Testing:

    • MeshServiceViewModel now encapsulates all logic for interacting with the IMeshService.
    • Unit tests for the MeshServiceViewModel have been added, demonstrating how to use FakeIMeshService for testing client-side logic.
  • Build & Dependency Updates:

    • Added Compose, Activity Compose, and other related UI dependencies to the example app.
    • Enabled unitTests.isReturnDefaultValues = true in core/service and mesh_service_example to support Robolectric-less unit testing.
    • Removed the unused OSMDroid dependency from the example.

…st stubs

This commit completely revamps the `mesh_service_example` application, migrating it from an XML-based layout to a modern, feature-rich UI built with Jetpack Compose. It also introduces a `FakeIMeshService` stub to facilitate easier testing of `IMeshService` integrations.

### Key Changes:

- **Compose UI Rewrite:** The `mesh_service_example` has been rewritten using Jetpack Compose, featuring a `MeshServiceViewModel` to manage state and interactions with the `MeshService`. The new UI demonstrates a wider range of `IMeshService` functionalities, including:
    - Displaying node information and connection status.
    - Sending and receiving broadcast text messages.
    - Requesting actions per-node (Traceroute, Telemetry, Position, etc.).
    - Controlling local device functions (Start/Stop GPS, Reboot Radio).

- **`FakeIMeshService` Stub:**
    - Introduced `FakeIMeshService`, a stub implementation of the `IMeshService` AIDL interface.
    - This fake serves as a reliable test double for developers building apps that interact with the Meshtastic service, enabling robust unit testing without a running service.
    - Added a contract test (`IMeshServiceContractTest`) to ensure the fake implementation stays in sync with the AIDL definition.

- **ViewModel and Testing:**
    - `MeshServiceViewModel` now encapsulates all logic for interacting with the `IMeshService`.
    - Unit tests for the `MeshServiceViewModel` have been added, demonstrating how to use `FakeIMeshService` for testing client-side logic.

- **Build & Dependency Updates:**
    - Added Compose, Activity Compose, and other related UI dependencies to the example app.
    - Enabled `unitTests.isReturnDefaultValues = true` in `core/service` and `mesh_service_example` to support Robolectric-less unit testing.
    - Removed the unused OSMDroid dependency from the example.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@github-actions github-actions Bot added the enhancement New feature or request label Jan 19, 2026
@codecov

codecov Bot commented Jan 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (5f86dad) to head (02d06f1).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4263   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          3       3           
  Lines         23      23           
  Branches       7       7           
=====================================
  Misses        23      23           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Jan 20, 2026
Merged via the queue into main with commit 4e2c429 Jan 20, 2026
11 checks passed
@jamesarich jamesarich deleted the feat/service-example-updates branch January 20, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant