Testing Alternative Resources

It is important to test your app on different device configurations to see how your layouts and other resources look on those configurations. You can test on both real and virtual devices. You can also use the graphical layout tool.

The graphical layout tool has many options for previewing how a layout will appear in different configurations. You can preview the layout on different screen sizes, device types, API levels, languages, and more.

To see these options, open res/layout/fragment_crime.xml in the graphical layout tool. Then try some of the settings in the toolbar shown in Figure 17.11.

Figure 17.11  Using the graphical layout tool to preview various device configurations

Using the graphical layout tool to preview various device configurations

You can see all of your default resources in action by setting a device or emulator to a language that you have not localized any resources for. Run your app and put it through its paces. Visit all of the views and rotate them.

Before continuing to the next chapter, you may want to change your device’s language back to English.

Congratulations! Now your CriminalIntent app can be enjoyed fully in both Spanish and English. Crimes will be logged. Cases will be solved. And all in the comfort of your user’s native language (so long as that is either Spanish or English). And adding support for more languages is simply a matter of including additional qualified strings files.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
107.23.156.199