27-08-2014, 02:49 PM
Android Application development is used as the preface in this project.The Android Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. The Android Architecture has four layers namely Application Layer, Application Framework, Library , Linux kernel. The common language runtime is the foundation of the Android. You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting , while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness. In fact, the concept of code management is a fundamental principle of the runtime. Code that targets the runtime is known as managed code, while code that does not target the runtime is known as unmanaged code. The class library, the other main component of the .Android, is a open source and linux based operating system for mobile devices such as mobile phones and tablets. Android offer a simple approach for application developme
Chapter 1 –PROJECT INTRODUCTION
1.1 Introduction toAndroid
Android is a software stack for mobile device that includes an operating system, middleware and applications. Android is powered by Linux kernel, initially developed by Google and later the Open Handset Alliance. It allows developers to write managed code in java language, controlling the device via Google developed java library. Not like other famous rivals such as Microsoft window mobile or Symbian OS, android use developed java library because java is not just a programming language; it.s a complete dynamic platform offers powerful support for embedded devices that must maintain some form of dynamic behavior. Moreover, java runtime environment can be integrated into almost any embedded device while java virtual machine includes interfaces that allow it to be readily integrated with RTOS and other native library. The RTOS supports multi-thread (scheduling), memory management, net working,and peripheral management for java VM.
Android is basically an operating system for smartphones. But we find now integrated into PDAs,touch pads or televisions, even cars (trip computer) or netbooks. The OS was created by the start-up of the same name, which is owned by Google since 2005 .
ØAndroid architecture
This operating system is based on version 2.6 of Linux, so it has a monolithic system kernel, which means that all system functions and drivers are grouped into one block of code.
The below figure shows the diagram of Android architecture. Android OS is basically a software stack with various layers with each layer offering different services to the layer above it. The layers include a Linux Kernel which is responsible for interaction with the hardware. Libraries are written in C or C++ and are specific to the hardware of the system.
FIGURE 1.1.1-ARCHITECTURE OF JAVA
Android Runtime consists of Dalvik Virtual machine and Core Java libraries responsible for running the applications.
ØAndroid layers:
-Android consist of five layers.
-The Linux kernel 2.6-which includes useful drivers that allow for example WiFi or Bluetooth.
FIGURE 1.1.2-ANDROID OPERATING SYSTEM
-The library written in C and C + + that provide higher level functionality such as an HTML engine, or adatabase (SQLite).
-A runtime environment for applications based on a virtual machine, made for inefficient machines such astelephones. The aim is to translate JAVA in machine language understood by Android.
-A JAVA framework that allows applications running on the virtual machine to organize and cooperate.
-The user applications written in Java.
ØApplication layer: Android provides a lot of applications which come with its release including an email client, SMS program, calendar, maps, browser, contacts, and others. All applications are written using the Java programming language. Moreover, the number of developers who interested in developing Android.s application is increasing and provides a huge market of application to chose.
An application framework layer:enabling reuse and replacement of components. Not like Window mobile which restricts developer from system API, developers have full access to the same framework APIs used by the core.s applications. The strength points of Android is that the application architecture is designed for reusing of components which means any application can publish its capabilities and any other application may the make use of those capabilities base on the definition of Intent which will be described later. Android provide a set of services and system, including:
Views: is a flexible definition. It can be a list, a grid, text box, button or even an embedded web browser. View in Android is very different from the definition of “view” in Symbian OS or Window mobile which often means the container in which graphic components are organized and displayed to user.
Content provider: store and retrieve data and make it accessible to all applications. They.re the only way to share data across applications; there.s no common storage area that all Android packages can access.
Resource manager: Resources are external files (that is, non-code files such as image, icon, and string for internationalization) that are used by developer.s code and compiled into their application at build time. Android supports a number of different kinds of resource files, including XML, PNG, and JPEG files. The XML files have very different formats depending on what they describe. Resources are externalized from source code, and XML files are compiled into a binary, fast loading format for efficiency reasons. Strings likewise are compressed into a more efficient storage form. All resource has its own id and will be added to special interface file R.java automatically.
Figure 1.1.3-Resource management
Notification manager that enables all application to display custom alerts in the status bar notify user of what happen in the back ground.
Activity manager: manages the lifecycle of application and provide common navigation back stack. An activity focuses on what user can do by interact with user. Activity will for example create a window and place UI component to be displayed to user. There are two important methods which are implemented by most subclass is:
OnCreate(Bundle) : where we initialize our activity, setup layout or get handle of each UI defined components.
OnPause(): where we deal with the event when user leaving our activity.
Libraries: They are all written in C/C++ internally, but you.ll be calling them through Java interfaces. These capabilities are exposed to developers through the Android application framework. Some of core libraries are:
System C library - a BSD-derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices.
Media Libraries - based on PacketVideo.s OpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG .
Surface Manager - manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications.
LibWebCore - a modern web browser engine which powers both the Android browser and an embeddable web view.
SGL - the underlying 2D graphics engine.
3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer.
FreeType - bitmap and vector font rendering.
SQLite - a powerful and lightweight relational database engine available to all applications.
Android Runtime: A set of core libraries provides most the functionality available in the core library of java programming language. Android runtime includes the Dalvik Virtual Machine. Dalvik runs dex files, which are coverted at compile time from standard class and jar files. Dex files are more compact and efficient than class files, an important consideration for the limited memory and battery powered devices that Android targets. The core Java libraries are also part of the Android runtime. They are written in Java, as is everything above this layer. Here, Android provides a substantial set of the Java 5 Standard Edition packages, including Collections, I/O, and so forth.
Dalvik Virtual Machine:which is optimized for mobile devices. Dalvik is a major piece of Google.s Android, runs Java platform applications which have been converted into a compact Dalvik Excutable format suitable for systems that are constrained in terms of memory and processor speed. Unlike most virtual machines an true java virtual machine which are stack machines, Dalvik VM is a register based architecture. Like the CISC vs. RISC debate, the relative merits of these two approaches is a subject of continuous argument but the underlying technology sometimes blurs the ideological boundaries. Moreover, the relative advantages of the two approaches depend on the interpretation/compilation strategy chosen. Generally, however, stack based machines must use instructions to load data on the stack and manipulate that data and thus require more instructions than register machines to implement the same high level code. However, the instructions in a register machine must encode the source and destination registers and therefore tend to be larger. This difference is primarily of importance to VM interpreters for whom opcode dispatch tends to be expensive and other factors are relevant for JIT compilation. Being optimized for low memory requirements, Dalvik VM use less space, has no JIT compiler and uses its own byte code, not java byte code.
Linux Kernel: Starting at the bottom is the Linux kernel. Android uses it for its device drivers, memory management, process management and networking. How ever we will never be programming to this layer directly. Android relies on Linux kernel version 2.6 for core system services. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.
One of the unique and powerful qualities of Android is that all applications have a level playing field which means that the applications Google writes have to go through the same public API that we use. We can even tell Android to make our application replace the standard applications.
Ø Why Android is better ?
• Applications
Google applications
Android includes most of the time many Google applications like Gmail, YouTube or Maps.
These applications are delivered with the machine most of the time, except in certain cases, such as somephones running android on which the provider has replaced Google applications by its own applications.
Widgets
With android, it is possible to use widgets which are small tools that can most often get
information. These widgets are directly visible on the main window.
Android Market
This is an online software store to buy applications. Developers who created applicationscan add them into the store, and these applications can be downloaded by users, they can be both free andpaid.
Multitasking
Android allows multitasking in the sense that multiple applications can run simultaneously.
With Task Manager it is possible view all running tasks and to switch from one to another easily.
Figure 1.1.4-Android Market Share
SDK
A development kit has been put at disposal of everybody. Accordingly, any developer can create their own applications, or change the android platform. This kit contains a set of libraries, powerfultools for debugging and development, a phone emulator, thorough documentation, FAQs and tutorials.
Modifiability
This allows everyone to use, improve or transform the functions of Android for example transformthe interface in function of uses , to transform the platform in a real system embedded Linux.
User Interface
Android operating system provides a beautiful user interface to the application .
Connectivity Android supports connectivity with different devices like Bluetooth,Wifi,Y-max.
Messaging Android also supports messaging service like SMS,MMS.
-Android support web-view application.It has web layout engine coupled with chrome,javascript engine supporting HTML-5 and CSS-3.
-Android supports database storage (store data in the form of tables).We can store data in the android with the help of SQL-Lite.It is a database which supports DDL and DML queries.It is a light-weight database.