Saturday, May 2, 2015

Android Components:

What is Android?

Android is a Software stack for mobile devices which includes an operating system,middle-ware and key applications.

Android operating system is Linux based Operating system.

Android SDK provides the tool and API to start developing android applications in Java programming language.

Android offers its own java virtual machine called Dalvik Virtual Machine. Dalvik VM is optimized JVM to run compiled java class files in order to counter the handled device limitations such as memory, processor speed and power.

Android Components are the main part of android application. Each components has a different point through which system can enter your app. Each components plays a specific role.

There are four main android components. Each plays different role and have different life cycle. The four main android components are as below.

1) Activities : The building block of user interface is the activity. While it is possible for the activities do not have user interface. Each activity is independent even they work together. Each activity is implemented as derived class of Activity Class. An application may have many activities but out of many activities one activity is marked as first one that should be presented when application starts. One activity invoke another activity.

2) Services : The services dose not have an user interface, but rather runs in background for an indefinite period of time. Each service extends the Service main class. For example services might play music in background as the user attends to other matter or fetch data from network and make them available to activities. Like the other components services runs  in the main thread of application process.

3) Broadcast Receivers : Broadcast receiver is a components that receives and react to broadcast announcement. Any application can also initiate broadcast- for example, to let the other application know that some data is downloaded to device and is available for them to use. All receivers extend the BroadcastReceiver base class. Broadcast receivers do not display user interface. However they may start an activity in response to information they receive.

4) Content Provider : The content provider makes a specific set of applications data available to other applications. The data can be stored in SQLite database file. The content provider shares data between applications. The content provider extends the ContentProvider base class to implement standard set of methods that enable the other application to retrieve and store data. Application call content provider methods by creating object of ContentResolver. A ContentResolver can talk to any content provider, it cooperate with the provider to manage any inter-process communication that involved.

So these are fundamental components of android. We will see how to activate these components using intent in next article..

Thanks for reading the article. Please give your valuable feedback.



Post a Comment