Implementing an Android TurboModule with Kotlin

youtube-cover
Teachers
Oskar Kwaśniewski
Software Developer
@
Callstack

TurboModules are designed to work consistently across platforms, but implementing them on Android involves a different set of tools, conventions, and generated code than on iOS. In this episode, Oskar Kwaśniewski walks through building an Android TurboModule from scratch, mirroring the Local Storage module introduced earlier in the series.

Starting from the shared TypeScript spec, Oskar shows how Codegen produces Android-specific interfaces, how to implement them in Kotlin, and how to register the module so React Native can load it under the New Architecture.

Revisiting the TypeScript spec

The episode begins with the same TypeScript TurboModule spec used in previous episodes. Oskar explains why the spec remains platform-agnostic and how it becomes the single source of truth for both iOS and Android implementations.

Running Codegen for Android

After updating the spec, Oskar runs Codegen to generate Android bindings. He walks through the generated files, focusing on the abstract base class and method signatures that must be implemented on the native side.

Implementing the TurboModule in Kotlin

Oskar creates a Kotlin class that extends the generated spec base and implements the required methods. Using the Local Storage example, he shows how to read and write values, return constants, and follow the threading expectations of TurboModules on Android.

Handling synchronous and asynchronous methods

The episode highlights the difference between sync and async methods on Android. Oskar explains how promise-based methods are represented in Kotlin, how results are resolved or rejected, and why long-running work should never block critical threads.

Registering the module with React Native

To make the TurboModule available to JavaScript, Oskar adds it to a custom TurboModule package. He explains how this package is wired into the app and how React Native discovers the module at runtime when the New Architecture is enabled.

Verifying the module from JavaScript

Finally, Oskar tests the Android TurboModule from JavaScript, calling its methods and confirming that data flows correctly between JS and native code—matching the behavior of the iOS implementation from earlier episodes.

Key takeaways

  • The TypeScript spec is shared across platforms.
  • Codegen produces platform-specific base classes for Android.
  • Android TurboModules are implemented in Kotlin and registered via a package.
  • Proper async handling is essential to avoid blocking threads.

Resources

Learn how to implement a React Native TurboModule on Android, from the TypeScript spec and Codegen to the Kotlin implementation and package registration.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Block quote

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text

Emphasis

Superscript

Subscript

TurboModules feel powerful but risky?

We help teams use them with confidence in real production apps.

Let’s chat
Link copied to clipboard!
//
Insights

Learn more about React Native

Stay up to date with our latest insights on React, React Native, and cross-platform development from the people who build the technology and scale with it daily.

//
insights

Learn more about React Native

//
React Native

We can help you move
it forward!

At Callstack, we work with companies big and small, pushing React Native everyday.

React Native Performance Optimization

Improve React Native apps speed and efficiency through targeted performance enhancements.

On-device AI

Run AI models directly on iOS and Android for privacy-first experiences with reliable performance across real devices.

AI Knowledge Integration

Connect AI to your product’s knowledge so answers stay accurate, up to date, and backed by the right sources with proper access control.

Generative AI App Development

Build and ship production-ready AI features across iOS, Android, and Web with reliable UX, safety controls, and observability.