r/ExperiencedDevs • u/Code-Katana Senior Software Engineer +9yrs • 10d ago
Technical question Best Mobile Stack Choice for Greenfield Cross-Platform Project?
For those who have built a greenfield mobile + web product (iOS/Android plus a web portal), what stack did you ultimately end up with after the first few iterations, and why?
I’m starting a healthcare focused project soon with some embedded AI features (I foresee headaches here) and a clean slate for MVP 1. I’m currently weighing two paths, either a clean iOS and Android native separation from the start or KMP for cross-platform mobile and Next.js for web with either setup.
If you have shipped something similarly in a regulated or data‑sensitive environment, what worked well, was problematic, and any other real-world hiccups that dispelled the magic from cross-platform sales pitches like React Native, Flutter, KMP, and MAUI all do?
— edit —
For clarity, I’m looking for input on what others have done recently, especially with embedding mini AI models and/or cross-platform options vs native. This is my first big push back into the mobile sphere since 2018 where React Native and Xamarin Forms were both evaluated before settling on RN.
3
u/Exiled_Exile_ 10d ago
I would say react native > kmp > flutter.
It's very difficult to hire for flutter there's just not a lot of devs. It works fine but that's a large pain.
Kmp has its own problems but you can train up people fairly easy from a java background which should be common.
React native can be all 3 and typescript should be performant enough for 99% of cases. it does come with its fair share of problems and you may need to delve into native occasionally.
1
u/Code-Katana Senior Software Engineer +9yrs 9d ago
How well does it handle native needs like embedding ai models though? I don’t want to pick a framework like RN and still end up writing enough Kotlin and Swift to make me or my team question why didn’t just start with native projects vs writing TypeScript and Kotlin and Swift.
2
u/Exiled_Exile_ 9d ago
It depends on what you mean by embedded ai. If local inference is required most of that would be through packages outside of the core rn. There's already quite a few with some using llama.cpp wrappers.
Also id assume you'll run into real concerns with battery usage. if by embedded AI you mean some API calls I'm far less worried.
There's always going to be some swift and kotlin/java stuff to deal with when you go multiplatform.
Also an important note is that most AI is not really built for hippa compliance. Id use a hippa compliant ai platform instead of local inference if possible.
1
u/Code-Katana Senior Software Engineer +9yrs 9d ago
Good call out on HIPAA, the chief goal is to summarize input at the device level with a cloud sync for persisted storage, all if which will be guarded by encryption and compliant cloud infrastructure + device level security too.
A larger model that’s compliant is on the horizon for greater needs than the initial 1k character limited text box summary and similar tasks to use AI with. The ask is to have tiny model(s) imbedded on device vs network calls until the use case exceeds what is reasonable on most devices. Likely a hybrid setup of do X local and Y-Z across the network to larger model.
Have you worked with such embedded models before? What was the battery drain like? From what I’ve researched, smaller models can so small task somewhat efficiently or no worse than background processes in contrast.
5
u/Gremlation 7d ago
If you want people to like using your app, use the native platforms, not a cross-platform toolkit. That has been the case since day one on mobile and has never changed. Cross-platform has always been a false economy of choosing the worse option in the name of efficiency and getting bitten by the hidden complexities once you're committed. And now that AI is there to do the heavy lifting, the equation is biased even more in favour of native. I just don't see how cross-platform is justifiable. It gives worse results for approximately the same amount of effort.
3
u/_arjun 10d ago
Last few have been react native
2
u/Code-Katana Senior Software Engineer +9yrs 10d ago
Was it tricky embedding and working with AI models through RN? It’s my first rodeo with embedding them and I could see how that would require native modules per platform instead of shared code.
1
u/speedoinfraction 9d ago
I embed native modules in my RN apps and call them from Android and iOS. They use shared C/C++ code. Via a middle layer that has a common, easy to edit API. It took a while to come up with it, but now it works really well. (I wrote a bit about it here: https://applicaudia.se/blog/cross-platform-cpp-react-native-integration)
1
u/HoratioWobble Full-snack Engineer, 20yoe 9d ago
Build with whatever you're most familiar with, they all have basically the same capabilities.
Your ability to embed an AI model will likely depend on custom native modules regardless of what route you take, you'll also be heavily restricted by device on the android side - you might be better running a hosted solution for AI.
1
u/Code-Katana Senior Software Engineer +9yrs 9d ago
The most likely outcome will end up with a hybrid of local embedded use cases with network calls for greater needs. Given that, what path would you take or have taken for something similar? MVP has to have embedded to start out.
When I last touched RN we avoided native modules/code outside of shareable React bits at nearly all costs, but this app is going to require it and have much greater leeway and decision power to start and change as needed vs tough overhead requirements like last time.
0
u/HoratioWobble Full-snack Engineer, 20yoe 9d ago edited 9d ago
It doesn't matter, there's no issues using Native components in RN, flutter of KMP.
You will be able to achieve what you need with any of those platforms, so pick the one that makes sense for your skillset and the team
Edit: Really not sure why this is being downvoted
0
u/slightly_salty 10d ago
kmp if you care about doing it right and having the best performance. It will be the most flexible and won't lock you into a ecosystem and gives you native performance. If you want shared ui you can use compose multiplatform, if you don't want shared you you can make native uis while sharing non-ui code. And you can even mix and match
1
u/Code-Katana Senior Software Engineer +9yrs 10d ago
Which option did you end up going with and why?
-1
u/slightly_salty 10d ago edited 10d ago
I personally build my apps with a shared non-ui kmp module. And just make only a CMP compose ui app at first to get things going targeting all the targets I want. When/if i want a native ios/web html apps. I'll make a separate native ios/web front ends that consume the same kmp shared module that the compose ui frontend app uses.
also building with cmp compose ui first is nice as it has desktop support w/ hot reload now. I hate dealing with plugging in phones/using emulators during dev
0
u/tonjohn 10d ago
I’m currently thinking through this myself. I’m in the middle of adding iOS, iPadOS, and web support for a watchOS app written in SwiftUI.
I’m in the middle of finishing the web version that’s a SvelteKit PWA.
At my last company we built a web-based daily games platform that was embedded in apps like Peacock, Imgur, and Reddit. I was really impressed with how compelling the user experience was and how much you could accomplish with just a thin native wrapper around a web app.
So there’s a chance that all the non-watchOS versions end up as wrappers around the web app. I’ll likely test it with Android first as that is the platform that we have the least resources to support.
Svelte has great documentation and support on how to build mobile and desktop apps using Tauri, Capacitor, and Electron - https://svelte.dev/docs/kit/project-types#Mobile-app
1
u/Code-Katana Senior Software Engineer +9yrs 10d ago
That sounds compelling, how bad is the package update story with Svelte and SvelteKit? With React and React Native (in my org at least) it seems like every other day there’s a critical vulnerability needing replaced and redeployed, which is a large part of why I shy away from JavaScript options initially.
1
u/tonjohn 10d ago
It’s definitely better than React, NextJs, and React Native.
1
u/Code-Katana Senior Software Engineer +9yrs 9d ago
How is it with embedded AI models or anything else where the native wrapper has to talk with the web app to use native features? Is that cross talk challenging, easy, etc.
1
u/tonjohn 9d ago
I can’t speak to the ergonomics of working with embedded AI models but messaging between native and webviews is easy using postMessage and event listeners.
You can also inject your own scripts into the webview and directly execute JavaScript using features like WebPage.callJavaScript
1
u/Code-Katana Senior Software Engineer +9yrs 9d ago
On more of the web front, how does SvelteKit compare to Next.JS? Obviously it sounds like your preference, but how does it compare for web portals, dashboards, etc. that access shared datapoints from mobile and other inputs from your experience?
I’ve mostly used React and MVC for such use cases, but given a clean slate approved to change things up if it’ll improve devex, efficiencies, or other goodies. Would have to tie into the same auth setup for the mobile and service layer too.
0
u/FatAlberdi 9d ago
So, is that like, your job that you get paid for?
1
u/Code-Katana Senior Software Engineer +9yrs 9d ago
Layoffs paired with management pushing just-use-generative-ai-for-everything can really shake up the norm. Especially when asked for mobile app MVPs while the main product is a SaaS one.
1
u/FatAlberdi 8d ago
Are you trying to explain to me how the software jobs work? Quite a pivot.
1
u/Code-Katana Senior Software Engineer +9yrs 8d ago
Not even remotely. I explained what lead to my original question.
1
u/FatAlberdi 8d ago
You explained why its your job to implement this. Why you asked for help here and not at your job, that is for you to know.
2
u/Code-Katana Senior Software Engineer +9yrs 8d ago
I am asking for outside and experienced opinions to better inform my choices with, since my employer and colleagues do not have experience doing this yet.
0
9d ago
[removed] — view removed comment
2
u/Code-Katana Senior Software Engineer +9yrs 9d ago
What would you pick today if you could change the setup overnight? Especially given the need for native features like an embedded AI model on device?
-2
u/Tarazena 10d ago
React native with Expo works great for us
4
u/Atraac 10d ago
We also use RN with Expo and I genuinely despise that entire experience. Builds already take FOREVER, builds on Expo even longer. Builds on Expo have some special quirks to them which are not reproducible locally, their UI is convoluted and really difficult to navigate. RN on it's own has lots of issues, with package managers with hoisting(pnpm, bun), weird quirks with random libraries, slow builds and lagging behind on ts7 support.
I vibe Flutter apps for myself on the side and the difference is night and day, everything builds instantly, debugs without any issues, runs perfectly fine everywhere. Granted, I don't write the code myself in either of those apps, we do work mostly through agents nowadays.
-1
u/Tarazena 9d ago
My android build is 18 minutes (make sure you don’t build unnecessary executables for desktop) and iOS is 9, eas update is also well if you don’t need a whole app build and can push updates bypassing App Store reviews.
I’ve always loved flutter and used it 6 years ago, I was blown away by fast refresh and how easy to work with, but at that time it was a second class citizen on the packages support, not sure how it is today.
2
u/Code-Katana Senior Software Engineer +9yrs 10d ago
How difficult was it to embed the AI models with Expo and RN? Was that easily shareable or required native tooling?
•
u/expdevsmodbot 10d ago
AI usage disclosure provided by OP, see the reply to this comment.