Many a time, Android is referred to as Java on Linux. As a developer or security researcher, it is very important to understand the architecture behind any platform. Android's architecture is based on the Linux 2.x and 3.x kernels and acts as the hardware abstraction layer.
It consists of:
Key applications
An operating system (which is the abstraction between the software and hardware components)
Middleware
The runtime environment
Different services
Native and custom libraries
It can be represented as five different layers, as shown in the following architecture diagram:
All the components are tuned and integrated to provide the optimal application development and execution environment for mobile contrivances.
Now, let's take a bottom-up approach toward understanding the different layers of the Android stack.