Android Architecture is one of the most crucial foundations on which a project stands. Without it, a project would not only become unappealing but incompetent as well. A project with a good architectural design is a well thought-out and well planned project. Such a project is more efficient, detailed and sophisticated than those projects that do not invest a lot in pre-planning and architectural basing.
You must have seen the term “architecture” being associated with buildings only. However, the truth is, many kinds of projects require architectural basing before they are manufactured. In this list, a prominent object is Operating System. Operating systems require an elaborate plan and architecture so that they can be created properly without wasting any resources.
You must be thinking how architecture is applied in an operating system development. The architecture of operating systems refers to the overall design of software and hardware components. During the process, the overall operational effectiveness of the components is never ignored. Besides that, an efficient operating system must be cognizant of its processes and users, so its programs and data have to be kept in mind as well.
Because architecture is so useful for making an efficient operating system, many well-reputed operating systems have made use of it. These operating systems include Windows, Android, iOS and many more. That being said, this article will be focusing only on the Android Architecture.
The Android Operating System
Android is the name of one of the most famous and leading operating systems of today. With the rising popularity of smart phones in the last 15 or so years, the need of an operating system that has a great compatibility with these devices was immense. In this time of need, the first commercially available Android smart phone was released in the September of 2008.
The operating system is designed principally for mobile devices, such as smart phones and tablets. Starting from black-and-white phones to the latest smart phones, the Android operating system has developed a lot since its invention—making it one of the most widely used mobile operating systems nowadays.
Having the ability of supporting millions of applications in mobile devices, Android is among the most powerful operating systems in the world. Not only that, Android applications are known to be comfortable, convenient and advanced for their users. On top of that, Android is an open source operating system, which means it is freely available for people to use.
None of this would be possible to achieve without the exceptional Android Architecture that we are about to study.
The Android Architecture is made up of a number of different components. These components are required to support all the needs of Android devices. The Android Architecture is designed in such a way that it has layers, like that of a stack. This Android software stack contains an open source Linux Kernel possessing a collection of C/C++ libraries. These are exposed through an application framework, runtime, services and applications.
There are five components of the Android Architecture, and these five components are arranged in four layers. The names of the five software components are as follows:
- Linux Kernel
- Android Runtime
- Application Framework
1. Linux Kernel
In Android Architecture, the four layers of software components begin with Linux Kernel. That is to say, Linux Kernel is at the bottom of the layers. To be more precise, the Android Architecture uses the version 3.6 of the Linux Kernel, which has about 115 patches.
Being the base of this software stack, Linux Kernel is the main component of the Android Architecture. For this reason, Linux Kernel has the most important responsibilities out of all the components. With the abstraction layer provided by the Linux Kernel, the device hardware gets linked with the rest of the software stack.
Other than that, Linux Kernel manages all the essential hardware drivers, such as camera drivers, Bluetooth drivers, display drivers, USB drivers, audio drivers, memory drivers, keypad drivers, etc. All the important drivers are required by the Android device at runtime. In addition to that, Linux Kernel has the responsibility of managing the device along with its memory and power. And, last but not least, the Linux Kernel is also really good at handling networking.
The second layer of the software stack is of a set of Libraries, which means that they are on top of the Linux Kernel. This set of Libraries, also known as The Platform Libraries, consists of a variety of C/C++ core libraries and java based libraries, such as SQLite database (a useful repository for storage and sharing of application data), SSL libraries, Webkit (an open source web browser engine), Libc, Surface Manager, Graphics, Media, OpenGL and many more.
The different Libraries mentioned above can be categorized on the basis of their functions. Some of those java based libraries are there to provide support for Android development. For this particular purpose, libraries like application framework libraries are used. Apart from those, the libraries that facilitate UI (User Interface) building, database access and graphics drawing are also used.
A few core Android libraries available to a developer in Android development are summarized below:
This package is used to access data that is published by content providers, and it also includes SQLite database management classes.
This package is used to obtain applications with access to standard operating system services, which includes inter process communication, system services and messages.
This package is used to obtain access to the application model, and it is the foundation of all Android applications.
This package is a java interface to the OpenGL ES 3D-graphics-rendering API.
This package is a collection pre-developed UI components, which includes buttons, list views, radio buttons, labels, layout managers, etc.
This package is used to modify and render text on a device display.
This package is a set of classes which allow web-browsing abilities to be developed into applications.
This package basically facilitates access to content, messaging and publishing between applications and components of applications.
This package is the basic building block of UI of applications.
3. Android Runtime
The third component of the Android Architecture is located in the second layer of the software stack—the same layer that has the Libraries. This third section, known as Android Runtime, contains key components like a set of core libraries and Dalvik Virtual Machine (VM).
The set of core libraries is used allow Android app developers to write Android app codes by using the standard Java programming language.
On the other hand, the Dalvik VM is a register based VM, such as the Java Virtual Machine (JVM). The Dalvik VM is specifically designed and optimized for Android so that a device is able to run a number of instances efficiently. This VM depends upon the Linux Kernel for multi-threading and memory management.
4. Application Framework
The Application Framework, located in the third layer i.e. above Libraries and Android Runtime, provides the classes to develop Android apps. Also, the Application Framework provides a generic abstraction for hardware access. Additionally, it manages the UI and app resources.
Basically, the Application Framework offers us a number of high-level services to apps in the form of java classes. In Android development, app developers are allowed to incorporate these services in their apps. The primary services provided by the Application Framework are:
This service enables apps to display alerts and notifications to the user.
This service is used to handle all aspects of the activity stack and application lifecycle.
This service is used to get access to non-code embedded resources, such as UI layouts, strings, color settings, etc.
This service allows an app to publish data and share it with other apps.
This offers an extensible set of views that is used to develop application UIs.
The topmost layer of the Android Architecture is made of all the Android Applications. On this layer, applications are written to be installed. That is to say, both the native and third-party apps, such as browser, games, contacts, gallery, email, music, etc., are written to be installed in this layer only. This layer of Applications runs within the Android Runtime by using the services and classes that are provided by the Application Framework.