Last updated on March 9, 2021
For its production app, Netflix is trying multi- platform programming in Kotlin . That should be expanded even further.
The video streaming service Netflix supports the production of its own series and films with its own mobile app. In order to implement fast delivery of the app, the responsible development team uses a multi-platform approach. This is expanded by those involved in that platform agnostic code for iOS and Android is only written once in the Android language Kotlin and then used for both systems.
As the team writes in Netflix's tech blog , the code is created on the one hand as a library for Android and on the other hand as a native universal framework for iOS. The latter is done with the help of Kotlin-Native , with the code being translated natively for iOS instead of being executed in the JVM as usual.
Platform -specific code only needs to be written "if this is necessary, for example, for the implementation of a native user interface or for working with platform-specific APIs," writes the Netflix team. This is a different approach to a multi-platform strategy than usual, where otherwise platform-specific technologies are often abstracted.
The best from both worlds
For Netflix, however, their own approach has the advantage that both apps share the architecture with similar or even the same application logic, around half of the code works decoupled from the underlying platform, but the team can also continue to use new technology from the two platforms. These include Jetpack Compose for Android or Swift UI for iOS .
According to Netflix, Kotlin Native has now reached a "turning point" that apparently justifies the use of the technology. This applies above all to tools and the integration into Apple's Xcode. After all, according to the blog entry, the advantages of the common code base clearly outweigh the disadvantages of the slightly increased complexity.
Based on these positive experiences, Netflix wants to continue and share even more code between the two apps in the future. This applies above all to the JavaScript integration in Kotlin . At best, the future apps will only consist of a small UI layer per platform and otherwise split application logic, the team hopes.
figure#axdhjarkgmb { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; z-index: 1000; margin: 0 -150px; border-left: 150px solid #fff; border-right: 150px solid #fff; background-color: white; background-image: linear-gradient(#f2f2f2 60%, white 40%); background-size: 10px 28px;
}
figure#axdhjarkgmb > figcaption { display: table; margin: 28px auto; width: 400px; padding: 28px 20px; background-color: white;
}
figure#axdhjarkgmb > figcaption > ul { list-style: disc; margin: 8px 0 8px 16px;
}
figure#axdhjarkgmb > figcaption > ul > li,
figure#axdhjarkgmb > figcaption { font: normal normal 400 14px/20px ‘Droid Sans’,arial,sans-serif;
}
Source: golem.de