Netflix Android and iOS Studio Apps — now powered by Kotlin Multiplatform

Netflix Technology Blog
5 min readadvanced
--
View Original

Overview

Netflix has developed a mobile app called Prodicle, utilizing Kotlin Multiplatform to create platform-agnostic business logic for both Android and iOS. This approach enhances reliability and speed in a challenging production environment with varying connectivity and user needs.

What You'll Learn

1

How to implement a mobile SDK using Kotlin Multiplatform

2

Why Kotlin Multiplatform is beneficial for cross-platform development

3

When to use on-device rule evaluation for configuration management

Prerequisites & Requirements

  • Understanding of mobile app development concepts
  • Familiarity with Kotlin and its ecosystem(optional)

Key Questions Answered

How does Kotlin Multiplatform improve mobile app development for Netflix?
Kotlin Multiplatform allows Netflix to share nearly 50% of the production code between Android and iOS apps, enhancing efficiency and reducing the need for platform-specific implementations. This approach enables faster adaptation to new technologies like Android Jetpack Compose and Swift UI without compromising on platform-specific features.
What is the role of the Hendrix SDK in Netflix's mobile apps?
The Hendrix SDK is a mobile tool that manages app configurations for different productions, allowing for on-device evaluation of rules. This is crucial for optimizing user experiences in environments with unreliable network connectivity, as it supports dynamic feature availability based on various factors like A/B test assignments.
What technologies are used for networking and data persistence in the Netflix SDK?
Netflix uses Ktor's Multiplatform HttpClient for networking within the Hendrix SDK, enabling remote configuration of rule sets. For data persistence, SQLDelight is utilized to cache downloaded rule sets on disk, ensuring functionality even when network connectivity is poor.
Why is on-device rule evaluation preferred over server-side evaluation?
On-device rule evaluation is preferred due to the frequent changes in configuration values and poor network connectivity experienced on set. This method allows for immediate access to configuration data without relying on server responses, which can be slow or unavailable.

Technologies & Tools

Framework
Kotlin Multiplatform
Used to write platform-agnostic business logic for Android and iOS apps.
Networking
Ktor
Used for embedding networking code within the Hendrix SDK.
Database
Sqldelight
Used for Multiplatform persistence and caching downloaded rule sets.

Key Actionable Insights

1
Leverage Kotlin Multiplatform to streamline your mobile app development process.
By sharing business logic across platforms, you can reduce code duplication and maintenance efforts, allowing your team to focus on enhancing user experience and implementing new features.
2
Implement on-device rule evaluation for dynamic feature management.
This approach is particularly useful in environments with inconsistent connectivity, ensuring that your app remains responsive and adaptable to user needs without relying on external servers.
3
Utilize SQLDelight for effective data persistence in mobile applications.
SQLDelight provides a robust solution for caching data, which is essential for maintaining app functionality during network outages or poor connectivity scenarios.

Common Pitfalls

1
Failing to account for network variability when designing mobile apps.
Many developers overlook the importance of offline capabilities, which can lead to poor user experiences in environments with unreliable connectivity. Ensuring that your app can function offline or with limited connectivity is crucial for maintaining user engagement.

Related Concepts

Cross-platform Mobile Development
Kotlin Programming Language
Mobile SDK Development
Network Connectivity Management