App Components
Activities,Services,Content providers,Broadcast receivers
Activities, services, and content providers that you include in your source but do not declarein the manifest are not visible to the system and, consequently, can never run. However,broadcastreceivers can be either declared in the manifest or created dynamically in code (asBroadcastReceiver
objects) and registered with the system by callingregisterReceiver()
.
An implicit intentsimply describes the type of action to perform (and, optionally, the data upon which you’d like toperform the action) and allows the system to find a component on the device that can perform theaction and start it. If there are multiple components that can perform the action described by theintent, then the user selects which one to use.
Android supports many different qualifiers for your alternative resources. Thequalifier is a short string that you include in the name of your resource directories in order todefine the device configuration for which those resources should be used. As anotherexample, you should often create different layouts for your activities, depending on thedevice's screen orientation and size. For example, when the device screen is in portraitorientation (tall), you might want a layout with buttons to be vertical, but when the screen is inlandscape orientation (wide), the buttons should be aligned horizontally. To change the layoutdepending on the orientation, you can define two different layouts and apply the appropriatequalifier to each layout's directory name. Then, the system automatically applies the appropriatelayout depending on the current device orientation.