Skip to content

One Core, Every ScreenUn núcleo para todas las pantallas

A shared Rust core for native apps on Android, iOS, tvOS, desktop, and web.Un núcleo Rust compartido para apps nativas en Android, iOS, tvOS, escritorio y web.

You wrote the same logic three times. Write it once.Escribiste la misma lógica tres veces. Escríbela una.

Rust coreNúcleo RustAndroidiOStvOSdesktopescritorioweb

Cross-Platform Rust: Share One Core Across Native Android, iOS, tvOS, Desktop and Web AppsRust multiplataforma: Un núcleo compartido para apps nativas en Android, iOS, tvOS, escritorio y web

Cross-Platform Rust cover: one shared core connected to Android, iOS, tvOS, desktop, and web
Portada de Rust multiplataforma: un núcleo compartido para apps nativas en Android, iOS, tvOS, escritorio y web

The problemEl problema

The same business logic gets rewritten for Android, iOS, and the web. Fix a bug three times.La misma lógica de negocio se reescribe para Android, iOS y la web. Arreglas un fallo tres veces.

1Password1Password

BitwardenBitwarden

ProtonProton

AndroidAndroid

iOS · iPadOS · tvOSiOS · iPadOS · tvOS

Desktop · WebEscritorio · Web

1Password, Bitwarden, and Proton ship a shared core with native screens.1Password, Bitwarden y Proton publican un núcleo compartido con pantallas nativas.

Rust core

One crate owns domain rules, validation, and shared models.

UniFFI exports the API each native shell calls.

The approachEl enfoque

One Rust crate holds the business logic. Each platform keeps its own UI: Kotlin and Jetpack Compose on Android, Swift and SwiftUI on iOS, iPadOS, and tvOS, a desktop shell, and the web through wasm-bindgen. UniFFI generates the bindings. The screens stay native.Un crate de Rust guarda la lógica de negocio. Cada plataforma mantiene su propia UI: Kotlin y Jetpack Compose en Android, Swift y SwiftUI en iOS, iPadOS y tvOS, un shell de escritorio, y la web con wasm-bindgen. UniFFI genera los bindings. Las pantallas siguen siendo nativas.

Rust sits under native UI, including under Kotlin Multiplatform.Rust va debajo de la UI nativa, también debajo de Kotlin Multiplatform.

What you'll learnQué vas a aprender

4 parts4 partes

  1. Wooden cases of movable type in a historic print shop

    Rust refresher for Kotlin, Swift, and TypeScript developersRepaso de Rust para quien ya programa en Kotlin, Swift o TypeScript

    Part I assumes you already ship Kotlin, Swift, or TypeScript.La Parte I asume que ya publicas en Kotlin, Swift o TypeScript.

  2. Close-up of weathered steel texture

    Designing the shared coreDiseñar el núcleo compartido

    Put the business logic in one Rust crate.Pon la lógica de negocio en un solo crate de Rust.

  3. Handheld device held against a dark backdrop

    Platform integrationIntegración por plataforma

    Wire the core to each native shell with UniFFI and wasm-bindgen.Conecta el núcleo a cada shell nativo con UniFFI y wasm-bindgen.

  4. Metal quoins used to lock letterpress type

    Production: CI, testing, releasingProducción: CI, tests y releases

    Test and release the core with the apps that call it.Prueba y publica el núcleo junto con las apps que lo llaman.

You build a real sample project through the book.A lo largo del libro construyes un proyecto de ejemplo real.

Who it's forPara quién es

Mobile and web developers who want shared logic and a native UI.Desarrolladores móviles y web que quieren lógica compartida y UI nativa.

Who it's not forPara quién no es

Skip it if you want Tauri, Flutter, or a Kotlin Multiplatform replacement.Pásalo si buscas Tauri, Flutter o un sustituto de Kotlin Multiplatform.

About the authorSobre el autor

David Cruz Anaya

David Cruz Anaya

I’m David Cruz Anaya (davthecoder), a mobile and applied AI engineer in London. I write about shared cores for Android and iOS, in Kotlin Multiplatform and Rust. I teach Android on Udemy.Soy David Cruz Anaya (davthecoder), ingeniero de móvil e IA aplicada en Londres. Escribo sobre núcleos compartidos para Android e iOS, en Kotlin Multiplatform y Rust. Doy cursos de Android en Udemy.

From shipping native appsDesde apps nativas en producción

For engineers who already ship Kotlin, Swift, or TypeScript and want one core without giving up native screens. The sample project uses the same UniFFI path as production shared-core apps.Para ingenieros que ya publican en Kotlin, Swift o TypeScript y quieren un solo núcleo sin renunciar a pantallas nativas. El proyecto de ejemplo usa el mismo camino UniFFI que las apps de producción con núcleo compartido.

FAQ

ScopeAlcanceIs this Tauri or Flutter?¿Es esto Tauri o Flutter?

No. Each platform keeps its native UI.No. Cada plataforma mantiene su UI nativa.

KMPKMPDoes it replace Kotlin Multiplatform?¿Sustituye a Kotlin Multiplatform?

No. Rust can sit under KMP too.No. Rust también puede ir debajo de KMP.

RustRustDo I need to know Rust?¿Necesito saber Rust?

No. Part I covers it.No. La Parte I lo cubre.

EditionsEdicionesWill there be a Spanish edition and a video course?¿Habrá edición en español y un curso en vídeo?

The Spanish edition, Rust multiplataforma, and a video course are planned after the English edition.La edición en español, Rust multiplataforma, y un curso en vídeo están previstos después de la edición en inglés.

TimingFechasWhen is it out?¿Cuándo sale?

The book is in progress. There is no release date. Join the list for early access.El libro está en marcha. No hay fecha de salida. Únete a la lista para acceso anticipado.

Workbench with notebooks and a laptop

Early accessAcceso anticipado

The English edition is in progress. Join the list for the free chapter and early access.La edición en inglés está en marcha. Únete a la lista para el capítulo gratis y el acceso anticipado.

Picture credits: rusted metal by Pink Sherbet Photography (CC BY 2.0); steel texture CC0 via Wikimedia Commons; quoins by Edinburgh City of Print (CC BY 2.0); movable type cases by Mangoman88 (CC BY-SA 3.0). Device and portrait photographs from davthecoder.Créditos de imagen: metal oxidado de Pink Sherbet Photography (CC BY 2.0); textura de acero CC0 vía Wikimedia Commons; cuñas de Edinburgh City of Print (CC BY 2.0); cajones de tipos de Mangoman88 (CC BY-SA 3.0). Fotos de dispositivo y retrato de davthecoder.