100% found this document useful (1 vote)
126 views

Android in Action Second Edition Frank Ableson download

The document provides information on the book 'Android in Action Second Edition' by Frank Ableson and Robi Sen, including details about its content, structure, and various chapters covering Android development topics. It includes links to download the book and other related texts. The book is published by Manning Publications and was released in 2011.

Uploaded by

neagaseyadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
126 views

Android in Action Second Edition Frank Ableson download

The document provides information on the book 'Android in Action Second Edition' by Frank Ableson and Robi Sen, including details about its content, structure, and various chapters covering Android development topics. It includes links to download the book and other related texts. The book is published by Manning Publications and was released in 2011.

Uploaded by

neagaseyadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Android in Action Second Edition Frank Ableson

pdf download

https://ebookfinal.com/download/android-in-action-second-edition-
frank-ableson/

Explore and download more ebooks or textbooks


at ebookfinal.com
We have selected some products that you may be interested in
Click the link to download now or visit ebookfinal.com
for more options!.

Ext JS in Action Second Edition Jesus Garcia

https://ebookfinal.com/download/ext-js-in-action-second-edition-jesus-
garcia/

Clojure in Action Second Edition Amit Rathore Francis


Avila

https://ebookfinal.com/download/clojure-in-action-second-edition-amit-
rathore-francis-avila/

Social groups in action and interaction Second Edition.


Edition Stangor

https://ebookfinal.com/download/social-groups-in-action-and-
interaction-second-edition-edition-stangor/

Endoscopic Ultrasonography Second Edition Frank G. Gress

https://ebookfinal.com/download/endoscopic-ultrasonography-second-
edition-frank-g-gress/
WebWork in Action In Action First Edition Patrick
Lightbody

https://ebookfinal.com/download/webwork-in-action-in-action-first-
edition-patrick-lightbody/

Hello Android Introducing Google s Mobile Development


Platform Second Edition Burnette Ed

https://ebookfinal.com/download/hello-android-introducing-google-s-
mobile-development-platform-second-edition-burnette-ed/

Android in Practice 1st Edition Charlie Collins

https://ebookfinal.com/download/android-in-practice-1st-edition-
charlie-collins/

IntelliJ IDEA in Action In Action series 1st Edition


Stephen Saunders

https://ebookfinal.com/download/intellij-idea-in-action-in-action-
series-1st-edition-stephen-saunders/

Scala in Action Nilanjan Raychaudhuri

https://ebookfinal.com/download/scala-in-action-nilanjan-raychaudhuri/
Android in Action Second Edition Frank Ableson Digital
Instant Download
Author(s): Frank Ableson, Robi Sen
ISBN(s): 9781935182726, 1935182722
Edition: Second Edition
File Details: PDF, 13.38 MB
Year: 2011
Language: english
Android in Action
SECOND EDITION

W. FRANK ABLESON
ROBI SEN
CHRIS KING

Revised Edition of Unlocking Android

MANNING
Greenwich
(74° w. long.)
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
180 Broad St.
Suite 1323
Stamford, CT 06901
Email: [email protected]

©2011 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in


any form or by means electronic, mechanical, photocopying, or otherwise, without prior written
permission of the publisher.

Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial caps
or all caps.

Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books
are printed on paper that is at least 15 percent recycled and processed without the use of
elemental chlorine

Manning Publications Co. Development editor: Troy Mott


180 Broad St. Copyeditors: Joan Celmer, Liz Welch
Suite 1323 Typesetter: Dottie Marsico
Stamford, CT 06901 Cover designer: Marija Tudor

ISBN 978-1-935182-72-6
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 – MAL – 16 15 14 13 12 11
brief contents
PART 1 WHAT IS ANDROID?—THE BIG PICTURE ........................1
1 ■ Introducing Android 3
2 ■ Android’s development environment 31

PART 2 EXERCISING THE ANDROID SDK ..................................61


3 ■ User interfaces 63
4 ■ Intents and Services 101
5 ■ Storing and retrieving data 129
6 ■ Networking and web services 159
7 ■ Telephony 187
8 ■ Notifications and alarms 205
9 ■ Graphics and animation 222
10 ■ Multimedia 246
11 ■ Location, location, location 267

PART 3 ANDROID APPLICATIONS . ...........................................291


12 ■ Putting Android to work in a field service application 293
13 ■ Building Android applications in C 338

v
vi BRIEF CONTENTS

PART 4 THE MATURING PLATFORM ........................................365


14 ■ Bluetooth and sensors 367
15 ■ Integration 387
16 ■ Android web development 421
17 ■ AppWidgets 454
18 ■ Localization 491
19 ■ Android Native Development Kit 506
contents
preface xvii
preface to the first edition xix
acknowledgments xxi
about this book xxiv
about the cover illustration xxix

PART 1 WHAT IS ANDROID?—THE BIG PICTURE ...............1

1 Introducing Android
1.1 The Android platform 4
3

1.2 Understanding the Android market 5


Mobile operators 5 Android vs. the feature phones 6

Android vs. the smartphones 7 Android vs. itself 8


Licensing Android 9
1.3 The layers of Android 10
Building on the Linux kernel 11 ■ Running in the
Dalvik VM 12
1.4 The Intent of Android development 12
Empowering intuitive UIs 13 ■ Intents and how they work 13

vii
viii CONTENTS

1.5 Four kinds of Android components 17


Activity 17 Service
■ 18 ■ BroadcastReceiver 19
ContentProvider 22
1.6 Understanding the AndroidManifest.xml file 24
1.7 Mapping applications to processes 25
1.8 Creating an Android application 26
1.9 Summary 30

2 Android’s development environment


2.1 Introducing the Android SDK
Core Android packages 33 ■
31
32
Optional packages 34
2.2 Exploring the development environment 34
The Java perspective 35 ■ The DDMS perspective 37
Command-line tools 40
2.3 Building an Android application in Eclipse 43
The Android Project Wizard 43 Android sample ■

application code 44 Packaging the application 50


2.4 Using the Android emulator 51


Setting up the emulated environment 52
Testing your application in the emulator 56
2.5 Debugging your application 57
2.6 Summary 58

PART 2 EXERCISING THE ANDROID SDK .........................61

3 User interfaces
3.1
63
Creating the Activity
Creating an Activity class
65
66 ■ Exploring the Activity
lifecycle 71
3.2 Working with views 74
Exploring common views 75 Using a ListView 77 ■

Multitasking with Handler and Message 81


Creating custom views 82 Understanding layout 84

Handling focus 86 Grasping events 87


3.3 Using resources 89


Supported resource types 89 Referencing resources in Java
■ 89
Defining views and layouts through XML resources 92
Externalizing values 94 Providing animations 97

CONTENTS ix

3.4 Exploring the AndroidManifest file 98


3.5 Summary 99

4 Intents and Services


4.1
101
Serving up RestaurantFinder with Intent
Defining Intents 102 Implicit and explicit invocation 103

102

Adding external links to RestaurantFinder 104 Finding your ■

way with Intent 106 Taking advantage of Android-provided


activities 108
4.2 Checking the weather with a custom URI 109
Offering a custom URI 109 ■ Inspecting a custom Uri 111
4.3 Checking the weather with broadcast receivers 113
Broadcasting Intent 113 ■ Creating a receiver 115
4.4 Building a background weather service 115
4.5 Communicating with the WeatherAlertService
from other apps 119
Android Interface Definition Language 119 Binder and ■

Parcelable 121 Exposing a remote interface 122


Binding to a Service 123 Starting versus binding 126


Service lifecycle 127


4.6 Summary 128

5 Storing and retrieving data


5.1 Using preferences 130
Working with SharedPreferences
129

130 ■ Preference access


permissions 133
5.2 Using the filesystem 136
Creating files 136 Accessing files 137
■ ■ Files as raw
resources 138 XML file resources 139
■ ■ External storage
via an SD card 141
5.3 Persisting data to a database 144
Building and accessing a database 144 ■ Using the
sqlite3 tool 149
5.4 Working with ContentProvider classes 149
Using an existing ContentProvider 150 ■ Creating a
ContentProvider 151
5.5 Summary 158
x CONTENTS

6 Networking and web services


6.1 An overview of networking 161
Networking basics 161 ■
159

Clients and servers 163


6.2 Checking the network status 164
6.3 Communicating with a server socket 165
6.4 Working with HTTP 168
Simple HTTP and java.net 169 Robust HTTP with ■

HttpClient 170 Creating an HTTP and HTTPS helper


■ 172
6.5 Web services 178
POX—Putting it together with HTTP and XML 179
REST 181 To SOAP or not to SOAP, that is the question
■ 184
6.6 Summary 185

7 Telephony
7.1
187
Exploring telephony background and terms
Understanding GSM 189 ■ Understanding CDMA
188
189
7.2 Accessing telephony information 190
Retrieving telephony properties 191 ■ Obtaining phone state
information 193
7.3 Interacting with the phone 195
Using intents to make calls 195 Using phone number-related

utilities 196 Intercepting outbound calls 198


7.4 Working with messaging: SMS 199


Sending SMS messages 199 ■ Receiving SMS messages 202
7.5 Summary 203

8 Notifications and alarms


8.1 Introducing Toast
205
206
Creating an SMS example with a Toast 206 ■ Receiving an
SMS message 207
8.2 Introducing notifications 210
The Notification class 210 ■ Notifying a user of an SMS 211
8.3 Introducing Alarms 215
Creating a simple alarm example 215 ■ Using notifications
with Alarms 218
8.4 Summary 220
CONTENTS xi

9 Graphics and animation


9.1
222
Drawing graphics in Android 223
Drawing with XML 224 ■ Exploring XML drawable
shapes 225
9.2 Creating animations with Android’s Graphics API 227
Android’s frame-by-frame animation 227 ■ Programmatically
creating an animation 230
9.3 Introducing OpenGL for Embedded Systems 233
Creating an OpenGL context 234 Drawing a rectangle with

OpenGL ES 238 Three-dimensional shapes and surfaces with


OpenGL ES 241
9.4 Summary 245

10 Multimedia
10.1
246
Introduction to multimedia and OpenCORE 247
10.2 Playing audio 248
10.3 Playing video 250
10.4 Capturing media 251
Understanding the camera 252 ■ Capturing audio 257
10.5 Recording video 259
10.6 Summary 265

11 Location, location, location


11.1
267
Simulating your location within the emulator 269
Sending in your coordinates with the DDMS tool 269
The GPS Exchange Format 271 The Google Earth

Keyhole Markup Language 272


11.2 Using LocationManager and LocationProvider 275
Accessing location data with LocationManager 275
Using a LocationProvider 277 Receiving location

updates with LocationListener 279


11.3 Working with maps 281
Extending MapActivity 282 Using a MapView
■ 282
Placing data on a map with an Overlay 285
11.4 Converting places and addresses with Geocoder 288
11.5 Summary 290
xii CONTENTS

PART 3 ANDROID APPLICATIONS ...................................291

12 Putting Android to work in a field service application


12.1 Designing a real-world Android application
Core requirements of the application 295 Managing the ■
294
293

data 296 Application architecture and integration 297


12.2 Mapping out the application flow 298


Mapping out the field service application 298 List of source ■

files 300 Field service application’s AndroidManifest.xml 302


12.3 Application source code 302


Splash Activity 302 Preferences used by the FieldService

Activity 304 ■ Implementing the FieldService Activity 306


Settings 307 ■ Managing job data 309
12.4 Source code for managing jobs 316
RefreshJobs 317 Managing jobs: The ManageJobs

Activity 320 Working with a job with the ShowJob Activity


■ 323
Capturing a signature with the CloseJob Activity 327
12.5 Server code 333
Dispatcher user interface 334 Database 334 PHP
■ ■

dispatcher code 335 PHP mobile integration code 336


12.6 Summary 337

13 Building Android applications in C


13.1 Building Android apps without the SDK
338

The C compiler and linker tools 339 Building a Hello World



339

application 340 Installing and running the application 342


C application build script 344


13.2 Solving the problem with dynamic linking 344
Android system libraries 345 Building a dynamically linked

application 346 exit() versus return() 349 Startup


■ ■

code 350
13.3 What time is it? The DayTime Server 352
DayTime Server application 352 daytime.c 353

The SQLite database 355 ■ Building and running the


DayTime Server 358
13.4 Daytime Client 360
Activity 360 ■ Socket Client 361 ■ Testing the Daytime
Client 362
13.5 Summary 362
CONTENTS xiii

PART 4 THE MATURING PLATFORM ...............................365

14 Bluetooth and sensors


14.1
367
Exploring Android’s Bluetooth capabilities
Replacing cables 369 Primary and secondary roles and

368

sockets 369 Trusting a device 370 Connecting to a remote


■ ■

device 372 Capturing Bluetooth events 374 Bluetooth


■ ■

permissions 375
14.2 Interacting with the SensorManager 375
Types of sensors 376 Reading sensor values
■ 377
Enabling and disabling sensors 378
14.3 Building the SenseBot application 379
User interface 380 Interpreting sensor values 382

Driving the robot 383 Communication with the robot


■ 384
14.4 Summary 385

15 Integration
15.1
387
Understanding the Android contact model 388
Choosing open-ended records 388 Dealing with multiple ■

accounts 390 Unifying a local view from diverse remote


stores 392 Sharing the playground 393


15.2 Getting started with LinkedIn 393


15.3 Managing contacts 395
Leveraging the built-in contacts app 395 Requesting operations ■

from your app 398 Directly reading and modifying the contacts

database 399 Adding contacts 400


15.4 Keeping it together 403


The dream of sync 403 Defining accounts 404

Telling secrets: The AccountManager service 405


15.5 Creating a LinkedIn account 406
Not friendly to mobile 406 ■ Authenticating to LinkedIn 407
15.6 Synchronizing to the backend with SyncAdapter 414
The synchronizing lifecycle 414 ■ Synchronizing LinkedIn
data 414
15.7 Wrapping up: LinkedIn in action 417
Finalizing the LinkedIn project 417 ■ Troubleshooting tips 418
Moving on 419
15.8 Summary 419
xiv CONTENTS

16 Android web development


16.1
421
What’s Android web development? 422
Introducing WebKit 422 ■ Examining the architectural
options 423
16.2 Optimizing web applications for Android 424
Designing with mobile in mind 424 Adding the viewport ■

tag 426 Selectively loading content 428 Interrogating the


■ ■

user agent 428 The media query 429 Considering a made-


■ ■

for-mobile application 430


16.3 Storing data directly in the browser 431
Setting things up 432 Examining the code 433 The user
■ ■

interface 433 Opening the database 435 Unpacking the


■ ■

transaction function 436 Inserting and deleting rows 438


Testing the application with WebKit tools 439


16.4 Building a hybrid application 440
Examining the browser control 440 Wiring up the control 441

Implementing the JavaScript handler 443 Accessing the code ■

from JavaScript 445 Digging into the JavaScript 445


Security matters 447 Implementing a WebViewClient 448


Augmenting the browser 448 Detecting navigation events 449


Implementing the WebChromeClient 452


16.5 Summary 453

17 AppWidgets 454
17.1 Introducing the AppWidget 455
What’s an AppWidget? 455 ■ AppWidget deployment
strategies 457
17.2 Introducing SiteMonitor 458
Benefits of SiteMonitor 458 ■ The user experience 459
17.3 SiteMonitor application architecture 462
Bird’s-eye view of the application 462 ■ File by file 464
17.4 AppWidget data handling 465
17.5 Implementing the AppWidgetProvider 469
AppWidgetProvider method inventory 469 Implementing ■

SiteMonitorWidgetImpl 470 Handling zombie widgets 472


17.6 Displaying an AppWidget with RemoteViews 473


Working with RemoteViews 473 ■ UpdateOneWidget
explained 474
CONTENTS xv

17.7 Configuring an instance of the AppWidget 476


AppWidget metadata 477 Working with Intent data
■ 478
Confirming widget creation 479
17.8 Updating the AppWidget 480
Comparing services to alarms 481 ■ Triggering the update 482
Updating the widgets, finally! 484
17.9 Tying it all together with AndroidManifest.xml 488
17.10 Summary 489

18 Localization
18.1
491
The need for localization 492
18.2 Exploring locales 493
18.3 Strategies for localizing an application 494
Identifying target locales and data 494 Identifying and■

managing strings 495 Drawables and layouts 497


Dates, times, numbers, and currencies 498 Working with ■

the translation team 499


18.4 Leveraging Android resource capabilities 500
More than locale 500 ■ Assigning strings in resources 500
18.5 Localizing in Java code 502
18.6 Formatting localized strings 503
18.7 Obstacles to localization 504
18.8 Summary 505

19 Android Native Development Kit


19.1 Introducing the NDK
Uses for the NDK 507 ■
507
506

Looking at the NDK 508


19.2 Building an application with the NDK 509
Demonstrating the completed application 510
Examining the project structure 511
19.3 Building the JNI library 512
Understanding JNI 512 Implementing the library 513

Compiling the JNI library 518


19.4 Building the user interface 519
User interface layout 519 ■ Taking a photo 521
Finding the edges 523
xvi CONTENTS

19.5 Integrating the NDK into Eclipse 524


19.6 Summary 526
appendix A Installing the Android SDK 527
appendix B Publishing applications 538
index 551
preface
When we set out to write the first version of this book, many friends and family won-
dered just what this Android thing was all about. Now, two years after the publication
of the first edition, Android is nearly a household term.
The first edition of the book, Unlocking Android, enjoyed enough success that we
were privileged to have the opportunity to write this second edition, renamed as
Android in Action. The first thirteen chapters of the book have been refreshed and/or
rewritten to bring the content up to date with Android 2.2+. Six chapters were added,
bringing in more topics of interest that stray from the simplistic but are still within the
realm of instructional and informational. The new content extends beyond the basics
of Android development, including some topics that I’ve envisioned for a long time
but lacked the proper platform to bring them to fruition. We could have written many
more chapters, but we had to draw the line somewhere!
The second edition of this book was written by Frank Ableson, Robi Sen, and Chris
King. Chris updated chapters 4, 5, 7, and 11. Some excellent content originally writ-
ten by Charlie Collins remains in this second edition. Early on in the project Chris
and I were discussing the need to bring social networking into the book. Chris exam-
ined the available social networks and came back with a clever mechanism to integrate
the Android contacts database with the popular business networking service
LinkedIn. His work is shown in chapter 15, “Integration.” The application from chap-
ter 15 is available as a free download in the Android Market.
Robi updated his chapters on notifications, graphics, and media, while I focused
on some new content areas of interest, including Bluetooth communications, sen-
sors, localization, AppWidgets, native development in C, and web development for
Android.

xvii
xviii PREFACE

In addition to the LinkedIn application from chapter 15, two more applications
from this book are available in the Market as free downloads. The first is SenseBot—
an application that allows you to drive a LEGO Mindstorms-powered robot by tilting
your phone. The application demonstrates both the sensor subsystem of Android, as
well as communicating with Bluetooth. The other application available in the Market
is called FindEdges. FindEdges demonstrates the Android Native Development Kit as
it exercises an image processing algorithm written in the C language.
All in all, writing a book for Android is both exciting and challenging. Android
continues to mature and promises to be a major player for years to come. Many thanks
are owed to readers of the first edition, for without you, there wouldn’t be a second
edition!
FRANK ABLESON
preface to the first edition
The first mobile applications I had the opportunity to work with were inventory con-
trol programs used in retail and manufacturing settings. The “terminals,” as we called
them at the time, were heavy and expensive. They had big antennas, lots of clunky
keys, grayscale LCD displays, and they looked like they came straight from the set of a
science fiction movie.
From that austere beginning, my mobile horizons expanded when the Palm Pilot
became the craze in the mid to late 1990s. My first significant PalmOS project was to
develop an IrDA communications library for an application that printed calendars,
contacts, and task-lists. Back then, the hip printers had an IrDA port and it was cool to
beam your business card to someone. Ironically, I always enjoyed designing and writ-
ing the software more than using the devices themselves.
Fast forward ten years, and I have had the privilege of working on some very chal-
lenging and engaging mobile software projects for numerous clients along the way.
Much of my career to date can be traced back to relationships stemming from my
early mobile development experiences—and what a blessing it has been for me. I just
love the question, “would it be possible to…?” And more often than not, the answer
has been “Yes!” What I particularly enjoy is helping change the way a business operates
or the way problems are solved through the application of mobile software. Mobile
technology can and will continue to change the way we live, work, and play…and this
brings me to Android and this book.
In the fall of 2007, I was speaking with my friend Troy Mott, who happens to be an
editor for Manning, the publisher of this book. Troy and I were discussing the mobile
marketplace, something we’ve been doing for years. We started kicking around the

xix
xx PREFACE TO THE FIRST EDITION

idea of writing a book on Android. The challenge was that Android didn’t really exist.
Yet. We knew from some of the preliminary information that the platform promised to
be open, capable, and popular. We felt that those ingredients could make for an inter-
esting and valuable topic, so we began thinking about what that book might look like,
taking it on faith that the platform would actually come to fruition.
Before long, we convinced ourselves (and Manning) that this was a good idea and
the work began in early 2008. Beyond the usual challenges of putting a book together,
we had the additional obstacle that our subject matter has been in a steady, though
unpredictable, state of change over the past year. In essence, we’ve written this book
twice because the SDK has been changed multiple times and Android-equipped
phones have become available, accelerating the interest and demand for the plat-
form. Every time a significant change occurred, we went back and revisited portions of
the book, sometimes rewriting entire chapters to accommodate the latest develop-
ments in the Android platform.
I say “we” because in the process of writing this book, Troy and I decided to share
the fun and brought in two experienced authors to contribute their expertise and
enthusiasm for this platform. It has been a pleasure getting to know and working with
both Charlie Collins and Robi Sen. While I focused on the first and third parts of the
book in the first edition, Charlie and Robi wrote part 2, which covers the important
fundamentals of writing Android applications. Thanks to their contributions, I
enjoyed the freedom to express my vision of what Android means to the mobile space
in the first part of the book, and then to work on a couple of more advanced applica-
tions at the end of the book.
We hope that you enjoy reading this book and that it proves to be a valuable
resource for years to come as together we contribute to the future of the Android
platform.
FRANK ABLESON
acknowledgments
Perhaps the only thing more challenging than writing a technical book is writing the
second edition. There is a lot of excitement when writing the proposed table of con-
tents for the updated edition but at some point the work must commence. The size and
scope of this project meant working together as a team from the start. I had the privi-
lege of working again with Robi Sen from the first edition and also with experienced
developer and writer Chris King. Along with the help of the talented team at Manning,
we are pleased to present Android in Action, the update to Unlocking Android.
In particular, we’d like to acknowledge and thank those at Manning who helped
bring this book about. First, thanks to Troy Mott, our acquisition and development
editor, who has been involved in every aspect of both the first and second editions.
Troy was there from the beginning, from the “what if” stages, through helping push us
over the goal line—twice! Karen Tegtmeyer did all the big and little things to bring
the project together; Mary Piergies skillfully piloted the team through the harrowing
production process; and Marjan Bace, our publisher, showed an attention to detail at
once challenging, beneficial, and appreciated.
Once the writing was done, the next round of work began and special thanks need
to go to: Benjamin Berg who performed the pre-production editing pass, Joan Celmer
and Liz Welch, our copyeditors, who made our content readable in cases where it
went either “too geek” or where the geek in us tried to be “too literary;” Elizabeth
Martin, our proofreader, who added common sense to the project, as well as a terrific
sense of humor and encouraging attitude; Janet Vail who jumped in at the last minute
to help us bring the final pieces of the project together; and finally Dottie Marsico
who handles the actual layout of the pages. It is sometimes hard to envision the final

xxi
Discovering Diverse Content Through
Random Scribd Documents
The Project Gutenberg eBook of Stories
Pictures Tell. Book 8
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: Stories Pictures Tell. Book 8

Author: Flora L. Carpenter

Release date: September 23, 2020 [eBook #63278]


Most recently updated: October 18, 2024

Language: English

Credits: Produced by David Garcia, Larry B. Harrison, Barry


Abrahamsen, and the Online Distributed Proofreading
Team
at https://www.pgdp.net (This book was produced
from images
made available by the HathiTrust Digital Library.)

*** START OF THE PROJECT GUTENBERG EBOOK STORIES


PICTURES TELL. BOOK 8 ***
STORIES PICTURES TELL
STORIES
PICTURES TELL
BOOK EIGHT

By
FLORA L. CARPENTER
Instructor in drawing at Waite High
School, Toledo, Ohio
Formerly supervisor of drawing,
Bloomington, Illinois

Illustrated with Half Tones


from
Original Photographs
RAND McNALLY &
COMPANY
CHICAGO NEW YORK
Copyright, 1918
By Rand McNally & Co.
THE CONTENTS
September and October
PAGE
“The Death of General West 1
Wolfe”
“Portrait of the Artist’s Whistler 16
Mother”

November, December, and January

Mural Decorations and 27


Fresco
“The Frieze of the Sargent 29
Prophets”
“The Holy Grail” Abbey 57

February and March

“The Wolf Charmer” La Farge 79


American Illustrators 92
“Evangeline” Taylor 97

April, May, and June

Cartoons and Caricatures 108


Engravings, Etchings, 120
and Prints
Lithography 123
Review of Pictures and
Artists Studied

The Suggestions to 125


Teachers
THE PREFACE
Art supervisors in the public schools assign picture-study work in
each grade, recommending the study of certain pictures by well-
known masters. As Supervisor of Drawing I found that the children
enjoyed this work but that the teachers felt incompetent to conduct
the lessons as they lacked time to look up the subject and to gather
adequate material. Recourse to a great many books was necessary
and often while much information could usually be found about the
artist, very little was available about his pictures.
Hence I began collecting information about the pictures and
preparing the lessons for the teachers just as I would give them
myself to pupils of their grade.
My plan does not include many pictures during the year, as this is
to be only a part of the art work and is not intended to take the
place of drawing.
The lessons in this grade may be used for the usual drawing
period of from twenty to thirty minutes, and have been successfully
given in that time. However, the most satisfactory way of using the
books is as supplementary readers, thus permitting each child to
study the pictures and read the stories himself.
Flora L. Carpenter
STORIES
PICTURES TELL
THE DEATH OF GENERAL WOLFE
Questions to arouse interest. What is represented in this
picture? What have these men been doing? What makes you think
so? Why have they stopped? What can you see in the distance? Do
you think the soldier running toward the group in the foreground is
the bearer of good or bad news? What makes you think so? How
many of you can tell what battle has just been fought, or something
about General Wolfe?

Original Picture: Grosvenor House, London, England.


Artist: Benjamin West.
Birthplace: Springfield, Pennsylvania.
Dates: Born, 1738; died, 1820

The story of the picture. It is little wonder that the artist,


Benjamin West, who overcame so many obstacles to follow his
chosen calling, should admire a man like General Wolfe, who also
had a great many difficulties to overcome. Each was born with an
overwhelming desire,—the one to be a great artist; the other to be a
great soldier. Both achieved their desire through their own earnest
and praiseworthy effort. Perhaps the greatest difficulty James Wolfe
had to contend with was his poor constitution and constant ill health.
He could scarcely endure the long marches by land or voyages by
sea—yet he would shirk neither. Duty to his country was always first.
He was only sixteen years old when he took part in his first
campaign. Abbé H. R. Casgrain tells us: “He was then a tall but thin
young man, apparently weak for the trials of war. Moreover, he was
decidedly ugly, with red hair and a receding forehead and chin,
which made his profile seem to be an obtuse angle, with the point at
the end of his nose. His pale, transparent skin was easily flushed,
and became fiery red when he was engaged in conversation or in
action. Nothing about him bespoke the soldier save a firm-set mouth
and eyes of azure blue, which flashed and gleamed. With it all,
though, he had about his person and his manner a sympathetic
quality which attracted people to him.” Although a severe illness
compelled him to give up this first campaign and return home, Wolfe
was by no means discouraged, and he later on managed to
distinguish himself for his courage and military skill.
It was not long after this that the great William Pitt decided that
Wolfe was a man to be trusted with great things. He appointed him
commander of the English troops to be sent against Quebec.
American history had just reached the period when all the English
colonies had been founded except Georgia, and the long struggle
had come between France and England for the possession of
Canada.
There were many older generals who thought they ought to have
been appointed to the important command in place of Wolfe, and
when the elated Wolfe made some wild boasts in their presence,
they were quick to carry them to the king and to declare that James
Wolfe was a mad fool, and not fit to command. But King George III
liked Wolfe none the less for his enthusiasm, and declared that if
“General Wolfe be mad, he hoped he would bite some of his
generals.”
But even Wolfe’s enthusiasm could not break down the strong
fortification at Quebec. The city was located on a high, rocky cliff in
itself almost inaccessible, and the natural strength of the position
was increased by the strong defense maintained by the French
soldiers and the Indians. Wolfe spent the entire summer trying to
find a way to take Quebec, and probably would not have succeeded
but for a combination of circumstances which left one part of the
cliff unprotected.
With the aid of a telescope, General Wolfe had discovered a
hidden pathway up the side of the cliff behind the city at a point
which was lightly guarded. Then came a deserter from the French
army who informed him that the French were expecting some
provision boats that night.
Without hesitation, General Wolfe ordered thirty-six hundred of his
soldiers to prepare for the assault. Under cover of night, flying a
French flag and with the aid of those of his generals who spoke
French, Wolfe and his soldiers managed to sail past the sentry and
enter the harbor in the guise of the French provision boats. In
absolute silence they sailed up the river and landed at a spot since
called “Wolfe’s Cove.” The ascent up the steep hill side was difficult
but soon accomplished, and the few guards killed or taken prisoners.
All the British soldiers successfully gained the heights and the next
morning General Wolfe lined them up for battle on a field called the
“Field of Abraham” after the name of its owner.
The French commander, Montcalm, surprised at the presence of
the enemy on his own shore, went to meet them hurriedly and
without proper support. A fierce battle ensued in which the English
were victorious, and the French fled. General Wolfe was wounded
three times in this battle, the last time fatally. Even then he called
out to those nearest him, “Support me; let not my brave fellows see
me fall. The day is ours; keep it.”
In our picture we see General Wolfe half supported on the ground,
with his friends about him. At the left is the messenger who, history
tells us, bore the news, “They run; see how they run!” The dying
general heard the words and asked, “Who run?” Upon hearing the
answer, “The enemy,” he exclaimed, “Now God be praised. I will die
in peace.”
This victory not only gave Canada to England, but established the
permanent supremacy of the English-speaking race in North
America. Is it any wonder, then, that Benjamin West, a good
American colonist, should be interested in this battle and wish to
paint a picture of it?
He started it with great enthusiasm, and soon had the figures
sketched in, ready to paint. West was then living in London, and
Archbishop Drummond, happening in his studio at this time, was
greatly shocked because West had dressed his men in costumes
such as they actually wore. Strange as it seems to us now, it was the
custom then to use classic models for everything, and to represent
all figures as wearing Greek costumes, no matter in what period
they lived. If we remember Benjamin West for no other reason, we
shall remember him because he was the first in England and
America to change this custom. He believed we should paint people
just as they are. The archbishop tried to dissuade him from this, and
failing, he asked Sir Joshua Reynolds to talk to West.
Finally King George III heard of the artist’s intention and sent for
him. West listened to the king with great respect, and then replied:
“May it please your Majesty, the subject I have to represent is a
great battle fought and won, and the same truth which gives law to
the historian should rule the painter. If instead of the facts of action
I introduce fictions, how shall I be understood by posterity? The
classic dress is certainly picturesque, but by using it I shall lose in
sentiment what I gain in external grace. I want to mark the time,
the place, and the people; to do this I must abide by the truth.”
The king could not fail to be convinced by so sensible an answer,
yet he would not buy the picture. When Sir Joshua Reynolds came to
look at the finished picture he praised it unreservedly, and not only
told the artist it would be popular but predicted that it would lead to
a revolution in art. His prediction was soon fulfilled.
King George III also greatly admired the painting, and said,
“There! I am cheated out of a fine canvas by listening to other
people. But you shall make a copy of it for me.”
And yet the critics tell us that West, with all his love for truth in
dress, took even a greater artist’s license when he painted this
picture. He represented men as standing near Wolfe (the two
generals, Monckton and Barré) who were not there at all. These two
men were fatally wounded in the same battle, but in another part of
the field. Surgeon Adair, too, who is bending over the dying hero,
was in another part of the country at the time. The Indian warrior,
who intently watches the dying general to see if he is equal to the
Indian in fortitude and bravery, was, it is claimed, an imaginary
person.
But a far greater number of critics uphold West and consider his
painting the more valuable because he has brought into prominence
a number of the important men of that time, and linked their names
in memory with that of General Wolfe and with the cause they
represented.
It is interesting to note the manner in which the artist has
grouped his figures in the foreground. We can separate them into at
least three distinct groups, each complete in itself, yet held together
by the direction of their gaze and the position of their bodies. For a
moment these brave men have forgotten, in grief at the loss of a
beloved companion and hero, even the joy of victory for a great
cause.
The interest is centered about the dying general in many different
ways—the light, the position of other figures, the direction of their
gaze, and his position in the picture. Our attention and interest
might remain with the group in the foreground of the picture but
that it is drawn, for a moment, to the figure in the middle distance
running toward us and from that figure to the mass in the
background which, though vaguely outlined, is still distinct enough
to give us the impression of troops in action.
Questions to help the pupil understand the picture. Why
did the life of General Wolfe appeal so strongly to the artist
Benjamin West? What great obstacles did General Wolfe have to
overcome? Tell about his first campaign. Describe his personal
appearance. Why did William Pitt choose Wolfe for an important
office? What feeling did this cause among the other generals? What
did George III say about General Wolfe? Explain the difficulties to be
overcome in capturing Quebec. How did the English effect a landing?
Where was the battle fought? Which army was victorious? What
events aided the English in gaining this victory? What new idea did
West introduce in this picture? Who opposed him at first? To what
did this change lead? What can you say of the composition of this
picture? What is its value as history?

The story of the artist. “What is thee doing, Benjamin?” A small


boy, hearing this question, suddenly becomes quite confused and
embarrassed as he tries to cover up a sheet of paper he has in his
hand. His mother and sister, dressed in the severely plain clothing of
the Quakers, are standing behind him, waiting for an answer. The
boy looks up timidly, his face turning red as he answers hesitatingly,
“N-nothing.”
Of course this does not satisfy his mother, and she speaks more
sharply as she asks him again what he is doing and what he has in
his hand. The boy, a little fellow of six, hands her a sheet of paper
and nervously rocks the cradle in which his baby sister is sleeping.
He expects to be punished, for he has done something that must be
wrong, for he never heard of any one else doing it.
The mother and sister study the paper carefully, and find only a
drawing done in red and black ink. They recognize it at once as a
picture of the baby sister Sally, sound asleep, and they are pleased
in spite of themselves. The mother asks him many questions, and he
tells her that as he was taking care of his baby sister he had
suddenly felt a great desire to copy the sleeping child’s face. He had
found an old quill pen and some ink, and they could see what he
had been doing. The mother looks pleased, but says, “I do not know
what the Friends would say to such like.” However, Benjamin feels
encouraged, and determines to try again soon.
This story is often told in giving the history of American art,
because this same Benjamin West was our first native American
artist. Other American men had copied European paintings, but his
was the first original work in America.
Benjamin’s grandfather came to America with William Penn, the
two being intimate friends. Later the West family moved to the small
town of Springfield, Pennsylvania, where, in 1738, the grandson
Benjamin was born, growing up under the stern observances of an
early Quaker home. His father kept a small store, but the family was
a large one and many hardships had to be endured in those early
days.
At the age of seven Benjamin began to attend the village school.
You will remember that the Indians remained very friendly after their
treaty with William Penn, and that in those days they often came to
visit and trade with the settlers. The boys in this little school always
looked forward to these visits, as they liked to talk with the Indians
in sign language and to trade with them for bows and arrows and
other curious things the Indians made.
They came one day when Benjamin had been drawing some birds
and flowers on his slate. When shown the sketches they grunted
their approval and the next time they came the big chief brought
Benjamin some red and yellow paint, the kind they used to decorate
their bodies.
How delighted Benjamin was as he ran home with his colors; but
what could he do without blue? Then his mother remembered the
bluing she used for her clothes, and gave him a piece of indigo. Now
he must have a brush. You have probably heard of how he cut the
fur from the tip of the cat’s tail, and so made a very good brush,
although it did not last long. This made it necessary for him to cut so
much fur that the cat became a sorry sight indeed. Benjamin’s father
thought it must have some disease and was about to chloroform it,
when his son told him the true state of affairs.
Not long afterwards an uncle who was a merchant in Philadelphia
sent Benjamin a complete painter’s outfit,—paints, brushes, canvas,
and all. It is said that the day these came Benjamin suddenly
disappeared from sight and could not be found either at school,
where he should have been, or in any of his favorite haunts.
At last his mother thought of the attic, and there she found him so
busily absorbed in painting his picture that at first he did not hear
her. She had intended to punish him, but, seeing his pictures, she
forgot all else as she said, “Oh, thou wonderful child!”
When the uncle came to visit them he was so delighted he took
Benjamin back with him to Philadelphia, where he could have good
instruction in drawing. At eighteen he began to paint portraits. Then,
after living in New York several years, he traveled extensively in
Europe, finally settling in London, where he remained the rest of his
life.
He became court painter for King George III, and succeeded Sir
Joshua Reynolds as president of the Royal Academy, holding this
position until his death.
Benjamin West caused one complete change in the art of England.
Until his time all art had followed the Greek ideas, the artists using
the Greek costumes for figures of men of all periods. West believed
we should paint people just as they are, so he dressed his people in
the costumes of the day. At first, of course, he was criticized
severely, but soon all the artists were following his example.
Benjamin West became the founder of a school of his own, to which
young artists from both America and England went for help and
encouragement. Although he spent the last years of his life in
England, Benjamin West always remained a patriotic American.
The first few painters of note who followed Benjamin West were
greatly influenced by him. The list of prominent American artists is
constantly increasing. J. Walker McSpadden, in his book called
Famous Painters of America, has classified a few of the most
prominent in a way that may help us remember them:
Benjamin West, the painter of destiny.
John Singleton Copley, the painter of early gentility.
Gilbert Stuart, the painter of presidents.
George Inness, the painter of nature’s moods.
Elihu Vedder, the painter of the mystic.
Winslow Homer, the painter of seclusion.
John La Farge, the painter of experiment.
James McNeill Whistler, the painter of protest.
John Singer Sargent, the painter of portraits.
Edwin Austin Abbey, the painter of the past.
William M. Chase, the painter of precept.

Questions about the artist. Who was the first American artist
of note? Where was he born? Of what faith were his parents? Relate
the circumstances which led to Benjamin West’s first drawing, and
the result. How old was he at that time? How did he secure his first
paints? his brushes? What gift did his uncle send him? What became
of Benjamin the day this gift was received? What did his mother
say? Where did he go to study art? In what way did he change art in
England? What school did he establish? Name five other American
artists, and tell why they are famous.

To the Teacher: Several pupils may prepare the subject-matter


as suggested here, then tell it to the class. Later, topics may be
written upon the blackboard and used as suggestive subjects for
short compositions in English.
1. Relate an incident in the life of Benjamin West that persuaded
his parents he would be an artist.
2. Explain some of the difficulties he had to overcome in order to
paint.
3. What preparation did he make to become an artist?
4. In what ways was he of special benefit to the world of art?
5. Tell something of the progress of American painting from that
time to this.
PORTRAIT OF THE ARTIST’S
MOTHER
Questions to arouse interest. What is the name of this picture?
Who painted it? Half close your eyes and tell what part of the picture
stands out most distinctly. Which part should be most distinct? (The
figure, especially the head, holds the center of interest.) From this
glimpse of her, describe the character and disposition of Whistler’s
mother as you would judge them to be. Give reasons. What would
make you think she was neat and orderly? Where is she sitting? How
is she dressed? What can you see in the background?

Original Picture: Luxembourg Gallery, Paris, France.


Artist: James McNeill Whistler.
Birthplace: Lowell, Massachusetts.
Dates: Born, 1834; died, 1903.

The story of the picture. Whistler called this picture “An


Arrangement in Gray and Black,” for he felt that the public could not
be interested in a portrait of his mother. He said, “To me, it is
interesting as a picture of my mother; but what can or ought the
public to care about the identity of the portrait?” However, this
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like