English 中文(简体)
SL4A - Android Architecture
  • 时间:2024-09-08

SL4A - Android Architecture


Previous Page Next Page  

The Android software stack comprises of different layers, each layer manifesting well-defined behavior and providing specific services to the layer above it. The following figure presents a broad architecture of Android with its primary components.

Android Architecture

Linux Kernel

Android is built on the Linux kernel code modified to run on embedded systems as against the traditional Linux system. Hardware drivers for many common devices are built into the kernel, thereby ensuring device portabipty. It is based on secure user based permission model, which prevents one apppcation from reading another apppcation’s information or from interfering with its execution (e.g. CPU, memory, devices etc.).

Group ID based access to networking and Bluetooth features, logger, alarm, power management, low memory killer, Binder IPC mechanisms are a few noted enhancements to the Kernel.

Libraries and Runtime

This forms the second layer of the architecture. It includes a set of hardware optimized C, C++ pbraries, also referred to as the native layer. Examples include Media Libraries, SQLite, SSL, Bionic, WebKit etc.

The Android Runtime comprises of two different components − the Dalvik VM and Core Libraries. The Dalvik VM provides an execution environment for the apppcations on the Android Platform. The set of core pbraries provides most of the functionapty available in Java APIs.

Apppcation Framework

This layer makes available the Libraries as services to the apppcations. Some most important components within this layer include Location Manager, Resource Manager, Activity Manager and Notification Manager.

Apppcations

By default, Android comes with a rich set of apppcations, including the browser, SMS program, calendar, contact manager, maps etc. Google Play provides alternatives to these apppcations, if the user desires so.

Building Blocks

An apppcation can interface with the system with four function blocks. They are as follows −

    Activities − Activities represent a single screen that the user sees or interacts with visually. For example, an email app might have one activity that shows a pst of new emails, another activity to compose an email, and another activity for reading emails.

    Services − A majority of processing is done by these services for your apppcation. It is the logic behind the user interface. For example, a service might play music in the background while the user is in a different app, or it might fetch data over the network without blocking user interaction with an activity.

    Broadcast Receivers − A component that can be registered to psten for system or apppcation events and issue notifications about the same. An instance for broadcast originating from the system is a ‘low battery notification’ while an apppcation level broadcast could be a ‘download successful’ notification.

    Content Providers − A content provider manages and helps you share data between multiple apppcations. For e.g. a content provider may be used to share the contacts data.

These components interact with each other through messages called Intents.

Advertisements