VIVEK SHAH

011011010010000001100001011001000110010001101001011000110111010001100101011001000010000001110100011011110010000001101010011000010111011001100001 Click Here

Custom Search

ANDROID ARCHITECTURE






















An Android system is a stack of software components. At the bottom of the stack is Linux – Linux 2.6 with approximately 115 patches. This provides basic system functionality like process and memory management and security. 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.


On top of Linux is a set of libraries including bionic (the Google libc), media support for audio and video, graphics and a lightweight database, which is a useful repository for storage and sharing of application data.


A key component of an Android system is the runtime – the Dalvik VM. This is not strictly a Java virtual
machine. It was designed specifically for Android and is optimized in two key ways. 
1. It is designed to be instantiated multiple times – each application has its own private copy running in a Linux process. 
2. It is also designed to be very memory efficient, being register based (instead of being stack based like most Java VMs) and using its own bytecode implementation. 

The Dalvik VM makes full use of Linux for memory management and multi-threading, which is intrinsic in the Java language.

The Application Framework provides many higher-level services to applications in the form of Java classes.
This will vary in its facilities from one implementation to another.

A key Android capability is the sharing of functionality. Every application can export functionality for use by
other applications in the system, thus promoting straightforward software re-use and a consistent user experience.

At the top of the Android software stack are applications. A number are supplied as standard. As mentioned,
each application may also expose some of its functionality for use by others. For example, the message sending
capability of the SMS application can be used by another application to send text messages.


APPLICATION DEVELOPMENT

1. DEVELOPMENT ENVIRONMENT

The standard Android development environment from Google is, as you might expect, Eclipse based, using a
plug-in to provide the necessary facilities. You need to define your target configuration by specifying an Android
Virtual Device. You can then execute code on either the host-based emulator or a real device, which is normally
connected via USB.

This environment only supports Android development on ARM-based target devices. Recently, however,
Mentor Graphics and others have ported Android to other processor architectures like MIPS.

2. PROGRAMMING MODEL

An Android application consists of a number of resources which are bundled into an archive – an Android
package. 

Programs are generally written in Java, built using the standard Java tools, and then the output file
is processed to generate specific code for the Dalvik VM. 

Each application runs in its own Linux process – 
an instantiation of the Dalvik VM – which protects its code and data from other applications. Of course, there are 
mechanisms for applications to transfer, exchange, and share data.



An application is a set of components which are instantiated and run as required. There is not really an
entry point or main() function

There are four types of application component: activities, services, broadcast receivers, and content providers.

Activity is the basic building block of every visible android application. It provides the means to render a UI. Every screen in an application is an activity by itself. Though they work together to present an application sequence, each activity is an independent entity. it is is a functional unit of the application, which may be invoked by another activity.
Service is another building block of android applications which does not provide a UI. It is a program that can run in the background for an indefinite period. it is is similar to an activity, except that it runs in the background without a GUI. 
An example of a 
service might be a media player that plays music while the user performs other tasks.
Broadcast Receiver i
simply respond to broadcast messages from other applications or from the system. 
For example, it may be useful for the application to know when a picture has been taken. This is the kind 
of event that may result in a broadcast message.
Content Providers 
supplies data from one application to others on request. Such requests are handled by 
the methods of the ContentResolver class. The data may be stored in the file system, the database or 
somewhere else entirely.
When you develop an Android application, you need to describe it to the system and this is achieved by means 
of a manifest file. This is an XML file called AndroidManifest.xml which is stored in the root folder of 
the application’s file system. 
This outline example of a manifest file includes the definition of a single activity called MyActivity:
                
                        
                        
                         . . .
                



The means of communication between the above mentioned components is through 
1. Intents
2. Intent Filters

When an Android application wishes to obtain some functionality from another application or from the system, 
it can issue an Intent
This is an asynchronous message that is used to activate an activity, service, or broadcast 
receiver. For an activity or service, the specific action and location of data is included.



0 comments:

Post a Comment