How Apps Work - Part 1
We use Apps in our daily life for almost everything. We have Health Apps, we have Educational Apps, we have Apps for shopping, we have Apps for business, we have Apps for Entertainment. In short we have Apps for everything. Have you ever wondered what these unique type of files, Apps are? If yes then this is the right post for you. Today I am going to tell you how Apps work and what makes them work.
Lets start our journey, going step by step;
App is an archive (package)Basically an archive is a package of files (and folders) that is portable. The most common archive type is .zip. Files and folders can be packed in a ZIP and then can be uploaded, downloaded, moved or burned as a file. If a ZIP reader is installed on a computer, its user can open ZIP archives as folder and then can unpack aswell.
An App is also an archive but the extension of App might not be .zip. There are numerous raw files inside an App archive, most of which are compiled programming files. There might be some images and other files too. But the most important file that's necessary for an App archive to have is MANIFEST file which is located in the META folder, inside the archive.
How A Device Recognizes An AppThere is always a reserved file type in the filesystem of a device which is treated as an App. For example, Android has a default App extension as .apk. All the files with .apk.apk? In such a case the system will treat this file as an app and will try to open it. But system will get no information about what type of app it is and what to do with it. Hence, an "Invalid App" error will be generated. But why an error? Why not a blank App? Lets see;
As I've said above, MANIFEST is the most important file inside the App archive. When an app is invoked (opened/runned), system gets all its information from the MANIFEST. It tells system what to do with the app and how to do it. If there isn't any MANIFEST file inside the archive or if the information inside the MANIFEST is inappropriate, app will give out an error. So, when the extension of a non-app file is changed to app-type extension, system will not get enough information and an error will pop up.
As said above, most of the files inside the app archive are programming files. These programming files are programmed to work together and make the app run perfectly. But how an app starts? How all the programming files work in co-operation? The author of the app writes in MANIFEST which programming file to call first (as soon as the app starts). This file calls all the other files, when required.
In A Nutshell (How Apps Work - Part 1)
- An App is an archive (a portable folder)
- An App archive contains all the files required for the app.
- An App archive contains a MANIFEST file which contains all the information of the App. This file tells the device how to work with this file.
- The MANIFEST tells device which programming file to open first. This programming file manages all the other files.
I will try to write more about Apps and their modifications in newer posts.
Please comment below and let me know how am I doing.