Building the orientation-aware layout
Android allows you to add multiple competing versions of resources to make an application compatible with different device configurations. The Android system comes handy when it comes to picking up the right resources for a given configuration. You don't need to write any code to find what is the current configuration and choose the appropriate resources. All you need to do is to add multiple versions of resources, such as string.xml
, .png
drawable images, or layout XML files, so that the best version of resource can be picked up under different circumstances.
Imagine that your app was primarily targeted to the U.S. market, but now we are looking forward to targeting Russia with the Russian language support. In this case, multiple versions of string.xml
can be added to support the Russian language. Or imagine that a user is running the app on a tablet in the portrait mode, and now the device rotates to the landscape orientation. The screen width gets...