A girl and a robot thinking together

Let’s think it through · Start with a story

A girl opens a weather app. The screen is on her phone, but where does the current forecast come from?

Break down the process

Follow the numbered steps, then explain them in your own words
  1. Choose a cityEnter a query
  2. Call an APISend a request
  3. Receive dataOften structured, not a webpage
  4. Update the screenShow the result in the app

An app can request data from a server and display it in its interface.

The app sends a query, receives structured data from a service, and uses it to update the screen. The response does not have to be a whole webpage.

An app may also show cached data while it is offline. A timestamp can help you tell how fresh the information is.

Your turn

If an app is offline but still shows yesterday’s temperature, where might that value have come from?

Have an answer? Click to see the explanation

It may be cached data saved earlier. Check the displayed update time before treating it as current.

Takeaway

An app can request data from a server and display it in its interface.

Try covering the diagram and explaining each step to someone at home. If a step is hard to explain, go back and look at that card again.