React Native for Android: How we built the first cross-platform React Native app

Visit the post for more.

Daniel Witte
12 min readintermediate
--
View Original

Overview

The article discusses the development of the first cross-platform React Native app, the Ads Manager app, by Facebook. It highlights the advantages of using React Native for mobile development, the challenges faced during the process, and the lessons learned from building both iOS and Android versions of the app.

What You'll Learn

1

How to leverage React Native for cross-platform mobile app development

2

Why using a unified codebase can enhance development efficiency

3

When to implement platform-specific components in a React Native app

Prerequisites & Requirements

  • Familiarity with React and JavaScript
  • Experience with mobile app development(optional)

Key Questions Answered

What challenges did Facebook face when building the Ads Manager app using React Native?
Facebook encountered challenges such as implementing complex features like an image editor and breadcrumb navigation. These features pushed the limits of React Native at the time, requiring innovative solutions to ensure a native-like experience.
How did Facebook manage code reuse between iOS and Android versions of the Ads Manager app?
Facebook maximized code reuse by utilizing React Native's packager's block list feature, allowing them to implement components once for both platforms while minimizing platform-specific checks. This approach achieved around 85 percent code reuse.
What lessons did Facebook learn from developing a cross-platform app with React Native?
Facebook learned that managing separate iOS and Android repositories is challenging and that a unified repository would simplify development. They also emphasized the importance of testing across platforms to avoid errors.

Key Statistics & Figures

Code reuse percentage
85%
Achieved by implementing components once for both iOS and Android versions of the Ads Manager app.
Development time for iOS app
5 months
Time taken to build the iOS version of the Ads Manager app.
Development time for Android app
3 months
Time taken to build the Android version of the Ads Manager app after the iOS version.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Utilize React Native's component-based architecture to speed up mobile app development.
By leveraging familiar React concepts, developers can quickly create complex UIs and maintain a consistent experience across platforms.
2
Implement a unified repository for shared code to streamline development processes.
This approach reduces the overhead of managing multiple repositories and ensures that all developers work from the same codebase, enhancing collaboration and reducing errors.
3
Adopt integration testing to catch platform-specific issues early in the development cycle.
This practice helps mitigate the risks associated with cross-platform development, ensuring that changes do not inadvertently break functionality on either platform.

Common Pitfalls

1
Failing to test changes across both iOS and Android platforms can lead to unexpected bugs.
This issue arises from the complexity of managing a shared codebase, where platform-specific behavior may not be immediately apparent without thorough testing.

Related Concepts

Cross-platform Mobile Development
React Native Architecture
Code Reuse Strategies
Integration Testing In Mobile Apps