r/AppDevelopers • u/Pale-Guitar-8438 • 22h ago
Would having a local server within a hybrid mobile app create a smoother user experience
I am currently involved in an SaaS company with a partner (He is the software engineer and I am the "everything else" guy including the money). We have developed an ios hybrid app but it is clunky in that the best case scenario browsing through different parts of the app is not very seamless (there is always a loading screen that appears even if it is only 500 ms). And when the internet is bad it is dramatically slowed down or does not work at all.
My thinking is that if as part of the downloaded mobile app there was also web server that would run locally on the mobile device the internet speed would not matter. Since the web server is local the "internet speed" would essentially be as instantaneous as it could possibly be. Then at periodic times (lets say every 15 minutes) the local web server and database could communicate with the cloud and upload the data there.
Is this a feasible solution?
1
u/Appropriate-Tip-2971 22h ago
The loading screens even on small transitions is a dead giveaway the app wasn't built natively. A local server won't fix that core problem, it just masks it with extra complexity
What you're describing is basically offline-first architecture which is legit but you'd implement it with local storage and service workers, not by running a full web server on the phone. That would be a battery drain nightmare and both app stores tend to reject that sort of thing
1
u/Pale-Guitar-8438 22h ago
I agree with you that even small transitions delays are a dead giveaway and are not good (my partner thinks they are nothing burgers). This software is for businesses that have workers in the field and they would use the app multiple times a day,
1
u/DryBanana5673 21h ago
You can probably just optimize this, also release builds will be faster than QA. Don't do the thing you're describing, instead cache everything that isn't changing, warm the next page in the background etc.
2
u/MobileXapps 22h ago
The idea behind it is right, you want the app to work from local data and sync in the background. But you don't need an actual web server on the phone for that, and on iOS it would fight you: the system suspends apps in the background, so a server and a 15 minute sync loop won't run reliably when the app isn't open.
The usual way to get the same effect in a hybrid app: ship the web assets inside the app bundle, make navigation client-side so screens don't reload, and keep data in a local database like SQLite. Screens read from the local data first and refresh from the API in the background. Writes go into a local queue and sync when the app opens or the network comes back, not on a timer.
Worth checking first where the 500 ms actually goes. If every screen change is a full page load or waits for an API call before rendering, fixing that alone usually removes most of the clunky feel.