storeapipush1Swift: iOS2Kotlin: Android3Flutter: both4React Native: bothiOS or AndroidChatnot installedforegroundbackgroundsuspendednot runningbuild 1.0Chat · signedAllow camera?cameraGET /messages{"messages":[…]}notify: tokenSam: Lunch at 1?
Back row: the app store, the API server (the back end) and the push serviceFront: the ways to build an app, and the phone with its camera and the app's sandboxTokens: the build, the signed app, requests, JSON and the notificationThe phone in front is drawn open: the camera, and the sandbox with its permission door, the app and its files. Behind it stand the app store, the API server and the push service. A build goes to the store and a signed app to the phone; the app calls GET /messages and gets JSON back; later a notification reaches the phone through the push service even though the app is not running. The phone is drawn as an open tray so you can see inside. The sandbox walls, the permission door and the app block are pictures of rules the operating system enforces in software: on iOS each app gets its own container, on Android each app runs as its own Linux user.

Building an app

  1. A smartphone is a small computer: a processor, memory, storage, a screen and sensors such as the camera. Its operating system, iOS on iPhones or Android on most other phones, runs everything. A mobile app is a program you install on it.

Store and install

Inside the phone

Talking to the back end

Life cycle and push

What happens

;; step 1/12 · phone
a smartphone, inside
  processor   runs the instructions
  memory      holds the apps that are running
  storage     keeps installed apps and their files
  sensors     camera, microphone, GPS (location)
operating system   iOS (iPhone) or Android
mobile app         a program installed on top

The phone is drawn as an open tray so you can see inside. The sandbox walls, the permission door and the app block are pictures of rules the operating system enforces in software: on iOS each app gets its own container, on Android each app runs as its own Linux user. iOS names the states active, inactive, background, suspended and not running. Android describes them with activity callbacks (onResume, onPause, onStop) and keeps background apps as cached processes, which Android 14 and later freeze until they are needed.