I'm curious about how to approach building and maintaining native apps for multiple platforms, using a delivery app as an example. If you're opting for native development instead of using frameworks like React, this means essentially creating the same app for two different platforms. Are there best practices for minimizing code duplication, and managing shared knowledge and business logic? When a new feature is added, do developers work on it simultaneously across both platforms, coding in different languages? I assume the backend would utilize the same API endpoints, possibly hosted on a neutral server. I'm familiar with some web development in Python and C++, and I'm interested in starting a personal project that works across multiple platforms. This whole process fascinates me!
6 Answers
Don't forget that you can learn from how other teams tackle similar problems! While UI elements will vary, the foundational structures can often be reused, so take notes on how things are solved across platforms. For personal projects, it's wise to either go with a truly multi-platform approach or commit to one platform. The last thing you want is to solve a problem only to realize you’re doing it all over again for another platform, which can lose its appeal real fast.
Usually, you'll have two teams working in parallel on different platforms. Ideally, one team will take the lead on figuring out the business logic and share it with the other team. Given the differences between how iOS and Android handle things, a lot of code won't map directly, but having good communication is key!
If you're going native and want to avoid writing everything twice, you typically end up with two choices: one is to just duplicate everything, and the other is to create a shared library for non-platform specific code. There will still be some necessary duplication, especially for UI since that's different across platforms. If most of your logic is server-side, then you'll probably stick to duplicating that thin UI layer. However, if your app has complex operations on the device, consider going with that shared library approach so you can code in a compatible language with the native one, like Swift for iOS or Kotlin for Android.
It's common to write core functionality in C++ for major desktop platforms, while the UI is developed using the native language for each platform. Unfortunately, for mobile, you'll typically end up maintaining two different codebases, leading to inevitable duplication. Still, shared server-side code can help ease some of that overlap.
Most native multi-platform apps will share a backend API but end up duplicating the UI for iOS and Android. To reduce rewrites, teams may leverage design systems and try to share logic via something like Kotlin Multiplatform or just keep it on the backend. Automating testing and workflow can also help to avoid manually replicating the same checks across platforms.
If you're interested in cross-platform development, C# could be a strong contender. You could write everything—backend, API, and front end—in C#. This makes it easier to manage everything natively, regardless of the OS, and you can share code seamlessly across the browser and server.

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