Re:Netflix Android and iOS Studio Apps now powered by Kotlin...
by rapsey on Sunday November 01, 2020 @09:02AM
(#24959548)
This approach is also great for testing. We use rust for parts of our mobile apps. If we were to do it again the rust part would be way larger.
Re:Netflix Android and iOS Studio Apps now powered by Kotlin...
by Ryuuke on Sunday November 01, 2020 @09:31AM
(#24959693)
I've tried to use rust on mobile apps, but type conversion & manual memory management does make using it really hard and unappealing. Did you find a better way using rust that mitigate theses kinds of problems ?
Re:Netflix Android and iOS Studio Apps now powered by Kotlin...
by rapsey on Sunday November 01, 2020 @09:40AM
(#24959743)
It all depends on your integration point and use case. The extra interopability work has to pay for itself. One possible trick is to use a message passing architecture and pass json/protobuf messages between the code bases.
Some companies also use lots of ffi code generation tools.
An added bonus of this approach is that it forces you to have a clear separation between your user interface code, and your business logic. A lot of mobile (and front end) apps out there have no architecture, putting API calls, state management and UI right next to each other in the same modules. Our approach forces you to keep UI code just focused on UI, while keeping all logic somewhere else, where it can isolated and as a benefit much more easily unit tested.
You would be surprised just how large of a share of your codebase can be moved into platform agnostic code if you have a solid architecture. Our UIs are "dumb" and render themselves from view models which have exactly the data needed to render the view. All the logic and state management to construct these view models can be written in the cross platform repo and shared across the Android and iOS apps. For example, to render a list, you will need to use the native UITableView or RecyclerView separately, but all the code that manages how many rows are in the list, the data each row needs, as well as updating the data when the list is reordered can be shared across platforms.