Android Programming The Big Nerd Ranch Guide, 3rd Edition
337 18. Localization Knowing CriminalIntent is going to be a wildly popular app, you have decided to make it accessible to a lar ...
Chapter 18 Localization 338 Localizing Resources Language settings are part of the device’s configuration. (See the section cal ...
Localizing Resources 339 Click OK. The new strings.xml file will be listed under res/values, with (es) after its name. The strin ...
Chapter 18 Localization 340 Now it is time to make the magic happen. Add Spanish versions of all your strings to res/values-es/ ...
Default resources 341 Default resources The configuration qualifier for English is -en. In a fit of localization, you might thin ...
Chapter 18 Localization 342 Run CriminalIntent on a device with the language set to English. The app displays the resource ID f ...
Default resources 343 mReportButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent i = new ...
Chapter 18 Localization 344 Screen density works differently The exception to providing default resources is for screen density ...
Targeting a region 345 Targeting a region You can qualify a resource directory with a language-plus-region qualifier that target ...
Chapter 18 Localization 346 Consider an example. Suppose you set the language on your device to Spanish and your region to Chil ...
Targeting a region 347 Testing custom locales Different devices and different versions of Android know about and support differe ...
Chapter 18 Localization 348 Configuration Qualifiers You have now seen and used several configuration qualifiers for providing ...
Prioritizing alternative resources 349 Prioritizing alternative resources Given the many types of configuration qualifiers for t ...
Chapter 18 Localization 350 Add a longer value for crime_title_hint to values-w600dp/strings.xml. Listing 18.4 Creating altern ...
Multiple qualifiers 351 Multiple qualifiers You may have noticed that the New Resource File dialog has many available qualifiers ...
Chapter 18 Localization 352 Finding the best-matching resources Let’s walk through how Android determined which version of crim ...
Testing Alternative Resources 353 Because there are multiple values still in the running, Android keeps stepping down the qualif ...
Chapter 18 Localization 354 Challenge: Localizing Dates You may have noticed that, regardless of the device’s locale, the dates ...
355 19. Accessibility In this chapter you will make CriminalIntent more accessible. An accessible app is usable by anyone, regar ...
Chapter 19 Accessibility 356 To enable TalkBack, launch Settings and press Accessibility. Press on TalkBack under the Services ...
«
14
15
16
17
18
19
20
21
22
23
»
Free download pdf