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.
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>
This resource ID identifies the app's name and is referenced from the app's manifest,
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" />