It goes one step further, you can have platform-neutral code to parse the API returns into Kotlin models.
https://blog.jetbrains.com/kotlin/2020/10/kotlinx-serializat...
A lot of business logic is shared in the domain layer on each platform client (and possibly on the server), and I think re-use of that is/will be Kotlin's main selling point.
Add SQLDelight for shared data access code on clients, and you can cover a lot of ground with one codebase.
As someone who has had to maintain apps across web, iOS and Android, the answer to that is most definitely no.
Search for "offline first" to see how people are exploring architectures like this.
Edit: source: I worked on a product bundling chat functionality as a plug in.
In fairness, I think this is not so relevant for apps which are consumption first, but if there's any kind of collaboration, or even just writing from the client, you want to show an optimistic (at least; some systems make the client state canonical) representation regardless of sync status.
- Data model operations on local copy of data: For some use cases you can't just send everything to the server all the time, instead you want a local representation which is periodically synced with the server
- Logging / monitoring: Expose a single logging / monitoring API which can be shared across platforms
- Input validation / rules engine: Consider implementing a syntax highlighter, you wouldn't want to do that on the backend. Even simple form validation might sometimes be preferable to do client side, calling the multiplatform validate(data_model) and getting per-field validation back would allow for a lot of logic re-use.
- Do work that could be done on the server: Because of a lot of factors, like privacy or cost you might want to do work that could be done on the server. I.e, calling some sensitive third party API (banking?) where you have to transform requests/responses. Or maybe computation on large sets of data (video compression?) which otherwise would need to be sent to the backend.
- Interact with devices only locally accessible: IoT/bluetooth things
Server authoratative validation is security; frontend validation is UX
But, of course, there are plenty apps that prefer to do things locally, for so many reasons - if Spotify downloads songs, it does so locally. Or a note taking app such as Evernote needs to capture and compress whatever was drawn on the screen. Not to mention games!
If you think about more than CRUD apps, you’ll see that there are plenty things to be run on the device which are independent of UI.
source: have worked on apps you likely use every day
If you can have your apps share their data models between both android and iOS you can have the apps share the HTTP request/response handling and their DB code etc and then it truly becomes just a dumb client.
YouTube/Netflix also have complex video encoding/playback code that can be written in c++ and shared between clients.
Most social media apps liek FB/Insta/Snapchat have complex camera and photo handling code as well as async messaging code. Which if you have things like retries or photo compression/encryption you'd probably want to share between clients. etc..
But put logic aside being able to use the same programing language across platform eliminate a lot of the context switching.
For me it makes perfect sense to e.g create an internal API client using this. You use platform specific frameworks for making the actual HTTP requests[1], but can write all higher level business logic in Kotlin and expose that. Adding a new REST route or change data validation would be done only once and be in sync on all platforms.
But I'm guessing that you have to pretty knowledgeable about the underlying platforms to know how (and if it's even possible) to create a good abstraction above the platform code. For something like audio/video playback or BLE, I'm guessing that there might be enough differences between Android and iOS that an abstraction that fit both is really unwieldy. And even if you create something resonable today, one of the platforms might introduce new features which destroys your abstraction.
[1]: I noticed that they even have some kind of built-in HTTP client abstraction: https://kotlinlang.org/docs/mobile/use-ktor-for-networking.h...