Skip to content
KALANBLON
Show contents

Chapter 1 of 7 · 20 min

The families of mobile apps

By the end of this chapter, you'll be able to

  • Tell a native app, a web app and a progressive web app apart
  • Name the constraints specific to the phone: screen, touch, network, battery, storage
  • Choose an approach based on a project's needs
  • Explain why the web is a good way into mobile for beginners

Three main families of apps

A native app is written for a specific system: Android (in Kotlin or Java) or iOS, the iPhone's system (in Swift). It is installed from a store (Google Play, App Store) and can use the whole phone: camera, contacts, notifications, sensors.

A web app is a website designed for the phone: you open it in the browser, through a simple link. Nothing to install, nothing to update: the latest version is always online.

A progressive web app (PWA) is a web app that behaves almost like a native one: it can be added to the home screen, opens full screen and can work without a network. The course "Mobile: progressive web apps" will teach you how to build one.

There are also cross-platform tools (Flutter, React Native): you write the code once, and they produce an app for Android and one for iOS.

NativeWebPWA
Installationfrom a storenoneoptional, from the browser
Updatesthrough the storeimmediateimmediate
Access to the phonefulllimitedpartial (camera, location, notifications depending on the system)
Offlineyesnoyes, if designed for it
LanguagesKotlin, Swift…HTML, CSS, JavaScriptHTML, CSS, JavaScript

The phone's constraints

Designing for a phone is not shrinking a desktop website. Five constraints change everything:

  • the screen is narrow (often 360 to 430 pixels wide) and held upright;
  • touch replaces the mouse: a finger is less precise than a pointer, and there is no hover;
  • the network is patchy: switching from 4G to 3G, dropouts, limited data plans;
  • the battery runs down fast if the app works non-stop;
  • storage is often full: a 150 MB app may be refused by its user.

Choosing your approach

The right choice depends on the project. Here is a small JavaScript function that sums up the reasoning:

function approach(needs) {
  if (needs.advancedSensors) return "native (or cross-platform)";
  if (needs.offline || needs.homeScreen) return "progressive web app";
  return "web app";
}

console.log("A shop's catalogue:", approach({}));
console.log("Sales book without network:", approach({ offline: true }));
console.log("Augmented reality game:", approach({ advancedSensors: true }));
A shop's catalogue: web app
Sales book without network: progressive web app
Augmented reality game: native (or cross-platform)

For beginners, the web is the best way in: a text editor and a browser are enough, your work opens on every phone through a link, and the same skills (HTML, CSS, JavaScript) are then used for PWAs and for some cross-platform tools.

Files already downloaded stay available, even when the network drops.

Step 4 of 4
Text description of the animation
  1. A customer receives the shop's link in a chat.
  2. The browser opens a page designed for the phone: no installation.
  3. If they use it often, they add it to their home screen, like an app.
  4. Files already downloaded stay available, even when the network drops.

Mini-lab: your choiceJavaScript

Output

Click “Run” to execute your code.

Your code runs in your browser, isolated from the page. · Ctrl/⌘ + Enter to run · Esc then Tab to leave the editor

Your turn

Worked exercise

Worked exercise: the weight of an installation

An association hesitates between a 48 MB native app and a web app whose pages weigh 400 kB on first load. Write a function downloadTime(sizeMB, speedMbps) that returns the download time in seconds, rounded to the nearest second, then compare the two options at 2 Mbit/s (a decent 3G).

Hint 1
A byte is 8 bits: a size in megabytes (MB) is converted into megabits by multiplying it by 8.
Hint 2
The time is size in megabits ÷ speed in megabits per second. Use Math.round to round. 400 kB is 0.4 MB.
Show the solution and common mistakes
function downloadTime(sizeMB, speedMbps) {
  return Math.round((sizeMB * 8) / speedMbps);
}

console.log("Native app:", downloadTime(48, 2), "seconds");
console.log("Web app:", downloadTime(0.4, 2), "seconds");
Native app: 192 seconds
Web app: 2 seconds

More than three minutes of waiting before the first use, against two seconds: on a slow network, this is often the difference between a person who uses your service and one who gives up.

Common mistakes:

  • Forgetting the bytes → bits conversion: speeds are expressed in bits per second, file sizes in bytes. Without the factor of 8, you underestimate the time 8 times over.
  • Only comparing the first visit: the web app reloads partly on every visit (unless it keeps its files in cache), the native app does not. The two figures together give a fair picture.

Summary

  1. 1A native app is installed from a store and can use the whole phone; a web app opens through a simple link.
  2. 2A progressive web app can be added to the home screen and can work without a network.
  3. 3Narrow screen, touch, patchy network, limited battery and storage: these constraints guide the whole design.
  4. 4For beginners, the web is the best way in: HTML, CSS and JavaScript are used everywhere.

Your progress is saved on this device. Create a free account to keep your progress on all your devices.