Friday 11 July 2014

2. Android Architecture

Android architecture is a stack of layers. At the bottom of it is linux kernel. On top of that we have libraries which are native libraries developed in C/C++. These are the libraries which expose the capabilities through application framework which are intern used by the applications. So the key thing which application framework is doing here is to enable reuse of various components.
(Libraries and the application framework is what we call middleware).


Applications

An application can be seen as the first point of contact with the android platform. Android itself comes with a certain group of applications which are built in any standard android device for example:
Email client, SMS program, Calender, Maps, Browser, Contacts.

In addition we can write our own applications and all are created equally using the java language.

Application Framework

Down below the applications, android provides an application framework which captures certain key functionalities that are provided for users. This further enables and simplifies reuse of components. Developers will have full access to the same framework APIs used by the core applications.

  • View System - Used to build an application, including lists, grids, text boxes, buttons, and embedded web browser.
  • Content Provider - Enabling applications to access data from other applications or to share their own data.
  • Resource Manager - Providing access to non-code resources such as localized strings, graphics, and layout files.
  • Notification Manager - Enabling all applications to display custom alerts in the status bar.
  • Activity Manager - Manages the lifecycle of applications and provides a common navigation backstack.

Libraries and Runtime

In addition, android comes with a whole bunch of libraries which are underneath and provide lots of useful functionality. Everything here is written in C/C++. This is the level where core power of android comes from.

Surface manager is responsible for composing different drawing surfaces onto the screen and make sure that pixels should end up displaying on the screen when they are supposed to.
OpenGL | ES and SGL make the core of graphics libraries. OpenGL|ES is a 3D library and SGL is for 2D graphics. So using these, android facilitates the combination of 2D and 3D graphics in the same application.
Media framework was provided by PacketVideo(a member of OHA). This contains all of the codex for media experience.
FreeType is used to render the fonts.
SQLite is used as the core of our data storage.
SSL (Secure Sockets Layer) is crystallographic protocol for secure internet communications.

Android Runtime

Android runtime is specifically designed for android to meet the needs of running in an embedded environment where we have limited battery, limited memory & limited CPU.
Main component in runtime is the Dalvik virtual machine. This DVM runs .dex files. These are byte codes that are the results of converting at build time .class or .jar files. These files when converted to .dex become a very efficient bytecode that can run on small processors.
Another part in runtime is core libraries(written in java). It contains all the collection classes, utilites, IO and all other similar classes that we come across while programming in java.


Linux kernel

The complete architecture is based on linux kernel which is the hardware abstraction layer. Linux provide a proven driver model, memory management, process management, security model, networking and other robust operating system features.











No comments:

Post a Comment