How Does An App Work?

What happens behind the screen of an Application

Shree Bhagwat
Codeaamy
7 min readOct 15, 2020

--

illustration of application working, source digitaltrends

If we will have a closer look around we will feel that now a days use of application have increased a lot. Everyone around us uses applications in some or other way.

With more 111 thousands mobile apps released just in the month of August on Googles Play Store, which is currently the largest Application Store out there with more than 2.7 millions applications available.Today world is been completely surrounded with different applications and application help our tasks to become easy and friendly.

There was just a time when getting out of the house going to market just to buy some grocery or items which are needed in the house and today time where we can get what ever we want just by sitting on our couch with just a click of a button.

But ever wonder how this all works?

What all might be happening behind the screen of what seems such an easy task from the front side?

Smartphones are computers — just smaller

Before getting our hands dirty with all the technical knowledge, we must understand that smart phones are also computers, just smaller in size and functions just like any other computer does. And the application is just pieces of code brought together to give instruction to our Mini Computer.

let us start with the most simple application to make our understanding easy.

Below we have an app that just has a single button which says Click Me, and once the users clicks on the application a greeting message is shown on the screen.

Codeaamy, How does an app work, Displays a greeting when a click me button is pressed
Simple Greeting Application

What happens when the user clicks or taps on the click me button?

The users actually taps on the screen where the button is present and not exactly on the button as there is no actual physical button on the screen. As soon as the users touches or taps the screen the screen registers the taps and sends the message to Operating System (iOS and Android).

The Operating System (OS) looks for the data that is gets from screen sensors like , The point where the screen was tapped, how much pressure was applied to the screen, was it a single tap, double , swipe etc. Also what was present on the screen when the tap was registered and which application was running.

That a whole lot of information transfer and calculation going on there for just a tap of a button.

After getting all these information the OS then questions the application which was running at the time when the screen registered a tap asking for what to do after the button is tapped. The code which was written for our application should specify what the button must do when someone clicks or taps the button. So the OS gets the answer and lets our application perform the button pressed function. Which is — showing a dialog box of a welcome greeting.

Three Main Components For Any Mobile Application

The Main Components Of Mobile Application

1 Screen

Screen is the first main component of any mobile application. All the User Interface elements comes under this section of the of our application.

If we check our application now we can see that our application has a Click Me button in the centre of the screen. That is a user interface element. The user can interact with our elements and can give command to our application regarding what to do next.

These UI elements consists many elements such as button, text, slider, images, videos in short what ever we see on the screen and interact with on the screen. We can arrange this UI elements on the screen how ever we want, with which every style we give.

2 Code

Now when the user interacts with the UI elements from the screen the second component comes into the play which is our Code. Which tell the application what to do when a users reacts to our specific UI element.

For example when the user clicks on the Click Me button, the Code part comes to play and what ever instruction is given under our Click Me part is executed.

So there is a section of code inside, which plans what will happen when user Clicks on the button

A Piece of code which shows what will happen when our Click Me button is pressed (Dart Language)

3 Data

The Third and final part is the data. Most of the apps which are bit complex will have data stored somewhere, either inside the app or on the server.

Let's say we have a have a students management application which has all the data of the students. Their name, roll number, class, division etc. When the user clicks on the show data button, the application will display all the detail of the students.

  • User interacts with the screen, click on the show data button.
  • The Screen triggers and sends the information to the OS.
  • OS communicates with the application and questions what to do with this user Interaction.
  • Application checks the provided code to see the instructions for show data button tapped.
  • The code instructs the application to fetch the database for the students data.
  • Application fetches the students data in the database and checks the instruction code to see what to do next.
  • The code instructs the application to display the data onto the screen.
  • The Application creates the UI for displaying the Data onto the screen and displays the Data.
  • User sees the data.

If you want to learn app development read the below article
https://www.codeaamy.com/tech/how-to-start-your-programming-career/

OS as the Manager

Our Phone is a mini computer and is portable, which mean we carry on phone and use it on the go. Hence our phone has battery which we charge and later run our phone on that charged battery.

So we need something to manage our application in our phone, otherwise all our application will be running on the phone and it will eat up all the battery or lag our phone. And thats why we have a manager to manage our phone and application.

Illustration Of A Manager Managing Task

The managers checks which application is currently running, which application will be opened next, how the user is interacting with the application etc.

A manager decides to put application into background when users get a phone call or when the user clicks home button off the phone.

Everyone phone has limited number of resources available, limited ram, limited CPU and limited space. So the manager has to manage which app is compatible with the phone, how much free ram is left, closing the application on overuse of RAM and CPU. Stop the lagged or hanged application.

Our OS plays the role of this manager which manages these application efficiently and nicely.

So the Manager wraps the 3 component (Screen, Code, Data) and makes sure that everything is running properly as per decided and under the surveillance of the the Manager.

The Kernel

The Kernel is centre part of OS which acts like a bridge between the software and hardware of the phone. The Kernel communicates with the required hardware the application needs and turn it on or switches it off.

Easy Example : Camera App

When the user clicks on the camera app. The Manager (OS) checks the question the application.

The application check for the code and informs the OS to turn on the camera.

The Manager passes the information to the Kernel and instructs the kernel to turn on the camera.

Later Kernel turns the camera on and connects the camera with the camera application.

Each and every instruction users gives to camera like, licking the photo, zooming the camera selecting the mode, etc. Is monitored and passed by kernel to the hardware.

Conclusion

This is a brief explanation of how an application works, or what happens behind the screen.
This is was a not so technical information to make sure even the layman, or anyone with no technical background can understand the working of an application.

Thank You reading my blog, if you have any doubt or recommendation please let me know in the comment section below

You have 50 Claps per day. Claps do Motivate us to keep writing. Gotta Use Them All

--

--