Showing posts with label Android Project Structure. Show all posts
Showing posts with label Android Project Structure. Show all posts

Thursday, August 12, 2010

Android #2: Understanding Android Architecture & Project Structure

Android Architecture:

Design goal of Android is openness with greater flexibility, and enabling rapid development. Each layer in Android architecture uses languages like Java for application development with the underlying framework on Java as well that in turn makes use of C/C++ libraries and runs upon the C based operating system and drivers.



Platform Architecture:
  • Applications: Basic applications include an email client, SMS program, calendar, maps, browser, contacts, etc.,. All applications are written in Java programming language
  • Application Framework: Developers have full access to the same framework APIs used by applications base. The architecture is designed to simplify the reuse of components, any application can publish its capabilities and any other application can then make use of those capabilities (subject to safety rules framework). This same mechanism allows components to be replaced by the user. Thus it provides no limit to the applications being developed.
  • Libraries: Android includes a set of libraries C / C++ used by various components of the Android system. These features are exposed to developers through the Android application framework, some of them includes a System C library (C standard library implementation), media libraries, graphics libraries, 3d support through Open GL, SQLite embedded database etc.,
  • Runtime Android: Android includes a set of base libraries that provide most of the features available in the libraries of the Java language base. Every Android application runs its own process, with its own instance of the Dalvik Virtual Machine (DVM)
  • Kernel – Linux: Android depends on Linux version 2.6 for basic services such as security system, memory management, process management, network stack and driver model. The kernel also acts as an abstraction layer between hardware and the rest of the software stack

Application Architecture:

As said earlier, Android platform is typically based upon Linux Kernel. Android applications are written in Java but they don’t run on standard Java Virtual Machine (JVM) instead runs on a special Java based virtual machine called the Dalvik Virtual Machine (DVM) which is again an open source technology (Apache harmony) running within a Linux Kernel process. JVM is stack based VM and DVM is register based VM. So just like how Java byte codes are executed by the JVM, here classes are converted into Dalvik Executables (.dex) using DX tool. Dalvik has been written so that a device can run multiple VMs efficiently. Dalvik executes files in the Dalvik Executable which is optimized for minimum memory.

A Typical Android Project Structure:

Below table provides a view of how a typical android project will look like



Reference Links: