0% found this document useful (0 votes)
9 views

Download Complete Android Programming In Java Starting with an App 3rd Edition James PDF for All Chapters

The document provides information about various eBooks available for download, focusing on Android programming in Java and Kotlin, along with other programming and philosophical titles. It highlights the features of the third edition of 'Android Programming in Java: Starting with an App' by Mike James, which covers essential concepts and tools for Android development using Android Studio. The book aims to teach not just the 'how' but also the 'why' of Android programming, emphasizing the importance of understanding the system for effective app development.

Uploaded by

percemagonig
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
0% found this document useful (0 votes)
9 views

Download Complete Android Programming In Java Starting with an App 3rd Edition James PDF for All Chapters

The document provides information about various eBooks available for download, focusing on Android programming in Java and Kotlin, along with other programming and philosophical titles. It highlights the features of the third edition of 'Android Programming in Java: Starting with an App' by Mike James, which covers essential concepts and tools for Android development using Android Studio. The book aims to teach not just the 'how' but also the 'why' of Android programming, emphasizing the importance of understanding the system for effective app development.

Uploaded by

percemagonig
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/ 41

Download the Full Version of the Ebook with Added Features ebookname.

com

Android Programming In Java Starting with an App


3rd Edition James

https://ebookname.com/product/android-programming-in-java-
starting-with-an-app-3rd-edition-james/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Android Programming in Kotlin Starting With An App 1st


Edition James

https://ebookname.com/product/android-programming-in-kotlin-starting-
with-an-app-1st-edition-james/

ebookname.com

Android Game Programming For Dummies 1st Edition Derek


James

https://ebookname.com/product/android-game-programming-for-
dummies-1st-edition-derek-james/

ebookname.com

Essential App Engine Building High Performance Java Apps


with Google App Engine 1st Edition Adriaan De Jonge

https://ebookname.com/product/essential-app-engine-building-high-
performance-java-apps-with-google-app-engine-1st-edition-adriaan-de-
jonge/
ebookname.com

Words of wisdom a philosophical dictionary for the


perennial tradition 1st Edition Edition Carlson

https://ebookname.com/product/words-of-wisdom-a-philosophical-
dictionary-for-the-perennial-tradition-1st-edition-edition-carlson/

ebookname.com
Ash Glazes 2nd Edition Phil Rogers

https://ebookname.com/product/ash-glazes-2nd-edition-phil-rogers/

ebookname.com

Spiritually Integrated Psychotherapy Understanding and


Addressing the Sacred 1st Edition Kenneth I. Pargament

https://ebookname.com/product/spiritually-integrated-psychotherapy-
understanding-and-addressing-the-sacred-1st-edition-kenneth-i-
pargament/
ebookname.com

Hard Times Webster s Spanish Thesaurus Edition Charles


Dickens

https://ebookname.com/product/hard-times-webster-s-spanish-thesaurus-
edition-charles-dickens/

ebookname.com

Essentials of Dyslexia Assessment and Intervention 1st


Edition Nancy Mather And Barbara J. Wendling

https://ebookname.com/product/essentials-of-dyslexia-assessment-and-
intervention-1st-edition-nancy-mather-and-barbara-j-wendling/

ebookname.com

Gradience Gradualness and Grammaticalization 1st Edition


Elizabeth Closs Traugott (Ed.)

https://ebookname.com/product/gradience-gradualness-and-
grammaticalization-1st-edition-elizabeth-closs-traugott-ed/

ebookname.com
Pervasive Systems and Ubiquitous Computing 1st Edition A.
Genco

https://ebookname.com/product/pervasive-systems-and-ubiquitous-
computing-1st-edition-a-genco/

ebookname.com
Android Programming In Java:
Starting with an App

Using Android Studio 3

Third Edition

Mike James

I/O Press
I Programmer Library
Copyright © 2017 I/O Press
All rights reserved. This book or any portion thereof may not be reproduced
or used in any manner whatsoever without the express written permission of
the publisher except for the use of brief quotations in a book review.

Mike James Android Programming in Java: Starting with an App


3rd Edition
ISBN Paperback: 978-1871962550
First Printing, 2017
Revision 0

Published by I/O Press www.iopress.info


in association with I Programmer www.i-programmer.info

The publisher recognizes and respects all marks used by companies and
manufacturers as a means to distinguish their products. All brand names and
product names mentioned in this book are trade marks or service marks of
their respective companies and our omission of trade marks is not an attempt
to infringe on the property of others.
In particular we acknowledge that Android is a trademark of Google.

2
Preface

AndroidTM programming is an attractive proposition. There are more Android


users than any other smartphone or tablet and this makes it a potentially huge
market. Android devices are relatively cheap and this makes it suitable for
implementing smaller scale projects. Finally the tools that you need are free
to download and use and you don’t need anyone's permission to get started.
The only difficulty is that Android is a tough system to master. It is easy
enough to get started as Android Studio will build you a Hello World app in a
few minutes, but what you do next is more difficult. You can get a
surprisingly long way in Android programming by simply copying and
pasting code from other programs that roughly do what you want, but the
results are usually unreliable and disappointing. To create a good app there is
no substitute for understanding how the system works and appreciating its
strong points and its limitations.
This book aims not only to show you how common tasks are done in
Android, but to make sure that you understand why they are done in a
particular way. This means covering not just the “what” but also the “why”.
The good news is that this isn’t as difficult as you might expect because
Android does have repeating patterns and ways of doing things and once you
have seen something in action you find it generalizes to components you
haven’t encountered.
This isn’t a book full of complete examples and case studies. In fact the
examples are stripped down to their bare minimum to avoid having to present
lines of irrelevant and repetitious code and to let you see what is essential. It
also isn’t a complete treatment of everything Android. A single book that
covered every aspect of the Android system would be too large to pick up and
carry. Instead it tackles the things you need to know to write a simple app. It
focuses on creating the user interface (UI) because this is what you spend
most of your time working on even if the app in question is sophisticated. At
least 90% of the effort in creating any app goes into building and perfecting
the UI and this makes it the key place to start. In this book you will find out
how to build an app with a single Activity and a UI. If you master this level of
the art then you will find it much easier to push on into unknown territory. I
can’t promise to cover every aspect of the UI but I have tried to include
examples of all of the sorts of techniques you will encounter so that you are
familiar with the way things work in general.

3
This book is at an introductory level as far as Android development goes,
however it isn’t for the complete beginner. It is assumed that you can
program, but not necessarily in Java, which is arguably the most important of
all today’s programming languages and the original language of Android. Java
is a very standard object-oriented language and with the help of comments
that point out where it is significantly different you should find it easy to pick
up as you go along. Finally the development tool used is the latest version of
Android Studio because it doesn’t make sense not to use it or to use anything
else.
This edition has been updated to cover features introduced in Android
Studio 3. In particular, it includes the use of Java 8 and the lambda
expression which greatly simplifies event handling. As well as the latest
Android Studio it also covers ConstraintLaout 1.0.2 which includes Groups
and Barriers as well as a much improved editor.

Mike James
November 2017

This book is a revised and updated version of the series of Android


Adventures With Android Studio on the I Programmer website:
www.i-programmer.info.
There are additional articles on I Programmer that form the basis of the more
advanced books that are still in preparation. After updating and revision,
Android Adventures – Mastering Fragments will be published in print as
Android Programming: Mastering Fragments & Dialogs.
The first draft of Android Programming: Structuring a Complex App, which
goes further into threading, concurrency, life cycle and other topics crucial to
a real world app, is currently work in progress on the website.
To keep informed about forthcoming titles in the Android Programming
series visit the I/O Press website:
www.iopress.info
This is also where you will also find errata, update information to keep up
with changes in Android Studio and Android itself and, most importantly,
the code from the books. You can also provide feedback to help improve
future editions of Android Programming.

4
Table of Contents
Chapter 1
Getting Started With Android Studio 11
The Language Choice........................................................................12
What You Need to Know..................................................................12
Making a Start...................................................................................12
Your First Program............................................................................14
First Look...........................................................................................18
The IDE..............................................................................................19
Basic Project Structure......................................................................19
Anatomy of an Activity.....................................................................20
Hello Layout Designer.......................................................................21
Inspecting the XML...........................................................................26
The Java.............................................................................................26
Getting Started with the Emulator ...................................................28
Summary...........................................................................................31
Chapter 2
Activity and User Interface 33
The MainActivity..............................................................................34
Inside the Activity.............................................................................35
View and ViewGroup........................................................................36
Creating Our First UI.........................................................................37
Properties...........................................................................................41
Events................................................................................................42
Connecting the Activity to the UI.....................................................44
Finding View Objects........................................................................48
Summary ..........................................................................................50
Chapter 3
Building a Simple UI 53
What's in the Palette..........................................................................54
The Button an Example....................................................................56
Positioning – the ConstraintLayout..................................................56
Sizing.................................................................................................64
The Component Tree........................................................................66
A Simple Button Example – Baseline Alignment............................66
Orientation and Resolution..............................................................68
A First App – Simple Calculator.......................................................73
Summary...........................................................................................81

5
Chapter 4
Android Events 83
The Lambda Approach.....................................................................83
Lambda Types...................................................................................85
Using a Lambda to Create an Event handler....................................86
Closure...............................................................................................88
Event Handler Using A Class............................................................89
Using Breakpoints.............................................................................92
Alternative Ways to Handle an Event..............................................93
Implement the Interface in the Activity...........................................94
Anonymous Classes..........................................................................95
Code Folding.....................................................................................98
Which Approach Should You Use?..................................................99
Summary.........................................................................................100
Chapter 5
Basic Controls 101
Basic Input Controls........................................................................101
Button Styles and Properties..........................................................101
All Properties...................................................................................105
Text Fields.......................................................................................107
The onEditorAction Event..............................................................110
CheckBoxes.....................................................................................111
Switches and Toggle buttons..........................................................112
Radio Buttons .................................................................................113
Summary.........................................................................................115
Chapter 6
Working With Layouts 117
Understanding Layouts...................................................................117
Layout Properties............................................................................118
Width and Height............................................................................120
Units................................................................................................120
A Control is Just a Box....................................................................122
Gravity.............................................................................................123
The FrameLayout............................................................................124
LinearLayout....................................................................................126
RelativeLayout.................................................................................130
Summary.........................................................................................134

6
Chapter 7
The ConstraintLayout 135
Automatic Constraints....................................................................136
Manual Constraints.........................................................................140
Bias Constraints...............................................................................143
Chains..............................................................................................145
A Chained Keypad..........................................................................147
Guidelines........................................................................................150
Groups.............................................................................................151
Sizing...............................................................................................152
Barriers............................................................................................157
Constraint Properties......................................................................160
Troubleshooting..............................................................................160
Summary.........................................................................................162
Chapter 8
Programming The UI 163
A UI Library.....................................................................................163
The View.........................................................................................163
Using setContentView.....................................................................164
The ViewGroup...............................................................................166
Programming Layout Properties.....................................................167
The View Hierarchy........................................................................169
XML Layout.....................................................................................169
Inflation Theory..............................................................................170
Finding View objects.......................................................................171
How to Build a UI?..........................................................................172
Summary.........................................................................................173
Chapter 9
Menus – Toolbar 175
Creating a Menu Resource..............................................................175
The Menu Tree................................................................................176
Displaying a Menu..........................................................................178
Using the Toolbar............................................................................179
Creating the App Bar ......................................................................183
Where's My Toolbar?.......................................................................184
Responding to Menu Events...........................................................184
Changing Menus in Code................................................................187
Controlling the Toolbar...................................................................190
Summary.........................................................................................191

7
Chapter 10
Menus – Context & Popup 193
The Context Menu..........................................................................193
Contextual Action Bar.....................................................................196
The Popup Menu.............................................................................200
Summary.........................................................................................203
Chapter 11
Resources 205
Why Use Resources?.......................................................................205
What are Resources?.......................................................................207
Drawables........................................................................................208
Values..............................................................................................211
IDs....................................................................................................212
Accessing Resources in Code – The R Object................................213
Conditional Resources....................................................................214
A Simple Localization.....................................................................218
Android Studio Translation Tools.................................................219
Summary.........................................................................................221
Chapter 12
Bitmap Graphics 223
Android Graphics............................................................................223
The Bitmap......................................................................................223
The ImageView Control..................................................................224
Canvas..............................................................................................225
A First Graphic................................................................................226
Transformations..............................................................................229
A Logical Approach to Transforms................................................232
Setting Your Own Coordinates.......................................................233
Simple Animation...........................................................................234
Timer and Threads..........................................................................236
Listing..............................................................................................241
Summary.........................................................................................243

8
Chapter 13
Life Cycle Of An Activity
Lifetime and State...........................................................................245
The Life Cycle of an App................................................................246
The Simple Approach.....................................................................247
Lifecycle Explorer...........................................................................248
Trying It Out....................................................................................249
Retaining State – the Bundle..........................................................250
Saving Additional UI Data..............................................................252
Complex UI Elements.....................................................................253
Advanced State Management.........................................................254
Summary.........................................................................................255
Chapter 14
Spinners 257
The Spinner and the Designer........................................................257
Introducing the ArrayAdapter........................................................259
Handling the Selection...................................................................261
Creating an ArrayAdapter from a Resource...................................265
Changing The List...........................................................................265
Summary.........................................................................................267
Chapter 15
Pickers 269
Working with Pickers......................................................................269
TimePicker.......................................................................................270
TimePicker in Code.........................................................................271
Updating the Time..........................................................................272
DatePicker........................................................................................273
Number Picker.................................................................................277
Multi-Digit Input.............................................................................281
Summary.........................................................................................285
Chapter 16
ListView 287
Understanding the Adapter............................................................287
Extending the ListAdapter Class....................................................288
Using the ArrayAdapter..................................................................289
Working with the Data....................................................................291
A Custom Layout.............................................................................294
A Custom ArrayAdapter.................................................................297
Reuse, Caching and General Layouts.............................................301
Custom Adapter..............................................................................304
Summary.........................................................................................306

9
Chapter 1

Getting Started With Android Studio

Android represents a big potential market. It is also the most open of the "big"
phone and tablet platforms. You can write a program for an Android and let
your friends have a copy, keep it to yourself or put it on sale in an app store.
Android phones and tablets are comparatively cheap and this makes it easier
to get started. What is even better, all the tools you need to create an Android
app are free. You don't need to pay anything to create, or distribute, your
Android apps. If you want to sell them using a well known marketplace there
may something to pay – there is a one-time fee of $25 to register for Google
Play, but you don't have to use any particular distribution method.
All that stands between you and your Android app is your imagination and
programming ability. I can't do much to improve your imagination, but I can
help with the programming side of things. If you are new to Android
programming this is the place to start.
In this book I will show you the fundamentals of Android programming. Not
the tips and tricks, but how to think about what is going on. You'll be
introduced to the general principles that will make it possible for you to
master anything that you encounter that is new in the future. It isn’t possible
to cover all of Android in one book as the subject is very large. Instead we
focus on the basics of creating a User Interface (UI) as all apps have to have
some way of interacting with a user.
There are many ways to create an Android app but Google's Android Studio is
an easy to use Android IDE – Integrated Development Environment – and it is
now the recommended way of doing the job.
Before Android Studio you had to use the Eclipse IDE and set up the SDK and
other pieces of software needed. This wasn't difficult, but Android Studio
eliminates extra steps and it makes programming Android easy. Put simply, it
is the way of the future and so worth your investment in learning it.
With the release of Android Studio Google stopped work on the Eclipse
plugin and this means that Android Studio really is the only way to develop
apps from now on.
You can get started in a few minutes and by the end of this chapter, have your
first working Android application.

11
The Language Choice
With the release of Android Studio 3 you now have a choice of programming
in Java or Kotlin. The advantage of Java is that it is a well known and well
supported language. In Android Studio 3 you can also program using features
from Java 8 including lambda functions. This greatly simplifies tasks such as
event handling and, while we will examine how to do event handling in Java
without lambda functions, using them is going to be the norm.
As the entire Android library is written in Java you really can’t avoid it. The
alternative language Kotlin is very easy to use and backwards compatible
with Java. There is very little risk in using it, but it is also helpful to know
enough Java to work with existing code.
The bottom line is that while Kotlin is an easier language to use, there are
advantages in knowing and using Java.

What You Need to Know


To get the most out of this book you need to be able to program in a modern
object-oriented language. You’ll have a head start if you already know some
Java, but C++, C#, Visual Basic or anything similar are close enough in spirit
to Java for you to be able to cope. You might well need to look things up
about the specifics of particular features of Java, but most of the time it
should be obvious, or obvious with the help of a few comments.
It isn't necessary to be an expert programmer because for a lot of Android
programming you are simply using the features and facilities provided. That
is, a lot of Android programming is just a matter of following the rules.
However, if you hope to produce something unique and useful you will at
some point have to add something of your own – and here creativity and skill
are required. So you might not need to be an expert programmer to get
started, but you need to become one by the time you create your amazing app.
Fortunately practice is a good teacher and so learning to make the most of
Android Studio will actually help you learn to code.

Making a Start
I'm not going to spend a lot of time explaining how to install Android Studio
in a step-by-step way as the Android website does a good job and it is more
likely to be up-to-date. It is worth, however, going over the basic principles.
Download the Android Studio package from Android Studio Home page:
https://developer.android.com/studio/
Install Android Studio which also installs all of the Android SDK and tools
you will need.

12
Windows:
1. Launch the downloaded EXE file,
android-studio-bundle-<version>.exe.
2. Follow the setup wizard to install Android Studio.
Mac OS X:
1. Open the downloaded DMG file,
android-studio-bundle-<version>.dmg
2. Drag and drop Android Studio into the Applications folder.
Linux:
1. Unpack the downloaded ZIP file,
android-studio-bundle-<version>.tgz,
into an appropriate location for your applications.
2. To launch Android Studio, navigate to the
android-studio/bin/
directory in a terminal and execute studio.sh. You may want to add
android-studio/bin/
to your PATH environmental variable so that you can start Android
Studio from any directory.
Accept any defaults that the setup program offers you – unless you have a
good reason not to. It installs not only Android Studio, but the SDK and the

13
virtual device system that lets you test your application. In most cases
Android Studio just installs with no problem.
Now you should be able to run Android Studio. If not the most likely cause of
the problem is the JDK and so re-installation is a best first option.

Your First Program


You can opt to start Android Studio after the installation. You will probably
not get straight to Android Studio the first time it starts as it downloads
updates to itself and to the Android SDK. You just have to be patient.
When it finally gets going you will see the Android Studio welcome screen:

If you have already created some programs you might well see them listed in
Recent projects.

14
Assuming this is your first project select the option:
Start a new Android Studio project

You can ignore the details of the new project for the moment. All you have to
do is supply a name for your application - HelloWorld in this case. Make sure
you uncheck the Include Kotlin support option as you want to make use of
Java. Accept the other defaults that Android Studio has filled in for you.
When you click Next you are given the chance to pick what devices you are
targeting. Again simply accept the defaults:

15
Exploring the Variety of Random
Documents with Different Content
broke ranks and in wild enthusiasm greeted each other as long lost
friends. The song they sang is probably seven hundred years old or
older.
(1) Songs of Childhood, Games and Cradle Songs

From the day of the obelisk to the day of the radio, every baby that
has ever been born has been put to sleep to the soothing sound of the
mother’s song. The Greek mother sang to her baby,
Come, Sleep! come, Sleep! Take him away.
Come, Sleep, and make him slumber.
Carry him to the vineyard of the Aga,
To the Garden of the Aga,
The Aga will give him grapes; his wife, roses; his servant, pancakes.

Many early lullabies were sung in honor of the infant Jesus, which
really gives them a very blesséd beginning. It is related by a Sicilian
poet “When the Madunazza (mother) was mending St. Joseph’s
clothes, the Bambineddu (Bambino—the Infant Jesus) cried in his
cradle, because no one was attending to Him. So the Archangel
Raphael came and rocked Him and said these sweet little words to
Him, ‘Lullaby, Jesus, Son of Mary.’”
The Indians, too, sang lullabies, for you know the squaw is a gentle
soul and takes beautiful care of her papoose. The Chippewas think of
sleep as a big insect and they have named him Weeng. Weeng comes
down from the top of a tree where he is busy making a buzzing noise
with his wings and puts you to sleep by sending many little fairies to
you who beat your head with tiny clubs!
We all know our own Bye, Baby Bunting, Father’s Gone a
Hunting, etc., and Rockabye Baby on the Tree Top.
The Germans, whose children songs and lullabies are so lovely,
have the familiar Schlaf, Kindlein, Schlaf! It is a sweet name the
Italians give their lullaby, the ninne-nanne! And the mothers in
Lyons, France, call sleep souin-souin and have a charming little
song:
Le Poupon voudrait bien do(r)mir;
Le souin-souin ne peu pas venir.
Souin-souin, vené, vené, vené;
Souin-souin, vené, vené, vené!
The infant wants to go to sleep;
Sleep does not wish to come.
Sleep come, come, come;
Sleep come, come, come!
Games

We all have sung The Farmer in the Dell, London Bridge is Falling
Down, Ring Around the Rosy and many other game-songs. We have
told you of the Indian moccasin game, and we know that in all the
other nations the children have had their game-songs.
(2) Songs for Religious Ceremonies, Holidays, and
Christmas Carols, etc., May Songs and Spring Festivals

Spring is so full of the beginnings of life, and people can see the
flowers begin to bloom and take on color and glory. Even as you and
I, they have never been able to see them without rejoicing and every
one’s rejoicing sooner or later is a cause for music. In many countries
this renewal of life is celebrated by rites and ceremonies that have
been the source of much folk-lore and music.
The Greeks, as early as the 6th Century B.C., celebrated the coming
of the spring with a religious festival named after the god Dionysus.
Many songs and dances accompanied these festivals. On the evening
before the festival, which lasted five days, there was an impressive
procession by torch-light in which an image of the god Dionysus was
carried to the theatre where the festival was held, accompanied by
many handsome youths and a very splendid bull which was
sacrificed.
In the excavations of Crete this ancient hymn has been found,—a
spring song and a young man-song in one:

Ho! Kouros (young man), most Great, I give thee hail, Lord of all that is wet and
gleaming; thou art come at the head of thy Daemones. To Dickte for the year, Oh,
march and rejoice in the dance and song.

In Germany, it was thought that on Walpurgis-nacht (May night)


witches rode on the tails of magpies and danced away the winter
snows on the Brocken, one of the highest peaks of the Hartz
Mountains. In Germany too, it was the custom for children to set
May-flies (Maikäfer) free and to sing this song:
Maikäferchen fliege,
Dein Vater ist in Kriege
Dein Mutter ist in Pommerland
Pommerland ist abgebrannt
Maikäferchen fliege.

or
May-fly, fly away,
Your father is at war,
Your mother is in Pommerland.
Pommerland is all burned up!
May-fly, fly away.

Don’t you think it is like our rhyme?


Lady-bug, lady-bug,
Fly away home.
Your house is on fire
Your children will burn.

And here is the French:


Avril, tu t’en vas!
Car Mai vient la-bas
Pour balayer ta figure
De pluie, aussi de froidure.
Hanneton, vole!
Hanneton, vole!

Au firmament bleu,
Ton nid est en feu,
Les Turcs avec leur èpée
Viennent tuer ta couvée.
Hanneton, vole!
Hanneton, vole!

or:
April, away!
For here cometh May
With sunshine again
To banish the rain.
May-beetle, fly!
May-beetle, fly!

Afar in the sky,


With flames leaping high,
The Turks with swords rude
Have slaughtered your brood.
May-beetle, fly!
May-beetle, fly!
The first comic opera, a pastourale six hundred years old, Le Jeu
de Robin et de Marion by Adam de la Hale, is full of May songs.
The King and Queen of the May and May Pole dancers and the
English Jack-in-the-Green, the Thuringian Little Leaf Man and the
Russian tree dressed up are only a few of the many examples of the
rites of spring. And we have seen how the Druids and the Aztecs
celebrated spring.
One of the most modern composers, Igor Stravinsky, has written a
ballet called Le Sacre du Printemps (Rites of Spring) in which he has
used the ancient Russian pagan rites of celebrating the spring. The
music is wild and the rhythms primitive.
Religious Ceremonies

From legends, we know that songs and dances of the Polish people
accompanied their religious ceremonies before Christianity. When
they exchanged their pagan gods for the teachings of the early
Christian fathers, many of these songs were lost, but some of them
were handed down merely by changing the pagan name to the
Christian. These songs have been traced by the fact that many of
them are based on the old pentatonic scale. The Slavs, the
Lithuanians and the Germanic races have kept this scale in Eastern
and Middle Europe, and the Greeks, the ancient Italians and the
Celts brought it into Western and Southern Europe. These scales are
supposed to have come from Indo-China, for it must not be forgotten
that the Polish along with all Slavs migrated from Asia, the cradle of
the human race.
Two festivals,—St. John’s Eve and Christmas, came down from the
pagan era in Poland and the manner of celebration has changed little
throughout the centuries.
Christmas Carols

The Polish Christmas Carol was also handed down from the days
before Christ. The word “carol” comes from the old French carole
which was a dance, and gave its name to the song by which it was
accompanied. In the pagan time there were summer carols, winter
carols, Easter carols and carols that celebrated a religious winter
festival. As the winter festival occurred about the same time of the
year as the Nativity or birthday of the Saviour, it was celebrated in
the Christian Church as Christmas. In England, the old Yule-tide of
the Druids has influenced the present celebration of Christmas with
its fun, festivities and Christmas trees!
Throughout Germany, Christmas Carols are still sung early every
Christmas morning, and many of the old hymns have thus been
preserved.
The Christmas Carol in France is called Noël and the old English
word was Nowell.
(3) Love Songs

It is safe to say that there are more love songs than any other kind
of folk music, and among them is some of the most beautiful music
in the world. You will find charming folk love songs of every
nationality on earth.
Different countries have different marriage customs which give an
intimate picture of the life in different periods, of countries and
tribes far apart. Again we can trace forgotten relationships in like
customs of bygone days. Singing and dancing are very important in
all marriage celebrations, and some wedding music is of great age.
In Russia, for example, the marriage customs and wedding music
are very beautiful and impressive. At the same time no folk dancing
is wilder or gayer than that celebrating a peasant marriage.
Before going to a wedding ceremony, the Polish bride sings one
particular song built on the pentatonic scale, that has probably been
sung for more than two thousand years! There are other wedding
ceremony songs that can be traced back almost as far.
In Brittany, during the 11th and 12th centuries, the priest
demanded a “nuptial song” from the newly-weds on the Sunday
following the wedding, as a wedding tax!
In another place the feudal lord demanded that every new bride
should dance and sing before him and in return he decorated her
with a bonnet of flowers.
You haven’t forgotten the Indian and his love music played on the
flute, have you?
(4) Patriotic Songs

In the recent World War, we had examples of how folk songs were
made. There were popular songs like Over There (George Cohan),
The Long, Long Trail (by Zo Elliot), Tipperary, Madelon, that were
sung by millions. They were songs of the people, by the people and
for the people, and no one cared who wrote them.
Most of the national hymns and patriotic songs were born in a
time of storm and stress. Words inspired by some special happening
were written on the spur of the moment, and often set to some
familiar tune. America was first sung to the tune of God Save the
King on July 4, 1832. The words of Star Spangled Banner were
written by Francis Scott Key during the War of 1812 as he watched
the bombardment of Fort McHenry in Chesapeake Bay, and was set
to an English drinking song, Anacreon in Heaven. Yankee Doodle, a
song first sung to make fun of the young colonists, became the
patriotic hymn of the Revolution! Where the tune came from is a
mystery, but it shows a family likeness to a little Dutch nursery song,
a German street song, an old English country dance, a folk tune from
the Pyrenees and one from Hungary! But we love our old Yankee
Doodle anyhow! Hail Columbia was adapted to a tune, The
President’s March, which had accompanied Washington when he
was inaugurated, in New York, as our first president.
England’s God Save the King was composed, words and music, by
Henry Carey, and it was used first in 1743 during the Jacobite
uprising. It has since served America, Germany, Denmark and
Switzerland. Auld Lang Syne of Scotland was written by “Bobby”
Burns and set to an old Scotch tune. St. Patrick’s Day was originally
a jig, and The Wearing of the Green was a street ballad of the Irish
rebellion of 1798 mourning the fact that the Irish were forbidden to
wear their national emblem, the shamrock. The Welsh song Men of
Harlech, a stirring tune, dates from 1468.
The French have several thrilling national songs. If you heard
Malbrouk s’en va-t-en guerre (Malbrouk to war is going) you would
say, “Why! that’s For He’s a Jolly Good Fellow.” So it is, and it has
had a long and chequered career. It is supposed to have been brought
into Europe by one of the Crusaders, and was lost for five centuries;
it cropped up again in 1781 when Marie Antoinette sang it to put the
little Dauphin (the French prince) to sleep. Paris picked up the tune
and it was heard in every café and on every street corner. Napoleon
who had no ear for music hummed it. It crossed the English channel.
Even the Arabs sing a popular song like it which they call Mabrooka.
Beethoven used the air in a Battle Symphony (1813).
The stirring hymn of France, is the Marseillaise written by Rouget
de l’Isle (1792) on the eve of the Revolution. It became the marching
song of the French Army and was sung during the attack on the
Tuileries (Paris), the king’s palace. It has always been the Republican
song of France.
In almost every book you read about the French Revolution, La
Carmagnole and Ça Ira are mentioned. They accompanied
thousands of victims to the guillotine. Ça Ira (It will go!) was a
popular dance which Marie Antoinette played on her clavecin. Little
did she know that the same tune would be shouted by the infuriated
mobs as she was driven through the streets of Paris in the tumbril to
the guillotine!
The Italians show their natural love for opera by the fact that their
national hymn is adopted from Bellini’s opera Somnambula.
The Rakoczy March of which you will hear later in the chapter is
the Hungarian national hymn.
We could write an entire book on this subject, but this is only to
give you a suggestion of how these songs grew and where they came
from.
(5) Songs of Work and Labor and Trades

We have shown you the American Indians singing their songs as


they fish and pound the corn; the boatmen rowing to the rhythm of
their songs; and we have tried to show you that everybody loved
songs as much when they worked as when they danced. Haven’t you,
too, hummed or sung while working? People who accompany dish
cloths and dusters with songs work better!
American negroes have used song to ease their work in the hot
sunny fields. They not only sang, but men were hired to sing and act
as song leaders in the slave days, to set the pace for workers, for
more work was done when the slaves moved to the rhythm of music.
In modern factories today, music is used to relieve the drudgery.
In Southern States the stevedores sing as they unload and load
ships. And haven’t you often heard a rhythmic sound uttered by men
hauling ropes on ships or buildings?
The world over, sailors have their songs and dances, farmers their
reaping and planting songs, spinners and weavers their songs,
boatmen songs like those on the Nile and the Volga boat song.
While few Greek folk songs have come down to our time, we know
that they had songs for reaping the harvest, for grinding the barley,
for threshing the wheat, for pressing the grapes, for spinning wool,
and for weaving. They also had the songs of the shoemaker, the dyer,
of the bath-master, the water carrier, of the shepherd, etc.
There are innumerable spinning songs of all nationalities, and
shepherds’ songs,—you probably know the French Il etait une
Bergère.
In Africa, we hear that the workers when cleaning rice were led by
singers, who clapped their hands and stamped their feet to
accompany the song. One man reports that he heard the negro
women singing a national song in chorus, while pounding wheat
always in time with the music.
Charles Peabody tells of a leader in a band of slaves in America
who was besought by his companions not to sing a certain song
because it made them work too hard!
The difference between the negro songs and the labor songs of
other peoples and places is, that the negroes had no special labor
songs but sang their religious songs, which they adapted to all
purposes and occasions, while the true labor song was composed to
fit the occasion.
In old England we hear of the “Labor-lilts” which were all work
songs of spinners, milk-maids and shepherds. And we must not
neglect the old night-watchman whom we meet in Wagner’s Die
Meistersinger. Neither can we let go by unnoticed the “town-crier”
who told the news, good and bad. The street calls and cries of the
Middle Ages were labor songs, later, in England and in France made
into real compositions.
We, in America, have the old Cow-boy songs, the Mining songs of
California, and the Lumberjack songs of Maine. These are not exactly
labor songs but are first cousins to them.
The stage coach postillons with their fascinating horn calls are
really music of trades or occupations, too. Isn’t it too bad that the
inartistic jangle of the tram-car and the “honk-honk” of the
automobile tear our ears instead of the tuneful hunting horns and
postillon horns which are still occasionally heard in European
forests!
The world’s workers sing to make work slip along easily, so you see
song is a great lubricant.
(6) Drinking Songs

In the great dining halls of the Middle Ages, when hunting parties
gathered, and guests were received from near and far, or at
Christmas time, when in old Britain the Wassail-bowl flowed freely,
drinking songs were an important part of the banquet. At the
splendid feasts in Rome, drinking songs were popular. In fact, all
over the world there are thousands of this kind of folk song.
The name Wassail dates back to the day when Vortigern, King of
the Britons, visited Hengist, the Saxon. Rowena, Hengist’s daughter
greeted him with, “Was hail hla, ond cyning!” which mean in plain
English, “Be of health, Lord King!” to which the king replied, “Drink
heil” (Drink health).
The Word Vaudeville

In the second half of the 15th century, two men named Basselin
and Jean de Houx wrote many drinking songs. As they lived in the
little valleys (in French called vaux) near Vire in Normandy, drinking
songs came to be called vaux-de-vire. At the same time, songs that
were sung in the streets, in fact, any folk songs with gay melodies and
light words, were called voix-de-ville, (or voices of the city). So, in
some way, these two terms became mixed, and the familiar word,
vaudeville is the result!
(7) Dancing Songs

In the folk dance, man shows the feelings and dispositions of his
race. From this dance of the people, all music gradually took a
measured form, a rhythmic thing that is lacking in the song of
primitive people. In primitive times, all dances were sung,
particularly was this the case with the Slav race. As instruments were
perfected, they took the place of primitive drums and singing as
accompaniment to the dance.
The plain chant, and in fact all music of the church, lacked the
element we call rhythm. It followed a metre or measure needed by
the words, but this was much more like talking than like singing.
Even the ornamented chant of the soloists in the churches had no
definiteness of time or of phrase.
Rhythm as we feel it today, occurs in two ways,—through the
singing of verses and through dancing. We must not forget that early
peoples were much like children, and took pleasure in jingles, and in
moving their feet and bodies in repeated motions which became
dances.
It is most fascinating to see that the people who have the saddest
songs, have the gayest and wildest dances! Maybe it is because the
sadder the nation the more need it has for some gay way of forgetting
its woes. The Russians, the Poles, the Norwegians and the people of
all north countries where the songs are minor and tragic, have the
wildest dances. The clothes, too, of the folk in these countries are
decked in colored embroideries, and the decorations of the houses
giddy and jolly. When the Russians get together they forget their
sorrows in wild and almost frenzied dances, and directly after they
will sing songs of deepest gloom.
Polish Dances

The Poles have several folk dances that are easily recognized by
their rhythm and style. The great Polish composer Chopin used these
folk dances in some of the loveliest piano music ever written. For
more than six centuries they have been used by Polish composers,
yet there are people who say that folk song has no influence on
musical art.
The Polonaise, in ¾ time, a stately dance of the aristocracy and
nobles rather than of the people, began as a folk dance, and is
supposed to have come from the Christmas Carol. The rhythm of the

Polonaise , is easily recognized and followed.


In the early times, these polonaises had no composer’s tag, but were
often named for some Polish hero, and thus show the date in which
they were born.
One Polish writer dates the “courtly” polonaise from 1573. The
year following the election of Henry III of Anjou, a great reception
took place at Cracow, in which all the ladies of high rank marched in
procession past the throne to the sound of a stately dance. This was
the beginning of the stately polonaise, in which old and young took
part, marching all through the great drawing rooms and gardens.
The Mazurka, another very popular Polish dance, is also in ¾
time, but faster than the polonaise, and slower than the waltz. It is
performed by a few couples at a time, two to eight but rarely more.
The accent of the measure falls on the third beat, which distinguishes
it from a waltz.
Other well known Polish dances are the Krakowiak in ²⁄₄ time, the
Kujawiak in ¾ time, the Obertass in ¾ time, the dance of the
mountaineers, called the Kolomyjka in ²⁄₄ time, and the Kosah in ²⁄₄
time. All these dances are fast, and all of them come directly from
folk songs.
Spanish Dance-Songs

It is very hard to tell which of the Spanish folk pieces are dances
and which at first were songs, because the favorite songs of Spain are
nearly all sung as accompaniments to dancing. Spain had almost as
rich troubadour music as France, because the influence of the
troubadours and of the jongleurs was very strong, Provence being
Spain’s neighbor. In Catalonia the Provençal language has been used
since the 9th century, and the folk music differs from that of other
parts of Spain.
The songs of Spain divide themselves into four groups. The
Basque, the music of Biscay and Navarre, unlike any music of which
we have told you, is irregular in rhythm, melody, and scale, and the
jota is one of its characteristic dances. Galicia and Castile have gay,
bright, strong marked dance rhythms as may be seen from their
characteristic boleros and seguidillas. Andalusian music and that of
Southern Spain is perhaps the most beautiful of all, for here we find
the influence of the Oriental music to a marked degree, in the use of
the scale, in florid ornament, and in the richness of the rhythm; the
dances fandangos, rondeñas and malagueñas are thought to be
finer than the songs. The guitar is the king of instruments in
Andalusia and how Spanish it is! The fourth group of songs is from
Catalonia of French influence and less Spanish than the others.
The Ballad and the Ballet

In the English language we have the word ballad, which means a


long poem in which a story is told. We also use the French word
ballet, for a dance on the stage. These two words come from the same
root, and show that at one time ballads and dance tunes were
practically the same thing.
The English dance song, the “round” or the same dance in France
called the ronde, was a popular dance for many centuries, some of
which are most amusing and curious. One dance tune from the 12th
century has Latin words; there is also a well known tune, Sellenger’s
Round, from the collection called the Fitzwilliam Virginal Book.
Another famous ballad (dance) was Trenchmore, a good sample of
English folk dance at the end of the 16th century:

Trenchmore

An English writer (how childlike was his fun!) in 1621 says of


Trenchmore, “Who can withstand it? be we young or old, though our
teeth shake in our heads like virginal jacks (see page 310), or stand
parallel asunder like the arches of a bridge, there is no remedy; we
must dance Trenchmore over tables, chairs, and stools!”
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!

ebookname.com

You might also like