PendingIntent, BroadcastReceiver, IBinder, what are the practices for?



  • PendingIntentBroadcastReceiverIBinder All of this is used to communicate activities and services, in some of the functionalities, these things allow for the same tasks, and in some cases, what are they chosen for?

    Let's say there's a specific example. ForegroundService and he sends messages. ActivityI need messages. Activity Even after it was removed and rebooted.



  • Intent is a "communication" that sends your app somewhere on the air without an exact addressee, but with its unique name. He'll be received by everyone in the system who's signed for messages with a name like that.
    PendingIntent is different from Intent by allowing the recipient to act with the rights of the annex that sent the intent. The normal intent is fulfilled with the rights of the acceptance application.

    BroadcastReceiver is the receiver of an intimate message sent by someone. They're signing up for the ether audition and intercepting the interesting "communications" of their names.

    Two of these tools work in a couple. It is not hard to see that this pattern does not have a clear connection between the sender and the receiver, to get and intercept the message, any application in the system. The connection is open and completely untouched, the receiver and the recipient know nothing about each other except the name of the Intent.

    IBinder is the feedback interface for service and applications. There is an absolute closed link between the different parts of the same programme, the data sent through the interface will be obtained only where the reverse challenge method is located (in the case of an interface).onBind()(c) Improperly implemented on the controlling side of the interface. These parts are hard and can't work alone without another.

    If the intenses are sent, the reciver, signed, will operate under the annex (activities) unavailable at this time, provided that the annex is signed through the manifest, the activists will be activated accordingly.

    PS: When you write "after his removal," you mean that the activists are not launched at this point? If the annex signed on the intent was deinstalled (how do you know how to put it away), it's naturally not re-established to accept the sentient, he's just going to go nowhere if he doesn't have any other subscriptions.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2