I'm interested in how to develop and maintain an app that goes the native route instead of using cross-platform frameworks like React. For example, if you're building a delivery app and choose to create separate native versions for iOS and Android, what are the best practices to minimize code duplication? When adding new features, do teams usually develop them simultaneously in different languages? I assume the backend connects through the same API across different repositories, but I'm curious about how to structure everything efficiently. My background is in web development with some Python and C++, and I'd love to embark on a personal project that spans multiple platforms.
6 Answers
One thing to consider is that even if you've got two teams working on different platforms, it's totally okay to refer to how the other team solves similar problems. Some foundational code structures can be shared despite language differences. For personal projects, just choose one platform, or go multi-platform but accept that not all users will be able to access your app. Duplicating work over and over can get boring pretty quickly!
Often, core logic is written in C++ for cross-platform compatibility, while UI code is implemented in each platform's native language. When working on mobile, you do maintain two different codebases, leading to some duplication. However, server-side components usually have shared code, which helps mitigate some of that redundancy.
If you're comfortable with C#, you can write everything—backend, API, and UI—in it, making everything native regardless of the platform. This way, you can also share libraries easily across mobile and web without feeling restricted by OS differences, which simplifies maintaining your code base.
You typically have two teams of developers who collaborate on features. It's ideal if one team slightly leads the direction, developing the business logic that the other team can implement. Since iOS and Android have different approaches, there's plenty of code that won’t match up directly, so coordination is key.
If you're avoiding cross-platform frameworks, you typically have two paths: either duplicate all your code for each platform or create a shared library for non-platform specific features, building the platform-specific parts around it. Just keep in mind that some UI code will have to be duplicated because the frameworks are quite different between platforms. If your app's core logic is primarily handled on the backend, then you might end up copying more code than you want to. If you’re doing heavy computation on the device, consider using a shared library with a language that fits well with both iOS and Android.
Most native multi-platform apps will share the same backend API but have separate UI implementations for iOS and Android. To avoid rewriting everything from scratch, teams often reuse design elements and might put shared logic in something like Kotlin Multiplatform or rely on the backend for more complex operations. While tools like runnable won't sync code between platforms, they can automate some testing and workflows to make things easier.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically