Building Blocks of Android Applications

There are four building blocks to an Android application:
• Activity
• Intent Receiver
• Service
• Content Provider

Its of course not necessary each application need all these 4 block but some how some of these will be followed
The XML file AndroidManifest.xml contains all components to be used in the application. All the componets need to declare here before used.

Activity:
Each function or activity that happens in a screen of the application is party of activity.
All the Android class extends a base class Activity. In screens we see are Activity class

Intent and Intent Filters:

Android uses a special class called an Intent to move from screen to screen. An intent describes what an application wants.
There is a related class called an IntentFilter. While an intent is effectively a request to do something, an intent filter is a description of what intents an activity (or intent receiver, see below) is capable of handling.

Intent Receiver:
It’s a some kind of background process. IntentReceiver to receive the data from external events.

Content Provider:
Applications can store their data in files, an SQLite database, or any other mechanism that makes sense. A content provider, however, is useful if we want our application's data to be shared with other applications. A content provider is a class that implements a standard set of methods to let other applications store and retrieve the type of data that is handled by that content provider.

Life Cycle of Android Activity: Life cycle methods sequence are
  1. onCreate()
  2. onStart()
  3. onResume()
  4. onFreeze()
  5. onPause()
  6. onStop()
  7. onDestroy()


Ref:
http://www.anddev.org/lifecycle_of_an_activity-t81.html

0 comments:

Post a Comment