Get started
Introduction
Installation
Your first app
Tutorials
Fission tutorials
Understand Fission’s generated Android project
Core concepts
Components
State and effects
Protected routes
Server-side rendering
Styling
Testing
Deployment
Reference
API reference
Cookbook
Fission 0.16.0
Documentation version
Read the changelog →

Understand Fission’s generated Android project

Follow shared Rust source through the generated Android Activity, native library and Gradle package. Change the source of truth, not disposable host output.
Android

What you will build

Trace a small running app from fission.toml and shared Rust into the Android library and package, identifying which files developers should edit.
Locate the shared component, state and thin shell entrypoints
Trace Rust compilation into the generated Android host and APK
Distinguish app configuration from generated Gradle and Activity output
Check the installed build actually contains the source change being tested
The generated Android project is a host for the shared Rust app, not another implementation of it. Knowing where that boundary lies makes failures easier to locate: an unchanged Rust screen is not a Gradle dependency problem, and a missing Android permission is not something a Compose component can fix by changing its label.
Here, we follow one small counter from Rust to the installed app. A counter is appropriate for this task because it checks launch and input without adding a service, database or fictitious device workflow. It is not a model for where every application should keep its state.

Create the project and add Android

Complete Android SDK/NDK setup, then prepare an emulator or connect a phone.
cargo install cargo-fission
fission init android-understand-fissions-generated-android-project
cd android-understand-fissions-generated-android-project
fission add-target android --project-dir .
cargo add serde_yaml
The generated src/main.rs selects a shell entrypoint. Shared app code remains under src/; target build inputs live under platforms/android/.

Run the finished example

fission run --target android --project-dir .

1. Use a small, observable launch check

This version of the starter counter adds checked-in English and Spanish text, a safe increment limit and a focused Rust test. It is not a verbatim copy of the generated template. Both native and Web entrypoints below launch it.
{"id":"fission-tabs-1","tabs":[{"index":0,"label":"src/app.rs","value":"src-app-rs"},{"index":1,"label":"src/translations.rs","value":"src-translations-rs"},{"index":2,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"},{"index":3,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"},{"index":4,"label":"src/lib.rs","value":"src-lib-rs"},{"index":5,"label":"preview/lib.rs","value":"preview-lib-rs"}]}
{"id":"fission-tabs-1","index":0,"label":"src/app.rs","value":"src-app-rs"}
use fission::prelude::*;

#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct CounterState { pub count: u32 }
impl GlobalState for CounterState {}

impl CounterState {
    pub fn increment(&mut self) { self.count = self.count.saturating_add(1); }
}

fission_component! {
    pub CounterApp<CounterState> {}
    view(_app, state, cx) {
        let tokens = &cx.view.env().theme.tokens;
    } =>
    SafeArea(child: Scroll(child: Container(
        child: SemanticsRegion(
            identifier: Some("starter-counter".to_string()),
            label: Some(cx.tr("counter.title")),
            child: Column(gap: tokens.spacing.m, children: [
                Text(cx.tr("counter.title")).size(tokens.typography.heading2_size),
                Text(cx.tr("counter.context")),
                Text(cx.tr("counter.value").replace("{count}", &state.count.to_string())),
                Button(
                    child: Text(cx.tr("counter.increment")),
                    key: "increment",
                    disabled: state.count == u32::MAX,
                    on_press: reduce { state.increment(); },
                ).semantics_identifier("counter.increment"),
            ]),
        ),
    ).padding_all(tokens.spacing.l)))
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn one_action_adds_one_and_the_limit_does_not_overflow() {
        let mut state = CounterState::default();
        state.increment();
        assert_eq!(state.count, 1);
        state.count = u32::MAX;
        state.increment();
        assert_eq!(state.count, u32::MAX);
    }
}
{"id":"fission-tabs-1","index":1,"label":"src/translations.rs","value":"src-translations-rs"}
use std::collections::HashMap;
use fission::prelude::*;

pub fn create_env() -> Env {
    let mut env = Env::default();
    env.locale = Locale::from("en-US");
    for (locale, source) in [
        ("en-US", include_str!("../i18n/en-US.yaml")),
        ("es-ES", include_str!("../i18n/es-ES.yaml")),
    ] {
        let messages: HashMap<String, String> =
            serde_yaml::from_str(source).expect("valid checked-in translations");
        env.i18n.add_bundle(TranslationBundle { locale: Locale::from(locale), messages });
    }
    env
}
{"id":"fission-tabs-1","index":2,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"}
counter.title: "Check the Android launch path"
counter.context: "This small counter checks that this build launches and handles an action. It does not test a device capability."
counter.value: "Count: {count}"
counter.increment: "Increment count"
{"id":"fission-tabs-1","index":3,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}
counter.title: "Comprobar el arranque de Android"
counter.context: "Este contador comprueba que la compilación arranca y responde a una acción. No prueba capacidades del dispositivo."
counter.value: "Cuenta: {count}"
counter.increment: "Incrementar la cuenta"
{"id":"fission-tabs-1","index":4,"label":"src/lib.rs","value":"src-lib-rs"}
pub mod app;
mod translations;

use app::{CounterApp, CounterState};
use fission::prelude::*;

#[cfg(not(any(target_arch = "wasm32", target_os = "android", target_os = "ios")))]
pub fn run_desktop() -> anyhow::Result<()> {
    DesktopApp::<CounterState, _>::new(CounterApp)
        .with_env(translations::create_env())
        .run()
}
#[cfg(any(target_os = "android", target_os = "ios"))]
fn mobile_app() -> MobileApp<CounterState, CounterApp> {
    let app = MobileApp::<CounterState, _>::new(CounterApp)
        .with_env(translations::create_env());
    #[cfg(all(target_os = "android", debug_assertions))]
    let app = app.with_test_control_port(48761);
    app
}
#[cfg(any(target_os = "android", target_os = "ios"))]
pub fn run_mobile() -> anyhow::Result<()> { mobile_app().run() }

#[cfg(target_os = "android")]
#[no_mangle]
fn android_main(app_handle: AndroidApp) {
    let _ = mobile_app().run_with_android_app(app_handle);
}
#[cfg(target_arch = "wasm32")]
#[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn run_web() -> Result<(), wasm_bindgen::JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<CounterState, _>::new(CounterApp)
        .with_env(translations::create_env())
        .run()
        .map_err(|error| wasm_bindgen::JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":5,"label":"preview/lib.rs","value":"preview-lib-rs"}
mod app;
mod translations;

use fission::prelude::*;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(start)]
pub fn run() -> Result<(), JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<app::CounterState, _>::new(app::CounterApp)
        .with_env(translations::create_env())
        .mount("#fission-web-mount")
        .run()
        .map_err(|error| JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1"}
Increment once. The count should move from zero to one. The same semantic identifier, counter.increment, locates the action in native LiveTest checks.
That establishes an app interaction only. The embedded Web app cannot inspect the Android SDK, linker, Gradle build, signing key or installed package.
Show the app preview
Hide the app preview

2. Trace the files in the order they take effect

Start at fission.toml, then follow the generated package script rather than guessing which file owns a setting.
Boundary
Where to look
What it owns
Project declaration
fission.toml
App identity, targets, capabilities and native module inputs.
Shared behaviour
src/app.rs and other shared modules
State, reducers, routes and Compose components.
Shell selection
src/lib.rs
Desktop, Web and mobile entrypoints; Android exports android_main.
Native compilation
platforms/android/package-apk.sh
Cargo target/profile and placement of the resulting Rust shared library.
Android host
platforms/android/java/rs/fission/runtime/FissionActivity.java
The generated AndroidX GameActivity host and platform glue.
Android package
platforms/android/AndroidManifest.xml, Gradle files and resources
Activity/library declaration, SDK settings, dependencies and packaged assets.
The package script builds the Rust library, copies its .so into the Android ABI directory, then asks Gradle to assemble the package. The generated host loads that library; the exported mobile entrypoint starts the shared app. A desktop main function is not the Android launch path.
Read platforms/android/README.md and native-modules/README.md before changing host inputs. Keep handwritten Java additions in an external source directory declared through native.modules, and declare capabilities with the CLI. Do not maintain a second copy of a generated manifest setting without checking which input regenerates it.
Find android_main in the shared library and the library declaration in the manifest. Then find the Cargo invocation and jniLibs copy in package-apk.sh. You should be able to explain which stage produces the Rust library and which stage packages it.
Show the app preview
Hide the app preview

3. Build, inspect and launch the same source

cargo test
fission doctor android --project-dir .
fission build --target android --project-dir .
git diff -- fission.toml platforms/android
fission devices --project-dir .
fission run --target android --project-dir .
fission test --target android --project-dir .
Inspect the generated manifest and Gradle files after the build. A clean diff may simply mean the declaration was already synchronised. Review a changed diff before deciding to hand-edit the output; the source of a setting may still be fission.toml or the generator.
On the installed app, increment once and compare the label with this source revision. That catches the common mistake of editing a preview whilst the native entrypoint still launches the starter screen from somewhere else.
The result is a traced launch/package path and a small interaction on that build. Rust tests check the counter rule; host startup and interaction are separate checks. None of this qualifies Play signing, hardware capabilities or persistence.

Current references