An Android example application demonstrating how to integrate Holochain into a native kotlin application. The app connects to the Volla Cloud Service, installs a hApp bundle, and sends greeting messages to a Holochain DNA via zome calls.
The project is a hybrid Kotlin/Rust codebase with three main layers:
┌─────────────────────────────────┐
│ app (Kotlin) │ Android UI with Jetpack Compose
├─────────────────────────────────┤
│ libraries/client (Kotlin) │ Client library wrapping the FFI bridge
├─────────────────────────────────┤
│ crates/client-ffi (Rust) │ UniFFI-generated FFI bindings to Holochain
├─────────────────────────────────┤
│ crates/dnas/example (Rust) │ Holochain DNA (integrity + coordinator zomes)
└─────────────────────────────────┘
The main Android app module. A Jetpack Compose UI that connects to the Volla Cloud Service, lets the user type a greeting message, and sends it as a zome call to the Holochain conductor.
An Android library providing a high-level API for communicating with the Holochain conductor. It handles connecting to the Volla Cloud Service, installing the hApp bundle, managing the agent's ed25519 signing key (persisted in SharedPreferences), and exposing the FFI-bridged ExampleClient to the app layer.
A Rust library compiled as a native shared library and exposed to Kotlin via UniFFI. It wraps the Holochain WebSocket client, handles zome call nonce generation and ed25519 signing, and provides FFI-compatible type definitions (CellIdFfi, ZomeCallParamsFfi, AppInfoFfi, etc.) with bidirectional conversions to/from Holochain's internal types.
A small Rust binary wrapping the UniFFI CLI tool, used to generate Kotlin bindings from the Rust proc-macro definitions.
The example Holochain DNA with two zomes:
- Integrity zome — Defines the
Greetingentry type andAgentToGreetinglink type. Validates that greeting messages are non-empty. - Coordinator zome — Provides zome functions to create greetings on the DHT, retrieve them by action hash, and list all greetings linked to an agent.
Contains the hApp manifest (happ.yaml) and pre-built example.happ bundle that the Android app loads from assets.
Cargo.toml— Rust workspace with shared dependencies (Holochain SDK, UniFFI, ed25519-dalek, etc.).build.gradle.kts/settings.gradle.kts— Gradle multi-project build with:appandlibraries:clientmodules.flake.nix— Nix dev shell with Holochain tooling (holochain, hc, lair-keystore, etc.).package.json— npm scripts for building zomes, packaging the hApp, and launching a local dev network.