Java Reference
In-Depth Information
The Button element's text attributeisassigned @string/wave ,whichreferen-
cesastringresourcenamed wave .ThisstringresourceisstoredinanXMLfilenamed
strings.xml , which is stored in the values subdirectory of res .
Listing 12-5 describes the contents of strings.xml .
Listing 12-5. The strings.xml file storing the app's strings
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Java7MeetsAndroid</string>
<string name="wave">Wave</string>
</resources>
As well as wave , Listing 12-5 reveals a string resource identified as app_name .
This resource ID identifies the app's name and is referenced from the app's manifest,
typicallyfromthe label attributeofthe application elementstarttag(see Listing
12-2 ) .
Listing 12-6 presents duke_wave.xml .
Listing 12-6. The duke_wave.xml file storing the app's animation list of drawable items
<animation-list xmlns:android="http://schemas.android.com/
apk/res/android"
android:oneshot="true">
<item
android:drawable="@drawable/duke0"
an-
droid:duration="100" />
<item
android:drawable="@drawable/duke1"
an-
droid:duration="100" />
<item
android:drawable="@drawable/duke2"
an-
droid:duration="100" />
<item
android:drawable="@drawable/duke3"
an-
droid:duration="100" />
<item
android:drawable="@drawable/duke4"
an-
droid:duration="100" />
<item
android:drawable="@drawable/duke5"
an-
droid:duration="100" />
<item
android:drawable="@drawable/duke6"
an-
droid:duration="100" />
Search WWH ::




Custom Search