How Does An App Work?
Let’s say we have an app that contains a single button in it thats says ‘click me’. When a user taps this button, the phone’s sensors register the tap and sends a message to the OS (IOS). The OS looks at the data it gets from the sensors – such as:
- How much pressure was applied to the screen
- At which location on the screen did the tap happen
…then the OS will send a message to the app and tell it the button was tapped, and await further instructions. So the code you write should specify what will happen in this scenario when the button is tapped.
As an app developer, you will be planning out all of the scenarios and what should happen in each case.
3 components to every single mobile app
- Screen – User interface elements you see on screen (buttons, images, toggles, sliders etc).
- Code – When the screen’s elements get interacted with (user taps on button), the code “plans” for this at responds accordingly.
- Data – If for example, we have a contact manager app, and the user clicks a button to retrieve a person’s contact information, the code will go into the data to get that person’s piece of data and display it on to the screen.
Differences between a mobile device and computer
- Computers are usually plugged in to wall / Mobile devices are wireless / have smaller batteries.
- Phones have less processing power
- Basically we need to manage the phone’s resources frugally so we can have a pleasant experience for the user and to save on CPU/battery.
The OS has an inbuilt manager to manage all of the phone’s resources. It could for example, tell the app that it’s using too much battery and shut the app down, or if the user is receiving a call, the app will have to be shut down, make sure to save the data.
As well as dealing with users interacting with an app, we also have to deal with the OS and situations like users getting a phone call while a user is using an app etc.