Successfully reported this slideshow.
AndroidComponents - Atul Palandurkar
Android ComponentsThere are 4 basic components of an AndroidApplication : Activity Service Broadcast Receiver Content ...
Activity An  Activity represents a single screen with UI. Activity class takes care of creating a window in  which UI ca...
ActivityLife Cyclehttp://aatul.me   - Atul Palandurkar
Activity Stack                   Start             Start               Navigate                 Activity 2        Activity...
ServiceA   Service is a component that runs in the  background to perform long-running operations or  to perform wok for ...
startService()Service                       Starts the serviceLife Cycle                  onStartCommand()                ...
Broadcast Receiver They    listen to broadcast intents. They must be registered (either in code or within the  AndroidMa...
Content Provider Content  providers are one of the primary building  blocks of Android applications, providing content  t...
Thank You     Atul Palandurkar          Blog : http://aatul.meTraining : training@shardainfotech.com  Website : http://sha...
Upcoming SlideShare
Loading in …5
×

Android Components

3,460 views

Published on

This is a small tutorial which explains about Android Components in brief.

Published in: Education
  • Be the first to comment

Android Components

  1. 1. AndroidComponents - Atul Palandurkar
  2. 2. Android ComponentsThere are 4 basic components of an AndroidApplication : Activity Service Broadcast Receiver Content Providerhttp://aatul.me - Atul Palandurkar
  3. 3. Activity An Activity represents a single screen with UI. Activity class takes care of creating a window in which UI can be placed with the method setContentView(View) While activities are often presented as full screen windows, they can also be used as floating windows or embedded inside another activity. The onCreate(Bundle) is where you initialize your activity. All activity classes must have a corresponding <activity> declaration in their package’s AndroidManifest.xmlhttp://aatul.me - Atul Palandurkar
  4. 4. ActivityLife Cyclehttp://aatul.me - Atul Palandurkar
  5. 5. Activity Stack Start Start Navigate Activity 2 Activity 3 back Foreground activity Activity 3 Activity 1 Activity 1 Activity 1 Activity 1 Activity 2 Activity 2 Activity 2 Back Stack Activity 3 Activity 3 destroyedhttp://aatul.me - Atul Palandurkar
  6. 6. ServiceA Service is a component that runs in the background to perform long-running operations or to perform wok for remote processes. Each service class must have a corresponding <service> declaration in its package’s AndroidManifest.xml A service does not provide user interface. Another component, such as an activity, can start the service and let it run or bind to it in order to interact with it.http://aatul.me - Atul Palandurkar
  7. 7. startService()Service Starts the serviceLife Cycle onStartCommand() Starts actual operation Context.bindService() Obtains data from persistent onStop() OR Context.stopService() Stops the service, ready to get destroyed onDestroy()http://aatul.me - Atul Palandurkar
  8. 8. Broadcast Receiver They listen to broadcast intents. They must be registered (either in code or within the AndroidManifest.xml). Intent Filters must be used to specify which Intents it is listening for. A broadcast receiver can be registered using multiple intent filters. The onReceive() method be overridden to perform any operations.http://aatul.me - Atul Palandurkar
  9. 9. Content Provider Content providers are one of the primary building blocks of Android applications, providing content to applications. They encapsulate data & provide it to applications through a single interface called ContentResolver. A content provider is only required if there us a need to share data between multiple applications. For example, the contacts data is used by multiple applications & must be stored in a content provider.http://aatul.me - Atul Palandurkar
  10. 10. Thank You Atul Palandurkar Blog : http://aatul.meTraining : training@shardainfotech.com Website : http://shardainfotech.com Contact : 091-9766210353

×