Thursday, 22 August 2013

Android Architecture and Fundamentals of Android OS

Today I am going to explain a very basic and important concept of android that every developer must be known before starting a journey in android.
This show all core concept that how we perform basic function such as sending a text message, changing the system settings, install or uninstall apps,sending a msg,and all s/w and h/w uses etc.

Android Graphical View of Architecture


Android OS Basic:  

Android operating system is a stack of software components which is roughly divided into five sections and four main layers as shown above in the architecture graph.

Android is designed primarily for touchscreen mobile devices such as smart-phones and tablet computer's etc.Initially developed by Android, Inc., which Google backed financially and later bought in 2005.Android is open source and Google releases the code under Apache This open-source code and permissive licensing allows the software to be freely modified and distributed by device manufacturers, wireless carriers and enthusiast developers.                                   

Linux kernel : 
 The bottom of the layers is Linux - Linux 2.6 with approximately 115 patches. This provides basic system functionality like process management, memory management, device management like camera, keypad, display etc. Also, the kernel handles all the things that Linux is really good at such as networking and a vast array of device drivers, which take the pain out of interfacing to peripheral hardware.The Linux kernel also  acts as an abstraction layer between the hardware and other software made the porting of Android to variety of hardware, a relatively painless task.


At the next level from bottom there is a set of libraries including open-source Web browser engine WebKit, well known library libc, SQLite database which is a useful repository for storage and sharing of application data, libraries to play and record audio and video, SSL libraries responsible for Internet security etc.

 Overview of some important libraries

 Surface Manager: It is used for compositing window manager with off-screen buffering. Off-screen buffering means you cant directly draw into the screen, but your drawings go to the off-screen buffer. There it is combined with other drawings and form the final screen the user will see. This off screen buffer is the reason behind the transparency of windows.

Media framework: android media framework is built on top of a set of media libraries, including OpenCore, vorbis and sonivox. So one of goal of android media framework is to provide a consistent interface for all services provided by underlying libraries and make them transparent to users.Also Media framework provides different media codecs allowing the recording and playback of different media formats.

SQLite: SQLite is the database engine used in android for data storage and also SQLite Database has methods to create, delete, execute SQL commands, and perform other common database management tasks.

WebKit: It is the browser engine used to display HTML content.

OpenGL: OpenGL is a cross-platform graphics API that specifies a standard software interface for 3D graphics processing hardware. It is used to render 2D or 3D graphics content to the screen

 SSL: It stand for Secure Socket Layer basically used for transport layer Security for encrypted communications between clients and servers.

 Android Runtime: It allows Java applications to interface with the environment in which they are running.Android Runtime consists of Dalvik Virtual machine and Core Java libraries.

 Dalvik Virtual Machine: Dalvik is open source software,It is a type of JVM used in android devices to run apps and is optimized for low processing power and low memory environments. Unlike the JVM, the Dalvik Virtual Machine doesn’t run .class files, instead it runs .dex files. .dex files are built from .class file at the time of compilation and provides hifger efficiency in low resource environments. The Dalvik VM allows multiple instance of Virtual machine to be created simultaneously providing security, isolation, memory management and threading support.It was originally written by Dan Bernstein, who named it after the fishing village of Dalvik in Iceland,where some of his ancestors lived.

Core Java Libraries:All these are different from Java SE and Java ME libraries. However these libraries provides most of the functionalities defined in the Java SE libraries.

Application Framework:These are the blocks that our applications directly interacts with. These programs manage the basic functions of phone like resource management, voice call management etc.
All the Activities and Services of an application run in a single process.

Components of Application Framework

 Activity Manager: AM Interact with the overall activities running in the system.Also manages the activity life cycle of applications.

Content Providers: CM are the standard interface that connects data in one process with code running in another process,Content providers manage access to a structured set of data. They encapsulate the data, and provide mechanisms for defining data security.Basically it manage the data sharing between applications.

Resource Manager: RM Manages the various types of resources we use in our Application.

Telephony Manager: TM provides access to information about the telephony services on the device. Applications can use the methods in this class to determine telephony services and states, as well as to access some types of subscriber information. Applications can also register a listener to receive notification of telephony state changes.Keep this in mind that access to some telephony information is permission-protected. Your application cannot access the protected information unless it has the appropriate permissions declared in its manifest file.

Location Manager: LM provides access to the system location services. These services allow applications to obtain periodic updates of the device's geographical location, or to fire an application-specified Intent the device enters the proximity of a given geographical location.

Applications: Applications are the top layer in the Android architecture and this is where our applications are well fit.
Android applications are written in the Java programming language. The Android SDK tools compile the code—along with any data and resource files—into an Android package, an archive file with an .apk file extension.





Please Share this tutorial On:


1 comment:

  1. Thanks for contributing your knowledge here, I need help on json parsing.....pls send me sample code.