Friday, August 10, 2012

Android Architecture For System Application Software Stack


Android Software Stack & Native Application Architecture

NATIVE Android  APPLICATIONS 

Before diving into the Android architecture we begin with the native application then we will explore the Android architecture which called Android software stack . Android devices typically come with a suite of preinstalled applications like :- 
- An e-mail client
- An SMS management application
- A full PIM (personal information management) suite, including a calendar and contacts list
- A WebKit-based web browser
- A music player and picture gallery
- A camera and video recording application
- A calculator
- A home screen
- An alarm clock
Android devices also ship with the following proprietary Google mobile applications:
- The Google Play Store for downloading  third-party Android applications
- ‹A fully featured mobile Google Maps application, including Street View, driving directions, and turn-by-turn navigation, satellite views, and traffic conditions
- The Gmail email client
- The Google Talk instant-messaging client
- The YouTube video player
OEMs company can customize the user interface and the applications bundled with each Android device. Several OEMs have done this, including HTC with Sense, Motorola with MotoBlur, and Samsung with TouchWiz.
The look and feel of the user interface may vary, but your applications will function in the same way across all compatible Android devices.

Android Software Stack

The Android software stack is, put simply, a Linux kernel and a collection of C/C++ libraries exposed through an application framework that provides services for, and management of, the run time and applications. The Android software stack is composed of the elements shown in Figure .

Android architecture for system application - software stack
Android architecture 
Linux kernel — Core services (including hardware drivers, process and memory management, security, network, and power management) are handled by a Linux 2.6 kernel. 
The kernel also provides an abstraction layer between the hardware and the remainder of the android architecture stack.
  ‹ Libraries — Running on top of the kernel, Android includes various C/C++ core libraries such as libc and SSL, as well as the following:
- A media library for playback of audio and video media
- A surface manager to provide display management
  ‹ Graphics libraries that include SGL and OpenGL for 2D and 3D graphics
  ‹ SQLite for native database support
  ‹ SSL and WebKit for integrated web browser and Internet security
  ‹ Android run time — The run time is what makes an Android phone an Android phone rather than a mobile Linux implementation. Including the core libraries and the Dalvik VM, the Android run time is the engine that powers your applications and, along with the libraries, forms the basis for the application framework.
  ‹ Core libraries — Although most Android application development is written using the Java language, Dalvik is not a Java VM. The core Android libraries provide most of the functionality available in the core Java libraries, as well as the Android-specific libraries.
  ‹ Dalvik VM — Dalvik is a register-based Virtual Machine that’s been optimized to ensure that a device can run multiple instances efficiently. It relies on the Linux kernel for threading and low-level memory management.
  ‹ Application framework — The application framework provides the classes used to create Android applications. It also provides a generic abstraction for hardware access and manages the user interface and application resources.
  ‹ Application layer —  All applications, both native and third-party, are built on the application layer by means of the same API libraries. The application layer runs within the Android run time, using the classes and services made available from the application framework.

The Dalvik Virtual Machine

One of the key elements of  android architecture  is the Dalvik VM. Rather than using a traditional Java VM such as Java ME, Android uses its own custom VM designed to ensure that multiple instances run efficiently on a single device.
The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality, including security, threading, and process and memory management. It’s also possible to write C/C++  applications that run closer to the underlying Linux OS. Although you can  do this, in most cases there’s no reason you should need to.
If the speed and efficiency of C/C++ is required for your application, Android provides a native development kit (NDK). The NDK is designed to enable you to create C++ libraries using the libc and libm libraries, along with native access to OpenGL. (but This Blog focuses exclusively on writing applications that run within Dalvik using the SDK; NDK development is not within the scope of this blog. If your inclinations run toward NDK development, exploring the Linux kernel  and C/C++ underbelly of Android, modifying Dalvik, or otherwise tinkering with things under the hood, check out the Android Internals Google Group .)

All Android hardware and system service access is managed using Dalvik as a middle tier. By using  a VM to host application execution, developers have an abstraction layer that ensures they should never have to worry about a particular hardware implementation.
The Dalvik VM executes Dalvik executable files, a format optimized to ensure minimal memory footprint. You create  .dex executables by transforming Java language compiled classes using the tools supplied within the SDK.
-   The android system uses a special virtual machine, Dalvik Virtual Machine to run Java based applications. 
- Dalvik uses an own bytecode format which is different from Java bytecode.
- You cannot directly run Java class files on Android, they need to get converted in the Dalvik bytecode format.

Android Application Architecture

we discuses  android application architecture  with more details in the following article : 

Android Libraries

Android architecture offers a number of APIs for developing your applications. Rather than list them all here, check out the documentation , which gives a complete list of packages included in the Android SDK.
Android and android architecture is intended to target a wide range of mobile hardware, so be aware that the suitability and implementation of some of the advanced or optional APIs may vary depending on the host device.

No comments:

Post a Comment