Android Components and Threading

As you have gathered by now from many of the previous chapters, an Android process has four primary components:

  • Activity
  • Service
  • ContentProvider (often referred as just a provider)
  • BroadcastReceiver (often referred as just a receiver)

Most code you write in an Android application is part of one of these components or called by one of these components. Each of these components gets its own XML node under an application node specification in the Android project manifest file. To recall, here are these nodes:

<application>      <activity/>      <service/>      <receiver/>      <provider/> </application>

With some exceptions (such as external process calls to content providers), Android uses the same thread to ...

Get Pro Android 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.