android broadcast recievers pdf by apk855


More Info
									                        Broad Cast

BROADCAST RECIEVERS-1         Copyright © 2012, All rights reserved
    • A broadcast receiver is a component that responds to
      system-wide broadcast announcements.
    • Many broadcasts originate from the system
    • For Example:
          The screen is turned off.
          The battery is low.
          A picture is captured.
    • Applications can also initiate the broadcasts.
    • For Example:
          Let other applications know that some data has been
           downloaded to the device and is available to use.
    • Like services , broadcast receivers don’t display a user
    • They may create a status bar notification to alert the user
      when a broadcast event occurs.

BROADCAST RECIEVERS-2                   Copyright © 2012, All rights reserved
    • A broad cast receiver is implemented as a subclass of
    • Each broad cast is delivers as an Intent object.
    • To create a user defined BroadcastReceiver , our class
      must extedns for BroadcastReceiver class of
    • For Example:
         Class MyReciever extends BroadcastReceiver{
    • We need to override the following method.
      public void onReceive(Context context,Intent intent)
    • We need to configure this BroadcastReceiver in .xml file
      by using the following tag.
         <receiver android:name="MyPhoneReceiver">
         <action android:name="android.intent.action.PHONE_STATE">
BROADCAST RECIEVERS-3                          Copyright © 2012, All rights reserved

To top