Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

7.3. Technologies Overview

This section presents the many new technologies that we use in the Cannon Game app in the order they’re encountered throughout the chapter.

Defining String Formatting Resources in strings.xml

In this app, we define String resources to represent the format Strings that are used in calls to class Resource’s method getString (or to class String’s static method format). When format Strings contain multiple format specifiers, you’re required to number them (from 1) to indicate the order in which the corresponding values will be substituted into the format String. In some spoken languages, a String’s phrasing might result in the values being placed at different locations in the localized String resources. In such cases, the localized versions of strings.xml can use the original format-specifier numbers, but place the format specifiers at appropriate locations in the localized Strings. The syntax for numbering format specifiers is shown in Section 7.4.3.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial