Chapter 79: Native, hybrid and web apps
A mobile product can be built in the phone’s own code, in shared code for several platforms, or on the web. Engineers usually choose, but the choice decides which controls the designer can use, how closely screens follow platform conventions and whether the product has to pass app store review.
Native, cross-platform and progressive web apps
A native app is built with a platform’s own tools and languages, such as Swift for iOS or Kotlin for Android, and installed from that platform’s store. It gets the platform’s controls, gestures and accessibility features for free (→ 68 Platform guidelines). The cost is two codebases, usually two teams.
A cross-platform framework builds apps for several operating systems from one codebase. React Native, which Facebook released in March 2015, runs JavaScript and turns each component into the platform’s own control, so a switch on iOS is the iOS switch.1 Flutter, from Google, is written in Dart and draws every control with its own engine instead of using the system’s.2 Flutter screens look identical on both platforms unless the team designs the differences in.
A hybrid app is a web app packaged inside a native shell. In Apache Cordova, the standard example, the app is a web page running in a WebView, a browser engine embedded inside the app, and plugins give JavaScript access to the camera, contacts and other device APIs.3
A progressive web app (PWA) is a website built with web technologies that can be installed, work offline and send notifications like a platform app.4 Alex Russell and Frances Berriman named the idea in June 2015.5 A service worker is a script the browser runs in the background to cache files and receive push messages; a web app manifest is a JSON file giving its name, icons and start page. On iPhone, home-screen web apps could receive notifications only from iOS 16.4 in 2023, and only once added to the Home Screen.6
In 2015 the Indian retailer Flipkart shut its mobile website for an app-only strategy, then came back with Flipkart Lite, a PWA. With 63% of its users on 2G networks, it used a third of the data the native app needed to complete a first purchase, and people spent 3.5 minutes per visit against 70 seconds on the old mobile site.7
Choosing an approach
No approach wins in every case. These questions decide it:
| Question | Points toward |
|---|---|
| Needs new device features, heavy graphics or widgets? | Native |
| One team, with iOS and Android shipping together? | Cross-platform |
| Mostly content or forms, already on the web? | Hybrid or PWA |
| Must it open from a link, with no install, on slow networks? | PWA |
| Must it be in the app stores? | Anything but a plain PWA |
App stores add rules of their own. Apple’s guidelines reject apps that are little more than “a repackaged website”, which counts against a thin hybrid wrapper, and they require Apple’s in-app purchase for digital goods.8 A PWA skips review but loses the store as a place to be found.
Whatever the choice, ask early which controls come from the platform and which the team must build: the built ones need full design and testing (→ 81 Handoff and accessibility in code).
See also
67 Responsive, mobile-first and cross-device design · 68 Platform guidelines · 69 Mobile patterns and gestures · 75 JavaScript, browsers and performance · 80 The software development lifecycle
Sources
- Apache Cordova (n.d.). “Overview.” Apache Software Foundation.
- Apple (n.d.). “App Store Review Guidelines.”
- Flutter (n.d.). “Flutter architectural overview.” Google.
- MDN Web Docs (n.d.). “Progressive web apps.” Mozilla.
- Occhino, T. (2015). “React Native: Bringing modern web techniques to mobile.” Engineering at Meta.
- Russell, A. (2015). “Progressive Web Apps: Escaping Tabs Without Losing Our Soul.” Infrequently Noted.
- web.dev (n.d.). “Flipkart triples time-on-site with Progressive Web App.” Google.
- WebKit (2023). “Web Push for Web Apps on iOS and iPadOS.” Apple.
Notes
- Occhino, T. (2015, March 26). “React Native: Bringing modern web techniques to mobile.” Engineering at Meta. https://engineering.fb.com/2015/03/26/android/react-native-bringing-modern-web-techniques-to-mobile/ ↩
- Flutter (n.d.). “Flutter architectural overview.” https://docs.flutter.dev/resources/architectural-overview ↩
- Apache Cordova (n.d.). “Overview.” https://cordova.apache.org/docs/en/latest/guide/overview/ ↩
- MDN Web Docs (n.d.). “Progressive web apps.” https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps ↩
- Russell, A. (2015, June 15). “Progressive Web Apps: Escaping Tabs Without Losing Our Soul.” Infrequently Noted. https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/ ↩
- WebKit (2023, February 16). “Web Push for Web Apps on iOS and iPadOS.” https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-and-ipados/ ↩
- web.dev (n.d.). “Flipkart triples time-on-site with Progressive Web App.” https://web.dev/case-studies/flipkart ↩
- Apple (n.d.). “App Store Review Guidelines,” sections 3.1.1 and 4.2. https://developer.apple.com/app-store/review/guidelines/ ↩