Unit 2 Android Developer Fundamentals V2 Google Developer Training Team PDF Download
Unit 2 Android Developer Fundamentals V2 Google Developer Training Team PDF Download
https://ebookbell.com/product/unit-2-android-developer-
fundamentals-v2-google-developer-training-team-36456458
https://ebookbell.com/product/android-developer-fundamentals-
version-2-course-unit-1-to-4-2nd-edition-google-developer-training-
team-36456820
https://ebookbell.com/product/b291-unit-2-the-open-university-32787988
https://ebookbell.com/product/biology-for-cape-unit-2-cxca-caribbean-
examinations-council-study-guide-revised-ed-fosbery-58075792
Aqa History As Unit 2 A New Roman Empire Mussolinis Italy 19221945 New
Chris Rowe
https://ebookbell.com/product/aqa-history-as-unit-2-a-new-roman-
empire-mussolinis-italy-19221945-new-chris-rowe-5210404
Edexcel Gce History As Unit 2 D2 Britain And The Nationalist Challenge
In India 190047 Unit 2 Rosemary Rees
https://ebookbell.com/product/edexcel-gce-history-as-
unit-2-d2-britain-and-the-nationalist-challenge-in-
india-190047-unit-2-rosemary-rees-5478728
https://ebookbell.com/product/incho-and-nsec-preparations-
unit-2-chemical-equilibrium-by-dr-praveen-kumar-arihant-conducted-by-
hbcse-homi-bhaba-center-for-science-education-dr-praveen-kumar-
arihant-7319170
https://ebookbell.com/product/ugc-psychology-paper-unit-210-1st-
edition-manah-kamalam-12301882
https://ebookbell.com/product/analog-and-digital-
electronics-3130907-darshan-unit2-to-6-darshan-institute-of-
engineering-technology-23267692
developer.android.com/courses/adfv2
Note: This course uses the terms "codelab" and "practical" interchangeably.
We advise you to use the online version of this course rather than
this static PDF to ensure you are using the latest content.
See developer.android.com/courses/adf-v2.
1
Android Developer Fundamentals Course (V2) – Unit 2
4.5 : RecyclerView
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 2
Android Developer Fundamentals Course (V2) – Unit 2
Introduction
The user interface (UI) that appears on a screen of an Android-powered device consists of a
hierarchy of objects called views. Every element of the screen is a View.
The View class represents the basic building block for all UI components. View is the base class for
classes that provide interactive UI components, such as Button elements. A Button is a UI element
the user can tap or click to perform an action.
You can turn any View, such as an ImageView, into a UI element that can be tapped or clicked. You
must store the image for the ImageView in the drawables folder of your project.
In this practical, you learn how to use images as elements that the user can tap or click.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 3
Android Developer Fundamentals Course (V2) – Unit 2
What you'll do
● Create a new Android Studio project for a mock dessert-ordering app that uses images as
interactive elements.
● Set onClick() handlers for the images to display different Toast messages.
● Change the floating action button supplied by the template so that it shows a different icon
and launches another Activity.
App overview
In this practical, you create and build a new app starting with the Basic Activity template that
imitates a dessert-ordering app. The user can tap an image to perform an action—in this case
display a Toast message—as shown in the figure below. The user can also tap a shopping-cart
button to proceed to the next Activity.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 4
Android Developer Fundamentals Course (V2) – Unit 2
2. Choose the Basic Activity template, and accept the default Activity name (MainActivity).
Make sure the Generate Layout file and Backwards Compatibility (AppCompat) options
are selected.
3. Click Finish.
The project opens with two layouts in the res > layout folder: activity_main.xml for the
app bar and floating action button (which you don't change in this task), and
content_main.xml for everything else in the layout.
4. Open content_main.xml and click the Design tab (if it is not already selected) to show the
layout editor.
5. Select the "Hello World" TextView in the layout and open the Attributes pane.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 5
Android Developer Fundamentals Course (V2) – Unit 2
ID textintro
textStyle B (bold)
textSize 24sp
This adds the android:id attribute to the TextView with the id set to textintro, changes
the text, makes the text bold, and sets a larger text size of 24sp.
7. Delete the constraint that stretches from the bottom of the textintro TextView to the
bottom of the layout, so that the TextView snaps to the top of the layout, and choose 8 (8dp)
for the top margin as shown below.
8. In a previous lesson you learned how to extract a string resource from a literal text string.
Click the Text tab to switch to XML code, and extract the "Droid Desserts" string in the
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 6
Android Developer Fundamentals Course (V2) – Unit 2
This step also introduces a new technique in the layout editor: using the Fix button in warning
messages to extract string resources.
2. Copy the image files into your project’s drawable folder. Find the drawable folder in a
project by using this path: project_name > app > src > main > res > drawable.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 7
Android Developer Fundamentals Course (V2) – Unit 2
6. In the Attributes pane, enter the following values for the attributes:
ID donut
7. Drag a second ImageView to the layout, choose the icecream_circle image for it, and
constrain it to the bottom of the first ImageView and to the left side of the layout with a
margin of 24 (24dp) for both constraints.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 8
Android Developer Fundamentals Course (V2) – Unit 2
8. In the Attributes pane, enter the following values for the attributes:
ID ice_cream
9. Drag a third ImageView to the layout, choose the froyo_circle image for it, and constrain it to
the bottom of the second ImageView and to the left side of the layout with a margin of 24
(24dp) for both constraints.
10. In the Attributes pane, enter the following values for the attributes:
ID froyo
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 9
Android Developer Fundamentals Course (V2) – Unit 2
11. Click the warning icon in the upper left corner of the layout editor to open the warning
pane, which should display warnings about hardcoded text:
12. Expand each Hardcoded text warning, scroll to the bottom of the warning message, and
click the Fix button as shown below:
The fix for each hardcoded text warning extracts the string resource for the string. The
Extract Resource dialog appears, and you can enter the name for the string resource. Enter
the following names for the string resources:
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 10
Android Developer Fundamentals Course (V2) – Unit 2
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 11
Android Developer Fundamentals Course (V2) – Unit 2
4. In the Attributes pane change the width in the inspector pane to Match Constraints:
5. In the Attributes pane, begin entering the string resource for the text field by prefacing it
with the @ symbol: @d. Click the string resource name (@string/donuts) which appears as a
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 12
Android Developer Fundamentals Course (V2) – Unit 2
suggestion:
6. Repeat the steps above to add a second TextView that is constrained to the right side and
top of the ice_cream ImageView, and its right side to the right side of the layout. Enter the
following in the Attributes pane:
ID ice_cream_description
layout_width match_constraint
text @string/ice_cream_sandwiches
7. Repeat the steps above to add a third TextView that is constrained to the right side and top
of the froyo ImageView, and its right side to the right side of the layout. Enter the following
in the Attributes pane:
ID froyo_description
layout_width match_constraint
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 13
Android Developer Fundamentals Course (V2) – Unit 2
text @string/froyo
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 14
Android Developer Fundamentals Course (V2) – Unit 2
<TextView
android:id="@+id/textintro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_regular"
android:text="@string/intro_text"
android:textSize="@dimen/text_heading"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/donut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_wide"
android:layout_marginTop="@dimen/margin_wide"
android:contentDescription="@string/donuts"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textintro"
app:srcCompat="@drawable/donut_circle" />
<ImageView
android:id="@+id/ice_cream"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_wide"
android:layout_marginTop="@dimen/margin_wide"
android:contentDescription="@string/ice_cream_sandwiches"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/donut"
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 15
Android Developer Fundamentals Course (V2) – Unit 2
app:srcCompat="@drawable/icecream_circle" />
<ImageView
android:id="@+id/froyo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_wide"
android:layout_marginTop="@dimen/margin_wide"
android:contentDescription="@string/froyo"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ice_cream"
app:srcCompat="@drawable/froyo_circle" />
<TextView
android:id="@+id/donut_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_wide"
android:layout_marginStart="@dimen/margin_wide"
android:layout_marginTop="@dimen/margin_wide"
android:text="@string/donuts"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/donut"
app:layout_constraintTop_toTopOf="@+id/donut" />
<TextView
android:id="@+id/ice_cream_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_wide"
android:layout_marginStart="@dimen/margin_wide"
android:layout_marginTop="@dimen/margin_wide"
android:text="@string/ice_cream_sandwiches"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ice_cream"
app:layout_constraintTop_toTopOf="@+id/ice_cream" />
<TextView
android:id="@+id/froyo_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_wide"
android:layout_marginStart="@dimen/margin_wide"
android:layout_marginTop="@dimen/margin_wide"
android:text="@string/froyo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/froyo"
app:layout_constraintTop_toTopOf="@+id/froyo" />
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 16
Android Developer Fundamentals Course (V2) – Unit 2
</android.support.constraint.ConstraintLayout>
1. To use string resources in Java code, you should first add them to the strings.xml file.
Expand res > values in the Project > Android pane, and open strings.xml. Add the
following string resources for the strings to be shown in the Toast message:
2. Open MainActivity, and add the following displayToast() method to the end of
MainActivity (before the closing bracket):
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 17
Android Developer Fundamentals Course (V2) – Unit 2
Although you could have added this method in any position within MainActivity, it is best
practice to put your own methods below the methods already provided in MainActivity by
the template.
1. Add the following showDonutOrder() method to MainActivity. For this task, use the
previously created displayToast() method to display a Toast message:
/**
* Shows a message that the donut image was clicked.
*/
public void showDonutOrder(View view) {
displayToast(getString(R.string.donut_order_message));
}
The first three lines are a comment in the Javadoc format, which makes the code easier to
understand and also helps generate documentation for your code. It is a best practice to add
such a comment to every new method you create. For more information about how to write
comments, see How to Write Doc Comments for the Javadoc Tool.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 18
Android Developer Fundamentals Course (V2) – Unit 2
/**
* Shows a message that the ice cream sandwich image was clicked.
*/
public void showIceCreamOrder(View view) {
displayToast(getString(R.string.ice_cream_order_message));
}
/**
* Shows a message that the froyo image was clicked.
*/
public void showFroyoOrder(View view) {
displayToast(getString(R.string.froyo_order_message));
}
3. (Optional) Choose Code > Reformat Code to reformat the code you added in MainActivity
to conform to standards and make it easier to read.
1. Open the content_main.xml file, and click the Text tab in the layout editor to show the XML
code.
2. Add the android:onClick attribute to donut ImageView. As you enter it, suggestions appear
showing the click handlers. Select the showDonutOrder click handler. The code should now
look as follows:
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 19
Android Developer Fundamentals Course (V2) – Unit 2
android:padding="10dp"
android:id="@+id/donut"
android:layout_below="@id/choose_dessert"
android:contentDescription="@string/donut"
android:src="@drawable/donut_circle"
android:onClick="showDonutOrder"/>
3. (Optional) Choose Code > Reformat Code to reformat the XML code you added in
content_main.xml to conform to standards and make it easier to read. Android Studio
automatically moves the android:onClick attribute up a few lines to combine them with the
other attributes that have android: as the preface.
4. Follow the same procedure to add the android:onClick attribute to the ice_cream and
froyo ImageView elements. Select the showDonutOrder and showFroyoOrder click handlers.
You can optionally choose Code > Reformat Code to reformat the XML code. The code
should now look as follows:
<ImageView
android:id="@+id/ice_cream"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_wide"
android:layout_marginTop="@dimen/margin_wide"
android:contentDescription="@string/ice_cream_sandwiches"
android:onClick="showIceCreamOrder"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/donut"
app:srcCompat="@drawable/icecream_circle" />
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 20
Android Developer Fundamentals Course (V2) – Unit 2
<ImageView
android:id="@+id/froyo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_wide"
android:layout_marginTop="@dimen/margin_wide"
android:contentDescription="@string/froyo"
android:onClick="showFroyoOrder"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ice_cream"
app:srcCompat="@drawable/froyo_circle" />
5. Click the android: preface part of the android:layout_marginStart attribute, and a red
bulb warning appears next to it, as shown in the figure below.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 21
Android Developer Fundamentals Course (V2) – Unit 2
6. To make your app compatible with previous versions of Android, click the red bulb for each
instance of this attribute, and choose Set layout_marginLeft… to set the
layout_marginLeft to "@dimen/margin_wide".
Clicking the donut, ice cream sandwich, or froyo image displays a Toast message about the order, as
shown in the figure below.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 22
Android Developer Fundamentals Course (V2) – Unit 2
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 23
Android Developer Fundamentals Course (V2) – Unit 2
Look at how other apps implement the floating action button. For example, the Gmail app provides
a floating action button to create a new email message, and the Contacts app provides one to create
a new contact. For more information about floating action buttons, see FloatingActionButton.
For this task you change the icon for the FloatingActionButton to a shopping cart , and change
the action for the FloatingActionButton to launch a new Activity.
1. Expand res in the Project > Android pane, and right-click (or Control-click) the drawable
folder.
2. Choose New > Image Asset. The Configure Image Asset dialog appears.
3. Choose Action Bar and Tab Icons in the drop-down menu at the top of the dialog. (Note
that the action bar is the same thing as the app bar.)
5. Click the clip art image (the Android logo next to Clipart:) to select a clip art image as the
icon. A page of icons appears. Click the icon you want to use for the floating action button,
such as the shopping cart icon.
6. Choose HOLO_DARK from the Theme drop-down menu. This sets the icon to be white
against a dark-colored (or black) background. Click Next.
Tip: For a complete description for adding an icon, see Create app icons with Image Asset Studio.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 24
Android Developer Fundamentals Course (V2) – Unit 2
2. Edit the Activity Name to be OrderActivity, and the Layout Name to be activity_order.
Leave the other options alone, and click Finish.
The OrderActivity class should now be listed along with MainActivity in the java folder, and
activity_order.xml should now be listed in the layout folder. The Empty Activity template added
these files.
1. Open MainActivity.
2. Change the onClick(View view) method to make an explicit intent to start OrderActivity:
startActivity(intent);
3. Run the app. Tap the floating action button that now uses the shopping cart icon. A blank
Activity should appear (OrderActivity). Tap the Back button to go back to MainActivity.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 25
Android Developer Fundamentals Course (V2) – Unit 2
Coding challenge
Note: All coding challenges are optional and are not prerequisites for later lessons.
Challenge: The DroidCafe app's MainActivity launches a second Activity called OrderActivity.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 26
Android Developer Fundamentals Course (V2) – Unit 2
You learned in another lesson how to send data from an Activity to another Activity. Change the
app to send the order message for the selected dessert in MainActivity to a new TextView at the
top of the OrderActivity layout.
1. Add a TextView at the top of the OrderActivity layout with the id order_textview.
2. Create a member variable (mOrderMessage) in MainActivity for the order message that
appears in the Toast.
mOrderMessage = getString(R.string.donut_order_message);
displayToast(mOrderMessage);
4. Add a public static final String called EXTRA_MESSAGE to the top of MainActivity to
define the key for an intent.putExtra:
5. Change the onClick() method to include the intent.putExtra statement before launching
OrderActivity:
Intent intent =
intent.putExtra(EXTRA_MESSAGE, mOrderMessage);
startActivity(intent);
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 27
Android Developer Fundamentals Course (V2) – Unit 2
6. In OrderActivity, add the following code to the onCreate() method to get the Intent that
launched the Activity, extract the string message, and replace the text in the TextView with
the message:
7. Run the app. After choosing a dessert image, tap the floating action button to launch
OrderActivity, which should include the order message as shown in the figure below.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 28
Android Developer Fundamentals Course (V2) – Unit 2
Summary
● To use an image in a project, copy the image into the project's drawable folder (
project_name > app > src > main > res > drawable).
● Define an ImageView to use it by dragging an ImageView to the layout and choosing the
image for it.
● Add the android:onClick attribute to make an ImageView clickable like a button. Specify the
name of the click handler.
● Create a click handler in the Activity to perform the action.
● Choose an icon: Expand res in the Project > Android pane, right-click (or Control-click) the
drawable folder, and choose New > Image Asset. Choose Action Bar and Tab Icons in the
drop-down menu, and click the clip art image (the Android logo next to Clipart:) to select a
clip art image as the icon.
● Add another Activity: In the Project > Android pane, right-click (or Control-click) the
package name folder within the java folder and choose New > Activity and a template for
the Activity (such as Empty Activity).
● Display a Toast message:
Toast.makeText(getApplicationContext(), message,
Toast.LENGTH_SHORT).show();
Related concept
The related concept documentation is in 4.1: Buttons and clickable images.
Learn more
Android Studio documentation:
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 29
Android Developer Fundamentals Course (V2) – Unit 2
● ImageView
● TextView
● Buttons
Other:
Homework
Change an app
The DroidCafe app looks fine when the device or emulator is oriented vertically. However, if you
switch the device or emulator to horizontal orientation, the second and third images don't appear.
3. Remove constraints from the three images and three text descriptions.
4. Select all three images in the layout variant, and choose Expand Horizontally in the Pack
button to evenly distribute the images across the screen as shown in the figure
below.
5. Constrain the text descriptions to the sides and bottoms of the images as shown in the
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 30
Android Developer Fundamentals Course (V2) – Unit 2
figure below.
Question 1
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 31
Android Developer Fundamentals Course (V2) – Unit 2
● Choose New > Image Asset and then choose the image file.
Question 2
How do you make an ImageView clickable like a simple Button? Choose one:
● Add the android:src attribute to the ImageView in the layout and use it to call the
click handler in the Activity.
● Add the android:onClick attribute to the ImageView in the layout and use it to call
the click handler in the Activity.
● Add the android:id attribute to the ImageView in the layout and use it to call the
click handler in the Activity.
Question 3
Which rule applies to a click handler called from the attribute in the layout? Choose one:
● The click handler method must include the event listener View.OnClickListener,
which is an interface in the View class .
● The click handler method must be public, return void, and define a View as its only
parameter.
● The click handler must customize the View.OnClickListener class and override its
click handler to perform some action.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 32
Android Developer Fundamentals Course (V2) – Unit 2
Introduction
To enable the user to enter text or numbers, you use an EditText element. Some input controls are
EditText attributes that define the type of keyboard that appears, to make entering data easier for
users. For example, you might choose phone for the android:inputType attribute to show a
numeric keypad instead of an alphanumeric keyboard.
Other input controls make it easy for users to make choices. For example, RadioButton elements
enable a user to select one (and only one) item from a set of items.
In this practical, you use attributes to control the on-screen keyboard appearance, and to set the
type of data entry for an EditText. You also add radio buttons to the DroidCafe app so the user can
select one item from a set of items.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 33
Android Developer Fundamentals Course (V2) – Unit 2
What you'll do
● Show a keyboard for entering an email address.
● Show a numeric keypad for entering phone numbers.
● Allow multiple-line text entry with automatic sentence capitalization.
● Add radio buttons for selecting an option.
● Set an onClick handler for the radio buttons.
● Add a spinner for the phone number field for selecting one value from a set of values.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 34
Android Developer Fundamentals Course (V2) – Unit 2
App overview
In this practical, you add more features to the DroidCafe app from the lesson on using clickable
images.
In the app's OrderActivity you experiment with the android:inputType attribute for EditText
elements. You add EditText elements for a person's name and address, and use attributes to
define single-line and multiple-line elements that make suggestions as you enter text. You also add
an EditText that shows a numeric keypad for entering a phone number.
Other types of input controls include interactive elements that provide user choices. You add radio
buttons to DroidCafe for choosing only one delivery option from several options. You also offer a
spinner input control for selecting the label (Home, Work, Other, Custom) for the phone number.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 35
Android Developer Fundamentals Course (V2) – Unit 2
1. Make a copy of the DroidCafe app from the lesson on using clickable images, and rename
the copy to DroidCafeInput. If you didn't complete the coding challenge in that lesson,
download the DroidCafeChallenge project and rename it to DroidCafeInput.
android:id "@+id/name_label"
android:layout_width "wrap_content"
android:layout_height "wrap_content"
android:layout_marginStart "24dp"
android:layout_marginLeft "24dp"
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 36
Android Developer Fundamentals Course (V2) – Unit 2
android:layout_marginTop "32dp"
android:text "Name"
app:layout_constraintStart_toStartOf "parent"
app:layout_constraintTop_toBottomOf "@+id/order_textview"
4. Extract the string resource for the android:text attribute value to create and entry for it
called name_label_text in strings.xml.
5. Add an EditText element. To use the visual layout editor, drag a Plain Text element from
the Palette pane to a position next to the name_label TextView. Then enter name_text for
the ID field, and constrain the left side and baseline of the element to the name_label
element right side and baseline as shown in the figure below:
6. The figure above highlights the inputType field in the Attributes pane to show that Android
Studio automatically assigned the textPersonName type. Click the inputType field to see the
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 37
Android Developer Fundamentals Course (V2) – Unit 2
7. Add a hint for text entry, such as Enter your name, in the hint field in the Attributes pane,
and delete the Name entry in the text field. As a hint to the user, the text "Enter your name"
should be dimmed inside the EditText.
8. Check the XML code for the layout by clicking the Text tab. Extract the string resource for the
android:hint attribute value to enter_name_hint. The following attributes should be set for
the new EditText (add the layout_marginLeft attribute for compatibility with older
versions of Android):
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 38
Android Developer Fundamentals Course (V2) – Unit 2
android:id "@+id/name_text"
android:layout_width "wrap_content"
android:layout_height "wrap_content"
android:layout_marginStart 8dp
android:layout_marginLeft 8dp
android:ems "10"
android:hint "@string/enter_name_hint"
android:inputType "textPersonName"
app:layout_constraintBaseline_toBaselineOf "@+id/name_label"
app:layout_constraintStart_toEndOf "@+id/name_label"
As you can see in the XML code, the android:inputType attribute is set to textPersonName.
9. Run the app. Tap the donut image on the first screen, and then tap the floating action button
to see the next Activity. Tap inside the text entry field to show the keyboard and enter text,
as shown in the figure below.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 39
Android Developer Fundamentals Course (V2) – Unit 2
Note that suggestions automatically appear for words that you enter. Tap a suggestion to
use it. This is one of the properties of the textPersonName value for the android:inputType
attribute. The inputType attribute controls a variety of features, including keyboard layout,
capitalization, and multiple lines of text.
10. To close the keyboard, tap the checkmark icon in a green circle , which appears in the
lower right corner of the keyboard. This is known as the Done key.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 40
Android Developer Fundamentals Course (V2) – Unit 2
2. Add a TextView under the name_label element already in the layout. Use the following
attributes for the new TextView:
android:id "@+id/address_label"
android:layout_width "wrap_content"
android:layout_height "wrap_content"
android:layout_marginStart "24dp"
android:layout_marginLeft "24dp"
android:layout_marginTop "24dp"
android:text "Address"
app:layout_constraintStart_toStartOf "parent"
app:layout_constraintTop_toBottomOf "@+id/name_label"
3. Extract the string resource for the android:text attribute value to create and entry for it
called address_label_text in strings.xml.
4. Add an EditText element. To use the visual layout editor, drag a Multiline Text element
from the Palette pane to a position next to the address_label TextView. Then enter
address_text for the ID field, and constrain the left side and baseline of the element to the
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 41
Android Developer Fundamentals Course (V2) – Unit 2
address_label element right side and baseline as shown in the figure below:
5. Add a hint for text entry, such as Enter address, in the hint field in the Attributes pane. As
a hint to the user, the text "Enter address" should be dimmed inside the EditText.
6. Check the XML code for the layout by clicking the Text tab. Extract the string resource for the
android:hint attribute value to enter_address_hint. The following attributes should be set
for the new EditText (add the layout_marginLeft attribute for compatibility with older
versions of Android):
android:id "@+id/address_text"
android:layout_width "wrap_content"
android:layout_height "wrap_content"
android:layout_marginStart 8dp
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 42
Android Developer Fundamentals Course (V2) – Unit 2
android:layout_marginLeft 8dp
android:ems "10"
android:hint "@string/enter_address_hint"
android:inputType "textMultiLine"
app:layout_constraintBaseline_toBaselineOf "@+id/address_label"
app:layout_constraintStart_toEndOf "@+id/address_label"
7. Run the app. Tap an image on the first screen, and then tap the floating action button to see
the next Activity.
8. Tap inside the "Address" text entry field to show the keyboard and enter text, as shown in
the figure below, using the Return key in the lower right corner of the keyboard
(also known as the Enter or New Line key) to start a new line of text. The Return key appears
if you set the textMultiLine value for the android:inputType attribute.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 43
Android Developer Fundamentals Course (V2) – Unit 2
9. To close the keyboard, tap the down-arrow button that appears instead of the Back button
in the bottom row of buttons.
2. Add a TextView under the address_label element already in the layout. Use the following
attributes for the new TextView:
android:id "@+id/phone_label"
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 44
Android Developer Fundamentals Course (V2) – Unit 2
android:layout_width "wrap_content"
android:layout_height "wrap_content"
android:layout_marginStart "24dp"
android:layout_marginLeft "24dp"
android:layout_marginTop "24dp"
android:text "Phone"
app:layout_constraintStart_toStartOf "parent"
app:layout_constraintTop_toBottomOf "@+id/address_text"
Note that this TextView is constrained to the bottom of the multiple-line EditText
(address_text). This is because address_text can grow to multiple lines, and this TextView
should appear beneath it.
3. Extract the string resource for the android:text attribute value to create and entry for it
called phone_label_text in strings.xml.
4. Add an EditText element. To use the visual layout editor, drag a Phone element from the
Palette pane to a position next to the phone_label TextView. Then enter phone_text for
the ID field, and constrain the left side and baseline of the element to the phone_label
element right side and baseline as shown in the figure below:
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 45
Android Developer Fundamentals Course (V2) – Unit 2
5. Add a hint for text entry, such as Enter phone, in the hint field in the Attributes pane. As a
hint to the user, the text "Enter phone" should be dimmed inside the EditText.
6. Check the XML code for the layout by clicking the Text tab. Extract the string resource for the
android:hint attribute value to enter_phone_hint. The following attributes should be set
for the new EditText (add the layout_marginLeft attribute for compatibility with older
versions of Android):
android:id "@+id/phone_text"
android:layout_width "wrap_content"
android:layout_height "wrap_content"
android:layout_marginStart 8dp
android:layout_marginLeft 8dp
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 46
Android Developer Fundamentals Course (V2) – Unit 2
android:ems "10"
android:hint "@string/enter_phone_hint"
android:inputType "phone"
app:layout_constraintBaseline_toBaselineOf "@+id/phone_label"
app:layout_constraintStart_toEndOf "@+id/phone_label"
7. Run the app. Tap an image on the first screen, and then tap the floating action button to see
the next Activity.
8. Tap inside the "Phone" field to show the numeric keypad. You can then enter a phone
number, as shown in the figure below.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 47
Android Developer Fundamentals Course (V2) – Unit 2
● textEmailAddress: Tapping the field brings up the email keyboard with the @ symbol
located near the space key.
● textPassword: The characters the user enters turn into dots to conceal the entered
password.
2. Add a TextView under the phone_label element already in the layout. Use the following
attributes for the new TextView:
android:id "@+id/note_label"
android:layout_width "wrap_content"
android:layout_height "wrap_content"
android:layout_marginStart "24dp"
android:layout_marginLeft "24dp"
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 48
Android Developer Fundamentals Course (V2) – Unit 2
android:layout_marginTop "24dp"
android:text "Note"
app:layout_constraintStart_toStartOf "parent"
app:layout_constraintTop_toBottomOf "@+id/phone_label"
3. Extract the string resource for the android:text attribute value to create and entry for it
called note_label_text in strings.xml.
4. Add an EditText element. To use the visual layout editor, drag a Multiline Text element
from the Palette pane to a position next to the note_label TextView. Then enter note_text
for the ID field, and constrain the left side and baseline of the element to the note_label
element right side and baseline as you did previously with the other EditText elements.
5. Add a hint for text entry, such as Enter note, in the hint field in the Attributes pane.
6. Click inside the inputType field in the Attributes pane. The textMultiLine value is already
selected. In addition, select textCapSentences to combine these attributes.
7. Check the XML code for the layout by clicking the Text tab. Extract the string resource for the
android:hint attribute value to enter_note_hint. The following attributes should be set for
the new EditText (add the layout_marginLeft attribute for compatibility with older
versions of Android):
android:id "@+id/note_text"
android:layout_width "wrap_content"
android:layout_height "wrap_content"
android:layout_marginStart 8dp
android:layout_marginLeft 8dp
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 49
Android Developer Fundamentals Course (V2) – Unit 2
android:ems "10"
android:hint "@string/enter_note_hint"
android:inputType "textCapSentences|textMultiLine"
app:layout_constraintBaseline_to "@+id/note_label"
BaselineOf
app:layout_constraintStart_toEnd "@+id/note_label"
Of
To combine values for the android:inputType attribute, concatenate them using the pipe
(|) character.
8. Run the app. Tap an image on the first screen, and then tap the floating action button to see
the next Activity.
9. Tap inside the "Note" field enter complete sentences, as shown in the figure below. Use the
Return key to create a new line, or simply type to wrap sentences over multiple lines.
This work is licensed under a Creative Commons Attribution 4.0 International License.
This PDF is a one-time snapshot. See developer.android.com/courses/fundamentals-training/toc-v2
for the latest updates.
Page 50
Another Random Scribd Document
with Unrelated Content
CHAPTER V.
COLLECTING AND PRESERVING THE SKINS OF
LARGE MAMMALS.
The fundamental principles to be observed in skinning a large mammal
are, in general, precisely the same as those which govern the same
process in small mammals, and which have been recorded in detail in the
preceding chapter. Having done my best to afford the student a clear
and full understanding of those principles, it is almost unnecessary to say
anything about large mammals. A keen-witted worker could skin any
mammal and preserve the skin by the light of the directions already
given, with such variations as common-sense would dictate.
But, in order to aid the student to the fullest extent, we will endeavor
to state the exceptions and variations of method which are necessary in
disposing of large subjects.
Measurements.—Up to this hour there has been a total lack of system
and uniformity among naturalists and hunters in taking measurements of
large quadrupeds. I have in several important cases found it utterly
impossible to interpret the meaning of measurements taken by other
collectors—and it is very likely they have experienced the same difficulty
in understanding mine. In the hope of securing uniformity hereafter in
observations of this kind, I venture to propose the following system,
which will apply to all terrestrial mammals larger than the fox, except the
large quadrumana. If the method here proposed is rigidly adhered to, it
will produce a uniformity in results that will certainly increase the value
of specimens collected hereafter. The measurements are listed in the
order of their importance, and are fully indicated in the accompanying
illustration (Plate III.). Straight lines indicate straight measurements
between two points, not following curves; and curved lines indicate
circumference measurements.
Record all measurements in feet and inches, and fractions of an inch.
If you would have your records understood by the few rather than by the
many, then bow to the dictates of the French and German naturalists,
who, as a rule, care not a brass farthing for American science or
zoological nomenclature, and employ the metric system. The chances
are as twenty to one that no one outside of the English language will
ever care a continental about your measurements, and for this reason
United States measurements ought to be good enough for us. There is
no more reason why 120,000,000 English-speaking people should adopt
the metric system for a few Europeans who might care for their
measurements, than that we should write all our zoological books and
papers in French or German. If you wish to make your records available
to the people who will care for them, make them in the United States
language.
1. Length of head and body to root of tail (Plate III., A-A).—In taking
this measurement, lay the animal upon its side, stretch the head straight
forward as far as it will go, and hold a stick perpendicular against the tip
of the nose. Erect another perpendicular rod under the tail, close to
where it joins the body, at the angle formed by the lines A and H, then
measure between these two perpendiculars.
2. Height at the shoulders (B-B).—This is a difficult measurement to
take, because it is subject to the management of the operator. Plant a
perpendicular rod close against the shoulders at the highest point. Then
hold the foreleg perfectly straight, at a right angle to the axis of the
body, and bend up the foot into the position it would assume if the
animal were standing upon it. In short, place the foreleg and foot exactly
as they would be were the animal alive and standing, with its weight
resting upon it, and measure from the bottom of the heel in a straight
line to the perpendicular at the shoulders.
3. Girth behind foreleg.—In taking this, always measure at the point
where the girth of a saddle touches the horse, and draw the tape-line
taut upon the skin. If the hair is thick and long, part it.
4. Circumference of the neck.
PLATE III. Measurements of a Large Mammal. (Polar Bear on Ice-floe.
Mounted by the Author.)
5. Depth of flank (E-E).—To a taxidermist, this is often a very
important guide in the construction of a manikin. There is always a thin
fold of skin at the point where the skin of the hind leg passes to the side
of a large animal, as indicated by the dotted line in the figure, at the
lower end of the line E-E. Erect a perpendicular at the upper end of the
line E, and measure between the two points.
6. Circumference of forearm (F-F).—To be taken at the point where the
forearm has the greatest circumference.
7. From head of humerus to head of femur.—This is always of extreme
value in building a manikin. As the animal lies upon its side, hold the
foreleg the same as when you measured the height at the shoulders.
Then feel for the two high points G-G, where the skin rests on the outer
extremity of the arm and thigh bones (not the pelvis), at shoulder and
hip, and measure between the two points.
8. Length of tail (H-H).—Hold the tail down at an angle of forty-five
degrees with the axis of the body, or the line A-A, and measure from the
angle A-H to the end of the vertebræ of the tail. If you measure to the
end of the hair, let this be a supplementary measurement.
These are the measurements which should always be taken on a large
animal. Of course, of certain subjects, there are many other
measurements that you will want, but your own needs will tell you what
they are.
Weight.—It is very desirable to ascertain the weight of an animal
whenever possible. A thousand times, at least, have I been asked the
weight of my big tiger (495 pounds), and that number of times have I
been glad that in spite of jungle fever, I persevered with my 50-pound
scales, and weighed the animal piecemeal, after he had been skinned
and cut up. With a particularly fine animal it is well worth the trouble it
costs.
Skinning a Large Mammal.—Rip the skin open by a
clean, straight cut from the throat along the neck,
breast, middle of the belly, and on to the root of the
tail. We are now obliged to slit the legs open along
their entire length, so that the cuts will be as much
out of sight as possible when the animal is mounted.
In making these opening cuts, always insert the point
of the knife under the skin, edge uppermost, to avoid
cutting the hair. To rip open a leg, seize the foot in
your left hand, bring the leg against your own knee
to hold it tense and firm, then insert the point of your
knife into the middle of the foot at the back, and cut
Fig. 6.—Opening straight up the back of the leg until you come to the
Cuts on a Large "knee" on the foreleg, and hock-joint on the other. At
Mammal. these points gradually change the direction of the cut
and run it on up the inside so that it will finally come
to the body-cut at a point exactly between the legs, and as much as
possible out of sight. The lines in the accompanying figure (6) show how
the cuts in the legs should be made. In skinning the head of an animal
having antlers or horns, it is necessary to make an opening at the back
of the neck shaped like a Y. Make the cuts as shown in Fig. 7, on
opposite page; cut completely around each horn at its base, and skin the
head by working downward over the forehead and cheeks. The skull is
then taken out through this Y[4].
Thoroughness.—The principles to be observed in skinning the body are
precisely the same as those given for small mammals. Remember that it
is easier to take the skin off clean and free from flesh as you cut it from
the animal, and can stretch it tight with your left hand in order to shave
the flesh off clean, than it will be to clean the skin after it is off. An
excess of flesh left on the skin means unnecessary weight, a waste of
preservatives, and longer time in curing the skin. A clean, thin skin is
more easily and quickly cured and carried than one badly taken off. My
habit is to clean a skin so thoroughly in taking it off that no paring down
is necessary before curing it—unless, indeed, it be the skin of an
elephant or other pachyderm. When I once preserved the skin of a large,
old elephant in an Indian jungle, I kept ten native chucklers at work
upon it for three days, thinning it down to a portable degree.
Fig. 7.—Opening Cuts at Back of Prong-horn
Antelope's Head.
The Legs.—If the specimen is of medium size, e.g., not larger than a
deer, disjoint the legs at shoulder and hip, and leave all the leg bones
attached to the skin, just as with small mammals; but, of course, cutting
off the flesh and tendons carefully. If the animal is larger than a deer,
the skin would be too heavy and cumbersome to handle if all the leg
bones were left attached to it. Therefore, with your elk, moose, buffalo,
etc., cut off the foreleg at the "knee" (so called), and the hind leg at the
hock-joint, leaving the calcaneum, or heel-bone, attached to the canon
bone, and thus remaining with the skin. The bones from the two upper
joints of the legs are to be cleaned of flesh, tied in a bundle, and sent
with the skin—unless the collector happens to be travelling by pack train
in mountainous country, far afield. In such a case we can forgive him for
throwing away the large bones of the legs if he will only bring in the
skin, skull, and lower leg bones all right. The point is, in mounting a skin
we must have leg bones—if not the real ones, then they must be
counterfeits carved out of wood, to give shape to the legs, particularly at
the joints. And he who tries it once will find it is a two or three days' job
to carve a large set of leg bones, even with patterns by which to work,
to say nothing of having to evolve models from one's inner
consciousness. Therefore, I say, save the leg bones.
Beware of Blood.—By all means keep the hair from getting bloody, but
if you cannot possibly keep it clean, keep it as clean as you can.
Remember that blood must be washed out on the spot, no matter how
scarce water is, nor whether the mercury stand at 110° above zero, or
10° below. If a wound bleeds profusely, throw plenty of dry dirt or sand
on the hair that has become bloody, to absorb the blood. The dirt can be
knocked out with a stick, and it will take the blood with it. If the white
hair of the prong-horn antelope once gets soaked with blood, it is
impossible to remove all traces of it. The soft, tubular hairs get filled with
blood wherever there is a break, and enough of it will always remain to
mark the catastrophe. In the Bad Lands of Montana I once washed three
long and bitterly cold hours on a fine antelope skin that had lain twenty-
four hours with blood upon it, but had to give up beaten, at last, and
throw the skin away.
Shaping.—Since these directions will be used chiefly in preparing the
skins of deer, antelope, and kindred ruminants, the accompanying
illustration (Fig. 8) is given to show how such skins should be made up
when they are to be preserved dry, either for study or for mounting. It is
best to defer folding up a skin until it is partially dry and has begun to
stiffen a little.
Special and Exceptional Directions.—Apes and Monkeys.—If you are in
the jungle, the chances are that you will have no plaster Paris with which
to make casts, in which case you must make the sketching-pencil and
tape-measure do double duty. With such a wonderful and characteristic
form as a gorilla, chimpanzee, or orang-utan, you cannot study it too
much, unless you study it until the skin spoils. Above
all things, study every feature of the face, and also its
expression, so that you can make a copy of it two
years afterward which shall be both mathematically
and artistically correct. If you have plaster Paris, fail
not to take a mould of the face, and also of one hand
and foot, so that later you can make casts. The same
advice applies to the great baboons with their fearful
and wonderful faces and ischial callosities, some of
them gotten up with all the colors of the rainbow, and
far more brilliancy. Remember that when the skin
dries all those colors totally disappear, and the skin
turns to the color of parchment. Therefore, out with
your box of colors at once, and make a color-sketch
of the face. If you have skill but no colors, or colors Fig. 8.—A Well-
with no skill, then out with your "Ridgway's made Dry Deer
Nomenclature of Colors," make a large diagram or Skin.
sketch of the head, and mark the names of the
respective colors upon it. Whenever the skin of any
animal has any noticeable color, record the fact in as definite terms as
possible.
All the great anthropoid apes should have the opening-cut for the
body made along the middle of the back, up to the back of the head,
instead of along the abdomen and breast, which are generally but thinly
haired, and on the throat are quite naked. By doing this, the sewed-up
seam comes at the back of the mounted specimen, in the hair, and out
of sight. With adult specimens of the gorilla, chimpanzee, and orang the
skeleton is quite as valuable as the skin, therefore every bone must
come forth and be carefully preserved. Skinning the fingers is a tedious
task, and one which requires some skill, especially when it comes to
working the end off so that the nail is left in its place in the skin, and
without mutilation. But when the value of a skin and skeleton runs up
into hundreds of dollars, you can well afford to spend a whole hour in
skinning a hand, if you cannot do it in less time. The opening cuts for
the hand and foot of any ape or monkey are to be made as shown by
the dotted lines in the accompanying sketch of the foot of an orang-utan
(Fig. 9). This is necessary even in skinning small quadrumanes which are
to retain their leg bones, because the skin of each finger must be
separated from the bone so that the preservative powder or liquid can
get at the inside of it.
The Eyes and Nose.—Be exceedingly careful in skinning the face. The
eyes are deeply sunken in their sockets, and if you are not very careful
your knife will make an ugly gash at the corner of the eye before you
know it. A finger held in between the lids against the eyeball will be a
safe guide. Of course, you will cut the lips away at the gum, and split
them open afterward from the inside to remove the flesh. And, of
course, the proboscis of the baboon and the long-nosed monkey of
Borneo must be skinned out quite to the tip while the specimen is fresh,
or it will dry up horribly.
The Ear.—The ear of a quadrumane, especially that of a chimpanzee,
because of its great size, is a very miserable part to preserve, unless you
have a salt-and-alum bath at hand. If the cartilage is entirely skinned out
—itself a difficult thing to do—it will afterward be almost a practical
impossibility to give the ear its proper shape. Therefore the cartilage
must remain. The skin can be loosened from the cartilage at the back of
the ear, however, which is a great gain. Do this, and insert a good
quantity of powdered alum. Then paint the whole ear over on both sides
with arsenical soap, and put on all the powdered alum that will stick—
unless the skin is to go in the bath. In that case treat each ear to a little
strong alum water for an hour or so.
CHAPTER VI.
COLLECTING SKINS OF SMALL BIRDS.
The lives of hundreds of thousands of wild birds have been sacrificed
to no purpose by persons claiming to be ornithological collectors, and yet
who had not the knowledge, skill, or industry to make up good bird
skins. There are now in this country numerous large collections of bird
skins that are a sight to behold. The ability to make up fine, clean,
shapely, well-preserved skins, and make them rapidly also, is a prime
requisite in anyone who aspires to be sent off to interesting "foreign
parts" to shoot, collect, and see the world—at the expense of someone
else. An aspiring young friend of the writer, whose soul yearned to travel
and "collect," missed a fine opportunity to make a very interesting
voyage on the Albatross, for the sole reason that with all his yearning he
could not make good bird skins,—and it served him right for his lack of
enterprise.
Let me tell you that, while twenty years ago any sort of a bird skin was
acceptable to a museum, now such specimens must be first class in
order to be well received. Fine skins are the rule now with curators and
professional ornithologists, and poor ones the exception. Although the
work itself is simple enough, it is no child's play to perform it
successfully.
It is best for the beginner to learn first how to skin small birds, and
make up their skins, and when he has mastered these details he is
prepared to undertake the preparation of large specimens, and learn
how to overcome the exceptional difficulties they present. To this end
the present chapter will be devoted to setting forth the leading principles
involved, which are most easily learned from small specimens.
We will first undertake the work of skinning a small bird—a robin,
thrush, or blackbird, whichever you happen to have. If in skinning, skin-
making, and mounting you master the robin, for example, which is the
highest type of a bird, you will be well prepared for the great majority of
the other members of the feathered tribe.
Shoot your specimen with as fine shot as possible, and not too much
even of that, in order to avoid shooting its mandibles, feet, legs, and
feathers to pieces. As soon as it is dead, plug the throat, nostrils, and all
wounds that bleed, with bits of cotton, to keep the blood and other
liquids from oozing out upon the feathers, and putting you to more
serious trouble. Carry the specimen home in any careful way you choose,
so as to avoid rumpling or soiling the plumage. By all means let your first
practice be upon clean birds.
A bird should lie an hour or two
after being shot, in order that the
blood may coagulate. Warm
specimens bleed very badly in
skinning.
We are now in our workroom, with
the gun standing quietly in its
corner, and a robin lying on the table
before us. Look at it. Study its form
and structure, and remember what Fig.
you see. Notice how smoothly the 10.—Names of the External Parts of
feathers lie—how nicely they fall a Bird.[5] 1, Crown; 2, forehead; 3,
over the angle of the wing at the nostrils (or cere); 4, upper
shoulder—how completely the thigh mandible; 5, lower mandible; 6,
is buried in the feathers of the throat; 7, neck; 8, spurious quills;
breast and side, and also where the 9, occiput; 10, ear; 11, nape; 12,
legs emerge from the body feathers. breast; 13, middle coverts; 14,
Notice how large coverts; 15, belly; 16, tibia;
short the neck is, how the eye 17, tarsus; 18, inner toe; 19, middle
does not bulge out of the head, and toe; 20, outer toe; 21, thumb; 22,
note the fact that the breast and under-tail coverts; 23, tail; 24,
belly look full, round, and primaries; 25, secondaries; 26,
comfortable, instead of presenting tertiaries.
that ghastly, drawn-up, eviscerated
appearance so often seen in the amateur's mounted specimens. Note the
color of the eye, the bill, the cere, tarsi, claws, and all other parts that
will require painting when the specimen is mounted, if it ever should be.
Now take the following Measurements.—It would be high treason for me to
recommend any other system of bird measurement than that directed by
Dr. Coues in his incomparable "Key to North American Birds," and it is
hereby set forth:
1. Length.—Distance between the tip of the bill and the end of the
longest feather of the tail.
2. Extent of wings.—This means the distance between the tips of the
outstretched wings as the bird lies flat upon its back.
3. Length of wing.—Distance from the angle formed at the (carpus)
bend of the wing to the end of the largest primary. In birds with a
convex wing, do not lay the tape-line over the curve, but under the wing,
in a straight line.
4. Length of the tail.—Distance from the roots of the tail feathers to
the end of the longest one. Feel for the "pope's nose;" in either a fresh
or dried specimen there is more or less of a palpable lump into which the
tail feathers stick. Guess as near as you can to the middle of this lump;
place the end of the ruler opposite the point, and see where the tip of
the longest tail feather comes.
5. Length of bill.—Dr. Coues takes "the chord of the culmen," which is
determined thus: "Place one foot of the dividers on the culmen just
where the feathers end; no matter whether the culmen runs up on the
forehead, or the frontal feathers run out on the culmen, and no matter
whether the culmen is straight or curved. With me the length of the bill
is the shortest distance from the point indicated to the tip of the upper
mandible."
6. Length of tarsus.—Distance between the joint of the tarsus with the
leg above, and that with the first phalanx of the middle toe below.
Measure it always with the dividers, and in front of the leg.
7. Length of toes.—Distance in a straight line along the upper surface
of a toe is from the point last indicated to the root of the claw on top.
Length of toe is to be taken without the claw, unless otherwise specified.
8. Length of the claws.—Distance in a straight line from the point last
indicated to the tip of the claw.
9. Length of head.—Set one foot of the dividers over the base of the
culmen, and allow the other to slip just snugly down over the arch of the
occiput.
For skinning a small bird, the only instrument imperatively necessary is
a good-sized scalpel or a sharp penknife. You can use a pair of small
scissors now and then, if you have them, to very good advantage, in
severing legs and wings and clipping off tendons. Have ready a dish of
corn meal to absorb any blood that is likely to soil the feathers. Now
push a wad of cotton up the vent, and we are ready to remove the skin.
No, there is one thing more. The wings lie close to the body, and will
be continually in our way unless we break them so that they will fall back
and leave us a clear field. It is the humerus that must be snapped in
two, as close to the body as possible. Those of small birds are easily
broken with the thumb and finger, but in a large bird they must be
treated to a sharp blow with a heavy stick, or a hammer.
Lay the bird upon its back, with its head toward your left hand; part
the feathers in a straight line, and divide the skin from the centre of the
breast straight down to the end of the breastbone, and on until the vent
is reached. Cut through the skin only, for if you go too deep and cut
through the wall of the abdomen you will have the intestines and various
other troubles upon your hands.
Skin down each side of the bird until you come to the knee-joint,
which lies close to the body, and well within the skin. Sever each leg
completely at the knee, leaving the thigh attached to the body, turn the
skin of the leg wrong side out over the fleshy part, quite down to the
joint, and then cut away every particle of flesh from the bone of the leg.
Sever the tail from the body close to the ends of the tail feathers,
without cutting through the skin. Now take the body between the thumb
and forefinger of the left hand, holding it at the hips, and with the other
hand separate the skin from the back. From this point we proceed to
turn the skin wrong side out over the shoulders and head. When the
wings are reached, cut them off where they are broken, and turn the
skin down over the neck. Avoid cutting through the crop. If blood flows
at any time, absorb it all with the corn meal or plaster Paris.
Almost before you know it you have skinned
your bird down to the head, for it hangs head
downward during the latter part of the
operation, suspended on a small wire hook
thrust through the pelvis, so that you can work
with both hands.
It is a trifle more difficult to turn the skin over
the head. Push it up from the back of the head
with the thumb-nail, working it patiently, at all
points, and stretching the skin gradually until it
will pass over the widest part of the skull.
Presently the crisis is past, the skin slips down
without trouble, and we see by the way it is
Fig. 11. held at a certain point on each side of the head
—First Steps in that we have come to the ears. Cut through the
Skinning a Bird. skin close up to the head, and a little farther on
we reach the eyes.
Now be careful. Cut very slowly at the eye, and close to the head, until
you can see through the thin membrane and define the exact position of
the eyeball. Now cut through the membrane, but do not cut the eyelid
on any account. A little farther and we come to the base of the bill,
where the skin and our skinning stops.
Cut through the back of the skull so as to sever the head completely
from the neck, and lay bare the base of the brain. Remove the brain
from the skull; cut the eyes out of their sockets; cut out the tongue and
remove all flesh from the skull.
Skin each wing down to the first joint, or the elbow, and stop the
"wrong-side-out" process there. The ends of the secondaries must not
be separated from the bone of the forearm, or the ulna. It is possible to
clean out the flesh from the forearm and also from the arm bone
(humerus) without detaching the ends of the secondaries, as you will
readily see. Cut away any flesh which has been left at the root of the
tail, but do not cut the ends of the tail feathers.
The next thing is to poison the skin. Do this
with a mixture of powdered arsenic and alum,
in equal parts. Some of our most extensive
collectors use no alum, simply pure arsenic in
liberal quantity; but I consider that the use of
alum also is always desirable, and under certain
conditions it is extremely so. Some collectors
use arsenical soap exclusively, even on small
birds, and on large birds I, too, have used it
quite extensively, supplemented by an
immediate sprinkling of powdered alum, to do
the curing of the skin. For genuine
thoroughness in poisoning and preserving, I will
back arsenical soap and alum against all other
substances the world can produce; but in Fig. 12.—The Skin
treating small birds that are to be made up as Wrong Side Out, and
dry skins, I prefer and recommend powdered Ready to be Poisoned.
arsenic and alum, as stated above.
Whatever poison you decide to use, apply it thoroughly to every part
of the skin, the skull, wings, legs, and tail. Now put a ball of cotton in
each eye-socket to fill up the cavity, and you are ready to reverse the
skin and bring it right side out once more. It is usually some trouble to
get the skin back over the skull, and that I accomplish in this wise:
Let the skin rest on the edge of the table, place both of your thumbs
on the back of the skull, and with all your fingers and finger-nails, reach
forward and begin to crowd the skin of the head back where it belongs.
At the same time, you must push on the skull with your thumbs, as if
trying to push it into the neck, and in a very short time, by a
combination of coaxing and crowding, the skin made passes the critical
point on the skull, and, presto! the whole skin is right side out once
more. Now take it by the bill and give it a gentle shaking to stir up the
feathers so that they will fall back naturally. Pluck outward the cotton in
the orbit into the opening of the eye, to imitate the round fullness of the
eyeball.
The wing bones of very small birds need not be wrapped with cotton,
but the leg bones should be, always. Now take a bunch of cotton batting
of the right size, and roll it between the palms until it attains the proper
size to fill the neck, and is a trifle longer than the entire body and neck.
Fold over one end of this, take it between the points of your forceps,
insert it through the neck, and into the cavity of the skull. Tuck up the
other end at the tail, and give the cotton body its right length. Then in
the middle of the skin, pull the cotton roll apart sidewise, spread it out
and lay on it a ball of cotton to form the body.
Next, take hold of the broken humerus with the forceps, and pull it
inward until the joint of the wing appears, and the two humeri lie parallel
and close to each other. This draws the wings into place.
Be sure to put enough cotton in the body of a skin; for a little
plumpness and rotundity is desirable in a small skin. Avoid making
cylindrical bird skins; avoid the East Indian native habit of crowding the
breast of a bird clear up into its neck, and also avoid stretching a skin.
We have now to finish the head by inserting a little bunch of cotton in
the throat, until that part is properly filled, and plucking out or cutting off
the surplus. The mandibles must be held together by a thread or a pin
until they have dried in position. Next adjust the wings, legs, and tail.
The tail should be slightly spread, and there are two ways of doing this.
One is to reverse the natural overlapping of the tail feathers, which is the
quickest way, and quite satisfactory. The other is to lay the skin on a
board, put a pin through each corner of the "pope's nose," spread the
tail, and thrust the pins into the board until the skin is dry. Finally, tie on
your label, which should be as small as possible to contain the necessary
data—locality, date, sex, number, collector's name, measurements, and
remarks. Some collectors label only with numbers, corresponding with
recorded data in a note-book; but it is a bad plan. Note-books often get
lost, and then such specimens lose half their value.
Fig. 13.—The Bird Skin in Position.
The head can be adjusted by pulling on the cotton at that end, and
pinching the end together beyond the head. The bill must be set at the
proper angle, and held by catching the point in the cotton. Do not let the
bill point straight out, for it will stretch the skin of the throat too much;
neither should it point up at a right angle to the body, for the tip will be
catching in everything that comes near it. The best way with most short-
billed birds is to let the bill point at an angle of about forty-five degrees
to the axis of the body. Beaks that are very long require special
arrangement, as shown in Figs. 17 and 18.
Now lift the wrapped-up skin, lay it with the tail toward you, breast
uppermost, and with both hands tear the cotton open in a straight line
up to the base of the tail (Fig. 15). You can now spread the tail by
overlapping the feathers, or leave it closed if you prefer. See that your
label is on, adjust the toes and legs carefully, then fold over the edges of
the cotton and overlap them, and the skin is done (Fig. 16). Always
spread the toes of all swimming-birds.
Fig. 15.—Spreading the Tail.
ebookbell.com