Sunday, July 22, 2012

Android inter-/intra-process communication


Android offers a unique collection of mechanisms for inter- (and intra-) application
communication. This chapter discusses the following:

Intents
Specify what you intend to do next: either to invoke a particular class within your
application, or to invoke whatever application the user has configured to process
a particular request on a particular type of data
Broadcast receivers
In conjunction with intent filters, allow you to define an application as able to
process a particular request on a particular type of data (i.e., the target of an intent)
AsyncTask
Allows you to specify long-running code that should not be on the “GUI thread”
or “main event thread” to avoid slowing the app to the point that it gets ANR
(“Application Not Responding”) errors
Handlers
Allow you to queue up messages from a background thread to be handled by an-
other thread such as the main activity thread, usually to cause information to up-
date the screen safely

No comments: