Your device is connected to the internet, most likely trough Wifi that is connected to the router that’s in your living room.
Using that internet the device can connect to a central server and ask “Hello, I am a device running version 1.0.5. Is this the latest version?”
The server helpfully returns “No, you are missing version 1.0.6 and 1.0.7. Would you like to download those now?”
The device agrees, and starts downloading the updated files. Once they are downloaded the files are installed.
Latest Answers