Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The Android operating system keeps track of the current configuration of the device it's running on. Configuration includes lots of factors, and new ones get added all the time. For example, if a device is plugged into a docking station, that represents a change in the device configuration. When a configuration change is detected by Android, callbacks are invoked in running applications to tell them a change is occurring, so an application can properly respond to the change. We'll discuss those callbacks a little later, but for now let's refresh your memory with regard to resources.
One of the great features of Android is that resources get selected for your activity based on the current configuration of the device. You don't need to write code to figure out which configuration is active; you just access resources by name, and Android gets the appropriate resources for you. If the device is in portrait mode and your application requests a layout, you get the portrait layout. If the device is in landscape mode, you get the landscape layout. The code just requests a layout without specifying which one it should get. This is powerful because as new configuration factors get introduced, or new values for configuration factors, the code stays the same. All a developer needs to do is decide if new resources need to be creat....