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

Android for Absolute Beginners - Getting Started with Mobile Apps Development Using the Android Java SDK 1st Edition Grant Allen pdf download

The document is a guide titled 'Android for Absolute Beginners' by Grant Allen, aimed at introducing new developers to mobile app development using the Android Java SDK. It covers essential topics such as setting up Android Studio, creating your first application, and understanding the Android development environment. The book includes practical examples and resources to aid beginners in their learning journey.

Uploaded by

iyaadhudgen
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)
7 views

Android for Absolute Beginners - Getting Started with Mobile Apps Development Using the Android Java SDK 1st Edition Grant Allen pdf download

The document is a guide titled 'Android for Absolute Beginners' by Grant Allen, aimed at introducing new developers to mobile app development using the Android Java SDK. It covers essential topics such as setting up Android Studio, creating your first application, and understanding the Android development environment. The book includes practical examples and resources to aid beginners in their learning journey.

Uploaded by

iyaadhudgen
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/ 44

Android for Absolute Beginners - Getting Started

with Mobile Apps Development Using the Android


Java SDK 1st Edition Grant Allen pdf download

https://ebookmeta.com/product/android-for-absolute-beginners-
getting-started-with-mobile-apps-development-using-the-android-
java-sdk-1st-edition-grant-allen/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Beginning Android 5th Edition Get started building apps


for the Android platform Grant Allen

https://ebookmeta.com/product/beginning-android-5th-edition-get-
started-building-apps-for-the-android-platform-grant-allen/

Android Apps for Absolute Beginners, 4th Edition


Wallace Jackson

https://ebookmeta.com/product/android-apps-for-absolute-
beginners-4th-edition-wallace-jackson/

Android Studio Arctic Fox Essentials Java Edition


Developing Android Apps Using Android Studio 2020 31
and Java Neil Smyth

https://ebookmeta.com/product/android-studio-arctic-fox-
essentials-java-edition-developing-android-apps-using-android-
studio-2020-31-and-java-neil-smyth/

Handbook of Quality of Life for Individuals with Autism


Spectrum Disorder Justin B Leaf Joseph H Cihon Julia L
Ferguson Peter F Gerhardt

https://ebookmeta.com/product/handbook-of-quality-of-life-for-
individuals-with-autism-spectrum-disorder-justin-b-leaf-joseph-h-
cihon-julia-l-ferguson-peter-f-gerhardt/
Xanathar s Guide to Everything Limited Edition 5th
Edition D D Jeremy Crawford

https://ebookmeta.com/product/xanathar-s-guide-to-everything-
limited-edition-5th-edition-d-d-jeremy-crawford/

Bronze Age Monuments and Bronze Age Iron Age Roman and
Anglo Saxon Landscapes at Cambridge Road Bedford 1st
Edition Andy Chapman

https://ebookmeta.com/product/bronze-age-monuments-and-bronze-
age-iron-age-roman-and-anglo-saxon-landscapes-at-cambridge-road-
bedford-1st-edition-andy-chapman/

Archie Goodwin s Office Nero Wolfe Speaking Sandy


Lerner Et El

https://ebookmeta.com/product/archie-goodwin-s-office-nero-wolfe-
speaking-sandy-lerner-et-el/

Visualisation and Epistemological Access to Mathematics


Education in Southern Africa 1st Edition Marc Schäfer

https://ebookmeta.com/product/visualisation-and-epistemological-
access-to-mathematics-education-in-southern-africa-1st-edition-
marc-schafer/

Women in Presidential Cabinets Power Players or


Abundant Tokens 1st Edition Maria C. Escobar-Lemmon

https://ebookmeta.com/product/women-in-presidential-cabinets-
power-players-or-abundant-tokens-1st-edition-maria-c-escobar-
lemmon/
Field guide to the frogs of Australia Second Edition
Michael J Tyler J Dale Roberts

https://ebookmeta.com/product/field-guide-to-the-frogs-of-
australia-second-edition-michael-j-tyler-j-dale-roberts/
Android
for Absolute
Beginners
Getting Started with Mobile Apps
Development Using the Android Java SDK

Grant Allen

WOW! eBook
www.wowebook.org
Android for Absolute
Beginners
Getting Started with Mobile Apps
Development Using the Android Java SDK

Grant Allen

WOW! eBook
www.wowebook.org
Android for Absolute Beginners: Getting Started with Mobile Apps Development
Using the Android Java SDK
Grant Allen
LONDON, UK

ISBN-13 (pbk): 978-1-4842-6645-8 ISBN-13 (electronic): 978-1-4842-6646-5 


https://doi.org/10.1007/978-1-4842-6646-5

Copyright © 2021 by Grant Allen


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Steve Anglin
Development Editor: Matthew Moodie
Coordinating Editor: Mark Powers
Cover designed by eStudioCalamar
Cover image by Dollar Gill on Unsplash (www.unsplash.com)
Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY 10004,
U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.
springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer
Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-6645-8. For more
detailed information, please visit http://www.apress.com/source-­code.
Printed on acid-free paper

WOW! eBook
www.wowebook.org
To all the aspiring new Android developers in the world,
may you have fun while you learn to build new and wonderful applications!

WOW! eBook
www.wowebook.org
Table of Contents
About the Author�����������������������������������������������������������������������������������������������������xv
About the Technical Reviewer�������������������������������������������������������������������������������xvii
Acknowledgments��������������������������������������������������������������������������������������������������xix
Introduction������������������������������������������������������������������������������������������������������������xxi


■Part I: Get Android, Get Started���������������������������������������������������������� 1

■Chapter 1: Introducing Android����������������������������������������������������������������������������� 3
Working with Android: The Best Parts������������������������������������������������������������������������������ 3
Working with Android: The Challenges����������������������������������������������������������������������������� 5
Understanding Android’s Heritage and How It Affects You����������������������������������������������� 6
Understanding Android’s Future��������������������������������������������������������������������������������������� 9
What to Expect for the Rest of This Book������������������������������������������������������������������������� 9
Detailing More of the Remaining Chapters��������������������������������������������������������������������������������������������� 9


■Chapter 2: Introducing Android Studio���������������������������������������������������������������� 13
Understanding What Is Meant by Integrated Development Environment, or IDE������������ 13
The History and Provenance of Android Studio�������������������������������������������������������������� 14
Downloading the Android Studio Installer for Your Platform���������������������������������������������������������������� 14
Working with Android Studio Versions�������������������������������������������������������������������������������������������������� 15
Understanding How Android Studio and the Android SDK Work Together�������������������������������������������� 16

WOW! eBook
www.wowebook.org
vi Table of Contents

Preparing for Android Studio������������������������������������������������������������������������������������������ 16


Choosing Desktop or Laptop Hardware for Android Development�������������������������������������������������������� 16
Choosing the Operating System for Your Computer����������������������������������������������������������������������������� 17
Continuing with Android Studio Setup After Installation����������������������������������������������������������������������� 20

Working with Alternatives to Android Studio������������������������������������������������������������������ 30


Eclipse�������������������������������������������������������������������������������������������������������������������������������������������������� 31
IntelliJ IDEA������������������������������������������������������������������������������������������������������������������������������������������ 31
Tools That Target Multiple Operating Systems and Mobile Platforms��������������������������������������������������� 32
Traditional Platform-Agnostic Development Tools�������������������������������������������������������������������������������� 32


■Chapter 3: Your First Android Application, Already!�������������������������������������������� 33
Creating Your First Android Virtual Device���������������������������������������������������������������������� 33
Creating Your First Android Application, Already!����������������������������������������������������������� 41
Getting Your First Code Written������������������������������������������������������������������������������������������������������������� 46
Getting Ready to Run Your Application������������������������������������������������������������������������������������������������� 48
Installing (Additional) SDK Packages���������������������������������������������������������������������������������������������������� 50
Running Your Application���������������������������������������������������������������������������������������������������������������������� 52


■Chapter 4: Exploring Your First Project��������������������������������������������������������������� 55
Viewing the Whole Android Project Structure���������������������������������������������������������������� 55
Working with Manifests������������������������������������������������������������������������������������������������������������������������ 56
Jiving with Java������������������������������������������������������������������������������������������������������������������������������������ 58
Getting Resourceful with Resources���������������������������������������������������������������������������������������������������� 58
Building Everything with Gradle Files��������������������������������������������������������������������������������������������������� 60

Explaining the Key Android Application Logical Building Blocks������������������������������������ 63


Activities����������������������������������������������������������������������������������������������������������������������������������������������� 63
Intents��������������������������������������������������������������������������������������������������������������������������������������������������� 63
Services������������������������������������������������������������������������������������������������������������������������������������������������ 63
Content Providers��������������������������������������������������������������������������������������������������������������������������������� 64

Summary������������������������������������������������������������������������������������������������������������������������ 64

WOW! eBook
www.wowebook.org
Table of Contents vii


■Chapter 5: Android Studio In-Depth��������������������������������������������������������������������� 65
Starting with the Project Explorer���������������������������������������������������������������������������������� 65
Getting Comfortable Switching Project Explorer Views������������������������������������������������������������������������ 66
Using the Project Explorer Context Menu��������������������������������������������������������������������������������������������� 68

Running and Debugging with Android Studio����������������������������������������������������������������� 68


Running with Run Configs: A Recap����������������������������������������������������������������������������������������������������� 68
Running Farther with AVDs and Connected Devices���������������������������������������������������������������������������� 70
Debugging Instead of Running Your Code���������������������������������������������������������������������� 77
Setting and Clearing Breakpoints��������������������������������������������������������������������������������������������������������� 77
Starting Applications for Debugging����������������������������������������������������������������������������������������������������� 78
Stepping Through Code While Debugging�������������������������������������������������������������������������������������������� 80
Attaching the Debugger������������������������������������������������������������������������������������������������������������������������ 80

Viewing What You’ve Run����������������������������������������������������������������������������������������������� 81


Understanding Your Build��������������������������������������������������������������������������������������������������������������������� 81
Understanding Events in the Event Log������������������������������������������������������������������������������������������������ 82
Understanding Logcat�������������������������������������������������������������������������������������������������������������������������� 83

Revisiting the SDK Manager������������������������������������������������������������������������������������������� 84


Highlighting the Other Major Features of Android Studio����������������������������������������������� 86
Summary������������������������������������������������������������������������������������������������������������������������ 86

■Chapter 6: Mastering Your Entire Developer Ecosystem������������������������������������� 87
Choosing Dedicated Developer Hardware���������������������������������������������������������������������� 87
Determining Which CPU Is Right for You����������������������������������������������������������������������������������������������� 88
Too Much Memory Is Never Enough!���������������������������������������������������������������������������������������������������� 88
Storing It All!����������������������������������������������������������������������������������������������������������������������������������������� 89
Viewing It All!���������������������������������������������������������������������������������������������������������������������������������������� 90
Connecting It All!���������������������������������������������������������������������������������������������������������������������������������� 93

Test Handsets and Tablets���������������������������������������������������������������������������������������������� 93


Option 1: All-Virtual Testing������������������������������������������������������������������������������������������������������������������ 94
Option 2: Start Virtual and Augment with Top Devices�������������������������������������������������������������������������� 94
Option 3: Buy, Buy, and Buy Some More����������������������������������������������������������������������������������������������� 94
Option 4: Other People’s Hardware������������������������������������������������������������������������������������������������������� 95

WOW! eBook
www.wowebook.org
viii Table of Contents

Building with Build Tools������������������������������������������������������������������������������������������������ 96


Update Your gradle.properties File������������������������������������������������������������������������������������������������������� 96
Use the Gradle Command Line������������������������������������������������������������������������������������������������������������� 97
Visit gradle.org to Learn More�������������������������������������������������������������������������������������������������������������� 98

Managing Your Code with Source Control���������������������������������������������������������������������� 98


Completing Your Software Repertoire���������������������������������������������������������������������������� 99
Summary���������������������������������������������������������������������������������������������������������������������� 101


■Part II: Get the Android Development Know-how��������������������������� 103

■Chapter 7: Introducing Java for Android Development������������������������������������� 105
Java, Java, Everywhere������������������������������������������������������������������������������������������������ 106
Android’s Java Time Warp������������������������������������������������������������������������������������������������������������������ 107
Using a JDK Installation for Learning Java����������������������������������������������������������������������������������������� 107

Your First Java Concepts in Code��������������������������������������������������������������������������������� 109


The Key Java Building Blocks for Android Development���������������������������������������������� 112
Structure of Code�������������������������������������������������������������������������������������������������������������������������������� 113
Understanding Object-Oriented Design, Classes, and Objects����������������������������������������������������������� 114
Working with Class Methods and Data Members������������������������������������������������������������������������������� 114

Summary���������������������������������������������������������������������������������������������������������������������� 116

■Chapter 8: Introducing XML for Android Development�������������������������������������� 117
Getting Started with XML��������������������������������������������������������������������������������������������� 117
XML Version and Encoding����������������������������������������������������������������������������������������������������������������� 118
XML Elements������������������������������������������������������������������������������������������������������������������������������������� 118
XML Attributes������������������������������������������������������������������������������������������������������������������������������������ 120
XML Values����������������������������������������������������������������������������������������������������������������������������������������� 121
XML Namespaces������������������������������������������������������������������������������������������������������������������������������� 122

Other Parts of the XML World��������������������������������������������������������������������������������������� 123


Using XML in Your Android Applications����������������������������������������������������������������������� 124
Reviewing the Android Manifest XML File������������������������������������������������������������������������������������������ 124

WOW! eBook
www.wowebook.org
Table of Contents ix

Using XML for Resource Definitions��������������������������������������������������������������������������������������������������� 125


Defining Activity Layouts with XML���������������������������������������������������������������������������������������������������� 128

Summary���������������������������������������������������������������������������������������������������������������������� 130

■Chapter 9: Exploring Android Concepts: Core UI Widgets��������������������������������� 131
Everything Starts with View����������������������������������������������������������������������������������������� 131
Key Methods Derived from View��������������������������������������������������������������������������������������������������������� 132
Key Attributes and Properties Derived from View������������������������������������������������������������������������������� 132
Introducing the Core UI Widgets in Android������������������������������������������������������������������ 132
Labeling Things with TextView����������������������������������������������������������������������������������������������������������� 133
Buttoning the Perfect UI��������������������������������������������������������������������������������������������������������������������� 138
Getting the Picture with ImageView and ImageButton����������������������������������������������������������������������� 142
Editing and Inputting Text with EditText���������������������������������������������������������������������������������������������� 144
Checking Out the CheckBox��������������������������������������������������������������������������������������������������������������� 147
Switching It Up with a Switch������������������������������������������������������������������������������������������������������������� 150
Choosing Things with Radio Buttons�������������������������������������������������������������������������������������������������� 153

Learning Even More UI Widgets����������������������������������������������������������������������������������� 155


Summary���������������������������������������������������������������������������������������������������������������������� 155

■Chapter 10: Exploring Android Concepts: Layouts and More���������������������������� 157
What Is Android Jetpack����������������������������������������������������������������������������������������������� 157
Using Popular Layout Designs�������������������������������������������������������������������������������������� 159
Revisiting the Constraint Layout��������������������������������������������������������������������������������������������������������� 159
Using Relative Layouts����������������������������������������������������������������������������������������������������������������������� 164
Lining Up with Linear Layouts������������������������������������������������������������������������������������������������������������ 170

Even More Layout Options�������������������������������������������������������������������������������������������� 176


Table Layouts�������������������������������������������������������������������������������������������������������������������������������������� 176
Grid Layouts���������������������������������������������������������������������������������������������������������������������������������������� 177

Mastering XML-Based Layouts with Java Logic: The Best of Both Worlds!������������������ 177
Connecting XML Layout Definition in Java Code�������������������������������������������������������������������������������� 178

Revisiting MyFirstApp via ButtonAgain������������������������������������������������������������������������ 179


Summary���������������������������������������������������������������������������������������������������������������������� 181

WOW! eBook
www.wowebook.org
x Table of Contents


■Chapter 11: Understanding Activities���������������������������������������������������������������� 183
Delving into the Android Activity Lifecycle������������������������������������������������������������������� 183
Understanding Activity Lifecycle Callback Methods��������������������������������������������������������������������������� 185
Appreciating the Objectives of the Activity Lifecycle�������������������������������������������������������������������������� 189

Managing Activity Configuration Changes�������������������������������������������������������������������� 190


Working with the Default Approach to Configuration Change������������������������������������������������������������ 190
Summary���������������������������������������������������������������������������������������������������������������������� 191

■Chapter 12: Introducing Fragments������������������������������������������������������������������ 193
Starting with the Fragment Class��������������������������������������������������������������������������������� 193
Using Fragment-Based Design for Your Applications������������������������������������������������������������������������� 194
Working with the Fragment Lifecycle������������������������������������������������������������������������������������������������� 195
Reviewing the Fragment Lifecycle Callback Methods������������������������������������������������������������������������ 196

Starting Simple with Fragment Lifecycle Events��������������������������������������������������������� 198


Creating a Fragment-Based Application��������������������������������������������������������������������������������������������� 198
Selecting Which Layout to Inflate������������������������������������������������������������������������������������������������������� 200

Coding for Fragments��������������������������������������������������������������������������������������������������� 201


ColorFragmentExample in Action��������������������������������������������������������������������������������� 203
Summary���������������������������������������������������������������������������������������������������������������������� 206


■Part III: Get Sophisticated��������������������������������������������������������������� 207

■Chapter 13: Working with Sound, Audio, and Music for Android���������������������� 209
Playing Back Audio������������������������������������������������������������������������������������������������������� 209
Choosing Your Audio Approach����������������������������������������������������������������������������������������������������������� 209

Working with the Media Package��������������������������������������������������������������������������������� 210


Creating an Audio Application�������������������������������������������������������������������������������������� 211
Choosing Between Assets and Resources������������������������������������������������������������������������������������������ 211
Writing the Code for Audio Playback�������������������������������������������������������������������������������������������������� 212
Playing Back Audio the Simple Way��������������������������������������������������������������������������������������������������� 213
Coding the Java Logic for AudioPlayExample������������������������������������������������������������������������������������� 214

WOW! eBook
www.wowebook.org
Table of Contents xi

Using Streaming for Audio Playback���������������������������������������������������������������������������� 217


Playing the Music Stream������������������������������������������������������������������������������������������������������������������� 220

Exploring Other Playback Options�������������������������������������������������������������������������������� 220


Recording Audio����������������������������������������������������������������������������������������������������������� 221
Recording Audio with MediaRecorder������������������������������������������������������������������������������������������������ 221

Expanding Your Developer Audio Toolset���������������������������������������������������������������������� 227


Understanding Key Audio Aspects������������������������������������������������������������������������������������������������������ 228
Choosing Further Audio Tools������������������������������������������������������������������������������������������������������������� 229

Summary���������������������������������������������������������������������������������������������������������������������� 231

■Chapter 14: Working with Video and Movies for Android���������������������������������� 233
Playing Back Video������������������������������������������������������������������������������������������������������� 233
Designing a VideoView-Based Layout������������������������������������������������������������������������������������������������ 234
Controlling Video Playback in Your Code�������������������������������������������������������������������������������������������� 236

Understanding Key Video Concepts������������������������������������������������������������������������������ 239


Bitrate������������������������������������������������������������������������������������������������������������������������������������������������� 239
Frame Rate����������������������������������������������������������������������������������������������������������������������������������������� 240
Codecs������������������������������������������������������������������������������������������������������������������������������������������������ 240
Understanding the Complex World of Video Containers and Child Codecs����������������������������������������� 241

Expanding Your Developer Video Toolset���������������������������������������������������������������������� 243


Reviewing the Range of Video Editing Tools Available to You������������������������������������������������������������� 243
Popular Open Source Video Editing Suites����������������������������������������������������������������������������������������� 244
Popular Commercial Video Editing Suites������������������������������������������������������������������������������������������� 244

Introducing HandBrake for Video Editing��������������������������������������������������������������������� 245


Downloading and Installing HandBrake���������������������������������������������������������������������������������������������� 245
Running and Using HandBrake����������������������������������������������������������������������������������������������������������� 245
Going Further with Video for Android�������������������������������������������������������������������������������������������������� 249

Summary���������������������������������������������������������������������������������������������������������������������� 249

WOW! eBook
www.wowebook.org
xii Table of Contents


■Chapter 15: Introducing Notifications��������������������������������������������������������������� 251
Configuring Notifications���������������������������������������������������������������������������������������������� 251
Customizing Notifications with the Notification Object���������������������������������������������������������������������� 252
Adding Icons for Notifications������������������������������������������������������������������������������������������������������������ 255
Introducing Notification Channels in API Level 26������������������������������������������������������������������������������ 256

Notifications in Action�������������������������������������������������������������������������������������������������� 257


Supporting Logic to Create the Notifications�������������������������������������������������������������������������������������� 257

Seeing Notifications from the User’s Perspective�������������������������������������������������������� 260


Summary���������������������������������������������������������������������������������������������������������������������� 264

■Chapter 16: Exploring Device Capabilities with Calls���������������������������������������� 265
Calling the Shots���������������������������������������������������������������������������������������������������������� 265
Specifying Telephony Support������������������������������������������������������������������������������������������������������������ 265
Making Telephony Support Optional��������������������������������������������������������������������������������������������������� 266

Making Calls����������������������������������������������������������������������������������������������������������������� 266


Laying Out the CallExample Application��������������������������������������������������������������������������������������������� 267
Working Logic for the CallExample Application���������������������������������������������������������������������������������� 270
Making an ACTION_DIAL Call�������������������������������������������������������������������������������������������������������������� 271
Making an ACTION_CALL Call������������������������������������������������������������������������������������������������������������� 272

Handling Incoming Calls����������������������������������������������������������������������������������������������� 273


■Part IV: Get Together����������������������������������������������������������������������� 275

■Chapter 17: Understanding Intents, Events, and Receivers������������������������������� 277
Introducing Android Intents������������������������������������������������������������������������������������������ 277
Understanding Intent Behavior����������������������������������������������������������������������������������������������������������� 278
Understanding Intent Routing������������������������������������������������������������������������������������������������������������� 280

Including Intents in Your Manifest�������������������������������������������������������������������������������� 280


Using Android’s Verified Links������������������������������������������������������������������������������������������������������������ 282

Seeing Intent-Launched Activities in Action����������������������������������������������������������������� 282


Deciding on Activity Dependency������������������������������������������������������������������������������������������������������� 282

Creating an Intent��������������������������������������������������������������������������������������������������������� 283


Starting the Intent-Invoked Activity���������������������������������������������������������������������������������������������������� 284

WOW! eBook
www.wowebook.org
Table of Contents xiii

Introducing Receivers�������������������������������������������������������������������������������������������������� 288


Using Receivers When No UI Is Needed���������������������������������������������������������������������������������������������� 289
Working with Receiver Limitations����������������������������������������������������������������������������������������������������� 289

Summary���������������������������������������������������������������������������������������������������������������������� 290

■Chapter 18: Introducing Android Services�������������������������������������������������������� 291
Services Background��������������������������������������������������������������������������������������������������� 291
Using WorkManager as an Alternative to Services����������������������������������������������������������������������������� 292

Starting with Your Own Service������������������������������������������������������������������������������������ 292


Implementing Your Service Class������������������������������������������������������������������������������������������������������� 292
Managing the Service Lifecycle via Callbacks����������������������������������������������������������������������������������� 293

Providing Manifest Entries for Your Service����������������������������������������������������������������� 294


Service Communication���������������������������������������������������������������������������������������������������������������������� 294

Service-to-Client Communication�������������������������������������������������������������������������������� 297


Using bindService( ) Methods for All Communication������������������������������������������������������������������������� 298
Intents and Broadcast Receivers�������������������������������������������������������������������������������������������������������� 298
Use PendingIntent Objects����������������������������������������������������������������������������������������������������������������� 298
Use Messenger and Message Objects������������������������������������������������������������������������������������������������ 299
Use Independent Messaging�������������������������������������������������������������������������������������������������������������� 299
Create Callbacks and Listeners���������������������������������������������������������������������������������������������������������� 299
Use Notifications�������������������������������������������������������������������������������������������������������������������������������� 300
Services in Action��������������������������������������������������������������������������������������������������������� 300
Choosing the Service Design�������������������������������������������������������������������������������������������������������������� 300
Creating the Java Logic for the Service���������������������������������������������������������������������������������������������� 300
Creating an Example Client to Use the Service���������������������������������������������������������������������������������� 302
Testing the Service in Action�������������������������������������������������������������������������������������������������������������� 304

Summary���������������������������������������������������������������������������������������������������������������������� 304

■Chapter 19: Working with Files in Android�������������������������������������������������������� 305
Using Assets and Raw Files����������������������������������������������������������������������������������������� 305
Populating Lists from Resource Files������������������������������������������������������������������������������������������������� 306
Working with Files from the File System�������������������������������������������������������������������������������������������� 310

WOW! eBook
www.wowebook.org
xiv Table of Contents

Android’s File System Model�������������������������������������������������������������������������������������������������������������� 310


Permissions for Reading and Writing Files����������������������������������������������������������������������������������������� 311

Examining External Files in Action������������������������������������������������������������������������������� 312


What Goes into Saving and Reading Files������������������������������������������������������������������������������������������ 315
Saving and Reading Files in Action���������������������������������������������������������������������������������������������������� 317

Ensuring External Storage Is Available When Needed�������������������������������������������������� 319


Other Considerations with Android File Systems�������������������������������������������������������������������������������� 320

Summary���������������������������������������������������������������������������������������������������������������������� 322

■Chapter 20: Working with Databases in Android����������������������������������������������� 323
Working with SQLite: The World’s Most Popular Database!����������������������������������������� 323
Quickly Learning SQLite for Android Development������������������������������������������������������� 324
Creating SQLite Databases for Your Applications������������������������������������������������������������������������������� 325
Introducing the SQLiteExample Application���������������������������������������������������������������������������������������� 326
Creating a Database-Driven Activity��������������������������������������������������������������������������������������������������� 330
Choosing Query Approaches for SQLite and Android�������������������������������������������������������������������������� 333
Managing Results from Queries with Cursors������������������������������������������������������������������������������������ 335

Modifying Data with Your Android Application������������������������������������������������������������� 337


Inserting Data������������������������������������������������������������������������������������������������������������������������������������� 337
Updating Data������������������������������������������������������������������������������������������������������������������������������������� 339
Deleting Data�������������������������������������������������������������������������������������������������������������������������������������� 339

Using the Room Persistence Library���������������������������������������������������������������������������� 340


Packaging and Managing SQLite Databases for Android��������������������������������������������� 340
Managing Android Storage for Database Performance���������������������������������������������������������������������� 340
Packaging SQLite Databases with Your Applications�������������������������������������������������������������������������� 341

Choosing SQLite Management Tools to Prepare Databases for Packaging������������������ 342


Working with Built-In Tools����������������������������������������������������������������������������������������������������������������� 342
Working with Third-Party Database Tools������������������������������������������������������������������������������������������� 342

Summary���������������������������������������������������������������������������������������������������������������������� 343


■Index ������������������������������������������������������������������������������������������������������������������ 345

WOW! eBook
www.wowebook.org
About the Author
Grant Allen, PhD, has worked in the technology field for over 20 years, as a CTO,
entrepreneur, and emerging technology expert. After successful startup exits and a decade
at Google, Grant’s focus is now mentoring and coaching startups and hi-tech companies
on building great teams and great technology. He is a frequent speaker on topics such as
big data, mobile ecosystems, Android, wearables, IoT, disruptive innovation, and more.
Grant has a PhD in computer science based on research he performed while at Google and
an MBA specializing in technology management, and he is the author of seven books on
various mobile platform and data technology topics.

xv

WOW! eBook
www.wowebook.org
Other documents randomly have
different content
association which could not exist in a group ruled by individual
inclination.
During the development of the family, we may expect to find that
the males will seek to hold their rights, and that the women of the
group will exert their influence more and more in breaking these
down; and this is precisely what we do find. And for this reason the
clan system, which developed from these solitary hostile families,
must be considered as a feminine creation, which had special
relation to motherhood.
The sexual egoism by which one male, through his strength and
seniority, held marital rights over all the females of his group had to
be struck at its roots. In other words, the solitary despot had to
learn to tolerate the association of other adult males.
It is impossible for me here to follow step by step the means
whereby this change was brought about. I would, however, assert
my strong belief that it was the mothers, acting in the interests of
their children, who tamed the jealous desires and domesticated the
males. The adult sons, instead of being driven from the home by the
father, were permitted to remain as members of the family group
and to bring in young wives captured from other families. At a later
stage, daughters received husbands, young males from other
groups, who came first as temporary lovers, visiting their brides by
night, but afterwards remained with them as permanent guests in
the home of the mother. Under these new conditions, the marital
rights of the male members were restricted and confined. A system
of taboos was established, which, as time advanced, was greatly
strengthened by the use of sacred totem marks, and became of
inexorable strictness.
In this way peace was established, and association between the
jealous fighting males was made possible.
Here, then, are the reasons which led to the formation of the
maternal family and the communal clan. It depended, in the first
place, on the development of mutual aid between mother and
offspring, based on the much closer relationship of the children to
their mothers than to the father. As soon as the women of the
family-group by combination were able to outwit and curb the
jealous rule of the father, the matriarchal clan developed from the
primitive patriarchal family.
The contrast between the family and clan seems to me of great
importance. Individual relationships became of less importance; the
clan did not consist of groups of families but of individuals. I have
stated that the sexual relationships between the young people
began with the reception by the daughters of temporary lovers in
the clan-home. A connection thus formed would tend under
favourable circumstances to be continued and would be perpetuated
as a marriage. Thus it came to be the custom for the husband to live
temporarily or permanently in the wife’s home and among her
kindred. Here he was compelled to work for the general good; he
was without property or any recognised rights in the clan; he was
not permitted a separate home, and was left with no—or very little—
control over his wife and none over the children of the marriage. He
occupied, indeed, the position of a more or less permanent guest in
the maternal hut or tent.
Under such an organisation the family—the first group of the
father, wives and children—is swallowed up in the larger clan. The
male has no position of mastery over the female. As time goes on,
the clan becomes more and more a free association for mutual
protection, ruled over by the ablest and most capable members. Not
only does the father not stand out as a principal person from the
background of the familial clan; he has not even any recognised
domestic rights in connection with his own wife and children. This
restriction of the husband and father was clearly dependent on the
form of marriage.
The later modifications of the communal clan and the social
customs that grew up, in most cases—and always, I believe, in the
complete maternal form—were favourable to the authority of the
mothers. Kinship was reckoned through the mother, the totem name
was taken from her, since in this way alone could the undivided
family be maintained. The continuity of the clan thus depending on
the women they were placed in a position of importance; the mother
was at least the nominal head of the household, shaping the destiny
of the clan through the aid of her kindred.
All the members of such a compound family were responsible for
the offences of any individual member; and in the same way the
clan exacted blood vengeance or compensation collectively for any
offence committed against its members. But the men belonged to
their own clans, that is, to the clans of their mothers; they did not
belong to and had no rights in the clan of which their wife and
children were members. As husbands and fathers they were without
power. This is very important. The woman’s closest male relation
was not her husband, but her brother, who acted as father to her
children.
A pure type of matriarchal family fully preserved is rare. There are
scattered tribes in different parts of the world where descent is still
reckoned through the mother. Some features favourable to women
are found in one community, some in another. The sexual
relationships, in particular, are interesting. The girl is frequently the
wooer of the man, and in certain cases she or her mother imposes
the conditions of the marriage. After marriage, the free provisions
for divorce (often more favourable to the wife than to the husband)
are, perhaps, of even greater significance.
There are many traces of discipline exercised in the bringing up of
children and more or less systematic training of boys in endurance,
speed, courage, etc. This task falls to the mother’s brother. The
daughters are instructed by the mothers and the matrons of the
tribe in all that concerns their duties as wives and mothers.
The woman is subject to the authority of her eldest brother, and
sometimes as well to that of her other brothers, her uncles and male
relations. But descent being reckoned in the female line, and the fact
that she is the conduit by which property passes to and from the
men, gives the woman a position of very considerable, though
varying, importance.
In all cases the power of the wife is clearly dependent on the
maternal form of marriage. I must insist upon this. Where this
custom of the husband living in the home of the wife was practised
for any long period, the women often established their own claims
and all property was held by them; conditions which, under
favourable circumstances, developed into what may literally be called
a matriarchate. Elder women among some tribes are the heads of
kinsfolk, they even have a seat or voice in the tribal council, and
there have been exceptional cases of female tribal chiefs. Religion is
in some periods in the hands of women, and goddesses are more
reverenced than gods. Here is certain proof of the favourable
influence mother-descent may exercise on the authority held by
women. In all circumstances the children’s position was dependent
on the mother and her kindred.
Such a system of inheritance may be briefly summarised as
mother-right.
Other forms of marriage are found; indeed, every possible
experiment in family and sexual association has been tried and is still
practised among barbarous races, often with very little reference to
those moral ideas to which we are accustomed. It is, however, very
necessary to remember that monogamy is frequent and indeed usual
under the maternal system. When the husband lives with his wife in
a dependent position to her family, he can do so only in the case of
one woman. For this reason polygamy is much less deeply rooted
under the conditions in which the communal life of the compound
family is developed than in the single patriarchal family. Polygamy is
an indication, if not always a proof, of the subordination of women
to the headship of the husband. In the complete maternal family it is
never common and is even prohibited.
It was quite otherwise with polyandry, and though less usual than
monogamy, this form of association is in some cases connected with
the conditions of the maternal clan. I do not believe it can be
regarded as due to a licentious view of the sexual relations, but
arose as an expression of the communism which was characteristic
of such an organisation.
The whole subject of primitive sexual relationships—which, of
course, involves the family, the position of woman and the welfare of
the children—is a very wide and complicated one. If I differ on
several important points from learned authorities, whose knowledge
and research far exceed my own, I do so only after great hesitation,
and because I must. Almost invariably the writers on these questions
are men, and perhaps for this reason the position of women has not
received the attention that it claims. My own studies have convinced
me that in the early beginnings of the human family women
exercised a more direct and stronger influence than is usually
believed. This is no fanciful idea of my own, as I claim to have
proved in my earlier book,[66] where it was possible to bring forward
in detail the evidence I have collected on the subject.
But even in this brief summary enough has been said to give in
rough outline some picture of the family under the conditions of the
maternal communal clan. We have marked the steady strengthening
of the tie between the mother and the child, with the corresponding
movement in the opposite direction in regard to the father’s position
in the family. All the chances for success in parenthood rested with
the mother, rather than with the father. The male was driven out
from the holy circle of the family. This degradation of fatherhood is a
fact that must be kept before our attention.[67]
There is, however, another side to the matter. In the face of what
we have established, it must, I think, be accepted that women held
considerable power in this period of mother-descent and under the
maternal form of marriage. The mother was dominant in the family
in this second stage of its development. This is still denied by some
authorities. There are many facts of the early power of women
which the great world does not know.
How, then, are we to come to a decision? Shall we look back to
the maternal stage as the golden period of the family wherein were
realised conditions of free motherhood, which even to-day have not
been established? It is a question very difficult to answer, and we
must not in any haste rush into mistakes. And unfortunately the
limitation of my space can allow only the briefest consideration of
the matter.
We find that the mother-age was a transitional stage in the history
of the growth of society, and we can trace the stages of its gradual
decline. There is nothing to show that the customs of maternal
communism, dependent on descent traced in the female line and the
maternal form of marriage, have ever been permanently maintained
in any progressive society. The enlarged family of the maternal clan
is thus proved to have been a less stable social system than the
patriarchal single family which again succeeded it, or it would not
have perished in the struggle with it. I think this must be accepted.
Within the large and undivided group-family of the clan, the
restricted family became gradually re-established by a reassertion of
domestic interests. In proportion as the family gained in importance
(which would arise as the struggle for existence lessened and the
need of association was less imperative) the interests of the
individual members would become separated from the group to
which they belonged. As society advanced and personal property
began to be acquired, each man would aim at gaining a more
exclusive right over his wife and children; he would not willingly
submit to the bondage of the maternal form of marriage.
We find the husband and father moving towards the position of a
fully acknowledged legal parent by a system of buying off his wife
and her children from their clan-group. Then the payment of a bride-
price was claimed from the bridegroom by the bride’s relations, and
an act of purchase was accounted essential before marriage; it was,
however, regarded as a condition, not so much of the marriage itself,
but of the transference of the wife to the home of the husband and
of the children to his kindred. The change was, of course, effected
slowly; often we find the two forms of marriage—the maternal form
and the purchase-marriage—occurring side by side. What, however,
is certain is that the purchase-marriage in the struggle was the one
which prevailed.
This reversal in the form of the marriage brought about a
corresponding reversal in the position of the woman in the sexual
relationship. This is so plain. As the patriarchate developed, and men
began to gain individual possession of their children by the purchase
of their mothers, the father became the dominant power in the
family. Women no longer are the transmitters of property and of the
family name, but are themselves property passing from the hands of
their kindred to those of a husband. As purchased wives, they reside
in the husband’s house and among his kin, where they occupy the
same position of disadvantage in the family as the husband and
father had done under the maternal marriage. The protection of her
own kindred was the source of the wife’s privileged position. This
now was lost. The change was not brought about without a struggle,
and for long the old customs contended with the new. But step by
step the man became the father-master in the home.
It is, however, very necessary to remember that this reversal in
the marriage custom may well have been brought about as much by
the desire of the women as by the action of the men. I believe that
the change to the individual family must have been regarded
favourably by primitive women. An arrangement which would give a
closer relationship in marriage and the protection of a husband for
herself and her children may well have been preferred by the wife to
the position of subjection in which she was frequently placed to the
authority of her brother and her own relatives. Nor do I think it
unlikely that she, quite as strongly as the man, may have desired to
live apart from her mother and her kindred in her husband’s home.
We have to remember that the reassertion of the father within the
family-group was a necessary step, and one that had to be taken.
The mother is bound to the family by her children in a much closer
way than the man ever can be bound. And for this reason any
conditions which separate the father from the home and liberate him
from his responsibilities to his children are certain not to act in the
direction of progress. The male needs to be held to the family. This
is a fact much too often forgotten.
The social clan organised around the mothers carried mankind a
long way—a way the length of which we are only beginning to
realise. But it could not carry mankind forward to the closer family
ties and family life from which so much was afterwards to develop.
The clan system was essential to the conditions of primitive life,
owing to the fierce struggle to exist, and it could then limit and
interfere with the family on every side. But as soon as life was
easier, men wanted to establish a home with wife and children and
to enjoy the possession of property. And women wanted this too. It
was not possible for the family to be permanently absorbed. I must
insist upon this again. The individual family—that is, the trinity
composed of father, mother and child—is the older and the more
lasting institution.
I affirm, further, that of the two forms of the family, the individual
limited form is the one that is the more natural and happy. Special
circumstances may make necessary the enlarged social family, but
such conditions are not really a step forward.
With all the evils and restrictions that father-right and the
individual family-group may, throughout the ages, have brought to
women, we have got to remember that the woman owes the
individual relationship in love and the protection of the man for
herself and her children to the patriarchal system. The father’s right
in his children (which, unlike the right of the mother, was not
founded upon kinship, but rested on the quite different and insecure
basis of property) had to be re-established. Without this being done,
the family in its fairness and complete development was impossible.
The survival value of the patriarchal family consists in the additional
gain to the children of the father’s to the mother’s care. I do not
think this gain can ever safely be lost.
PART IV
MOTHERHOOD AND THE
RELATIONSHIPS OF THE SEXES
“For the great majority of mankind at least it can be held that life
resolves itself quite simply and obviously into three cardinal phases.
There is a period of youth and preparation, a great insurgence of
emotion and enterprise centring about the passion of Love; and a
third period in which, arising amidst the warmth and stir of the
second, interweaving indeed with the second, the care and love of
offspring becomes the central interest in life.… Looking at this with a
primary regard to its broadest aspect, life is seen essentially as a
matter of reproduction; first a growth and training to that end, then
commonly mating and actual physical reproduction, and finally the
consummation of these things in parental nurture and education.
Love, Home and Children, these are the heart-words of life.”—H. G.
Wells.

CONTENTS OF CHAPTER VIII


THE FAMILY AND THE HOME
Attacks on the family not likely to destroy it—Dominance of the male may be
changed without altering the fundamental ideal of the family—Bernard Shaw
ignorant of human needs—Two statements by H. G. Wells—The inhuman
ideals of intellectual reformers—Trained hands to replace mother’s love—
Foolish egoism the basis of the whole argument—The sweated victim of an
industrial age is the ideal emancipated woman—The power of the mother in
non-industrial societies—Modern uncertainty and want of a fixed standard of
conduct—The extension of women’s work during the war—Is it of benefit to
the coming generation—Can the mother both work outside the home and give
sufficient care to her children—Woman’s subordinate qualities are man’s
dominant qualities—Hence the wastefulness of rivalry in the same work—Early
experiments in communist families—The child’s need for a home of its own—
We must insist on conditions that will make home life possible—Types of
mothers—The personal rights of the child—The position of the father—The
father can be detached from the family—This harmful—The child’s need for
the care of both its parents—The home exposed to danger—It awaits a fresh
inspiration to turn back and hold the desires of women.

CHAPTER VIII
THE FAMILY AND THE HOME
“The ideal which the mother and wife makes for herself, the manner in which
she understands duty and life, contain the fate of the community.”—Amiel’s
Journal.

There are some who hold that the family rests on a trembling
quicksand, and state that its supporters are compelled to weave a
network of lies to sustain its foundation. We hear much wild talk,
and a great deal is said about the restrictions imposed by the family,
and very little about its duties and its joys. There is, and I think its
existence must be faced, a growing tide of discontent which would
seem to render the stability of the home more and more precarious
—the faint-hearted cry to us that everything is coming to an end. It
is not so, but rather, everything is about to be renewed.
Institutions as vital to life as the family will continue. From the
most distant period of life, among the animals as among mankind,
the history of the family has been a long series of regenerations. We
have found witness to this again and again in the past records of
pre-human and primitive human parenthood. And, indeed, the most
important result we have gained from our long inquiry is the
abundant proof it has furnished of the indestructible character of the
family.
Wherever the individual family (the lasting union of the male with
the female for the protection of the young) has been departed from
for some other and perhaps freer form of sexual association a return
has followed. Special conditions have called forth experiments, new
family arrangements, but in no case have they become universal and
permanent. We cannot argue against all that the past teaches us.
And assuredly the history of the family turns into foolishness many
reforms that, in our blindness, we are seeking to-day. We believe
they will bring progress and freedom to women. But what sure
ground have we for such a belief? In truth we have much to learn.
Institutions have this in common with rivers, they do not readily
flow backwards. If they sometimes seem to retro-grade, it is
generally only a mere appearance, and though tributary streams
break away in experimental courses the main river flows on. You will
see what I mean by this. The changes that will take place, and have
for long been taking place, have been changes not affecting the
fundamental qualities in the ideal of the family—its permanence, the
fidelity of its partners in thought and deed, its sentiments and its
obligations of joyous sacrifice in united parental care. Attacks have
altered (and it is well that they have altered) the dominance of the
male. The patriarchal customs of proprietary ownership are gradually
disappearing both for the wife and for the children. The family has
broadened. The feeling of hostility to the outer world, the self-
centredness—much that limited the family is being changed. But the
idea of the family, and its value as one of the most essential forms of
social life, remains unaffected.
And mark this: No ideals whatever have been produced by even
the most progressive and enlightened persons to replace the family
group.
The wild reforms contemplated by some among us, who talk, but
fortunately do not act, are fog and nonsense.
The home, in particular, has been spoken of with contempt. Thus,
Bernard Shaw, who in the reforms he advocates fails so frequently to
see the real human needs of life, cries: “Home is the girls’ prison and
the woman’s workhouse.” Again, W. L. George in Women and To-
morrow (a “To-morrow” which, by the way, I trust I may never live
to see) states: “The home is the enemy of Woman. Purporting to be
her protector, it is her oppressor. It is her fortress, but she does not
live in the state apartments, she lives in a dungeon.”
Mr. H. G. Wells, in a much more recent utterance, wherein he
professes to forecast “What is Coming,” speaks even more strongly,
and all the present conditions are estimated. He states: “Now, to be
married is an incident in a woman’s career, as in a man’s.” (The
italics are mine.) “There is not the same necessity of that household,
not the same close tie; the married woman remains partially a
freewoman and assimilates herself to the freewoman. There is an
increasing disposition to group solitary children and to delegate their
care to specially qualified people; and this is likely to increase,
because the high earning power of young women will incline them to
entrust their children to others.”
And again, at the conclusion of his article on “The War and
Women,” Mr. Wells sums up the situation as follows: “To sum all that
has gone before, this war is accelerating rather than deflecting the
stream of tendency, and is bringing us rapidly to a state of affairs in
which women will be much more definitely independent of their
sexual status, much less hampered in their self-development and
much more nearly equal to men than has ever been known before in
the whole history of mankind.”
Now, if these two late pronouncements of Mr. Wells are compared
with what he wrote a few years back, with the quotation from
Mankind in the Making which I have placed before this section of my
book because it so well expresses my own views, I think the harm
that of late years has been working is strongly evident; harm that is
incredibly active in our consciousness.[68]
Such talk of my sex as “freewomen” and of a liberation from the
sexual life, as if that could be possible, fills me with impatience. I
would not wait to notice it did I not believe that the hurt done to
women had been deep and far-reaching. It has increased for them
the difficulty of unifying life. And this uncertainty of desire is, as I
believe, the modern disease which has worked such havoc in the
souls of women. I would like to silence all useless, impious negators;
those who, seeking to be clever, really are blinkered, and unable to
see the results that would follow from their destructions. The error in
all these outcries is the error of blindness, of getting into a condition
of confused intellectual excitement, and because some women are
dissatisfied and have been unhappy, saying, therefore, and usually
with passion, that they would be more satisfied if all the sex were
freed from its own duties. As if freedom were ever gained by
running away. The intellectual reformer is so very far from
understanding the real human needs. There is, for instance, a
significant omission in the quotations I have given—no mention is
made of the results of all this to the child, and no suggestion is
offered except that it should be trained and cared for by experts and
apart from its parents. The home is to go because it restricts the
liberty of women and will hinder their earning power, as if this were
all that had to be considered. I can hardly find a more striking
example of how far the apparently simple and elemental things
escape the attention of the intellectual reformer.
In the society in which we are living, the only use that can be
made of modern progressive teaching about the family—the only
ounces of practice to be derived from pounds of precept—will lead,
as I believe, to a very undesirable course of action. The programme
for the abolition of the home has been outlined for us by reformers
of both sexes. Communal houses and kitchens, and the intervention
of armies of experts, are to solve the problems which now keep
women tied in the individual home. The parents are to be
supplanted by “born educators.” Successive institutions are planned
for the bottle-period, kindergarten, school age, and so on. The
children are to stand on visiting relations to the individual home and
their parents, while their bodies and souls are to be cared for by
specialists. And we are asked to believe that this will be a gain to the
child! “It is the trained hand that the baby needs, not mere blood
relationship … personal love is too hot an atmosphere for the young
soul.”[69]
Now, if I wanted a general term to express the state of mind of
these reformers, I do seriously think the word inhuman would be as
near to it as any. Some people talk as if there were no emotional
quality to decide these questions; they are dry-minded and quite
unable to grasp the true values in life.
And the essence of all such folly is an insupportable egoism. The
whole argument against the home is based on the claim of woman
to lead an independent life. Independent of what? It is not easy to
answer. It is asserted that the ideal of the home as the special care
of woman has tied her to material things; it is urged that her
emancipation from the fetish of the home is essential for her soul’s
freedom. The feminists ask us to make the wage-earning woman our
ideal, instead of regarding her, as I do, as the unfortunate victim of
industrial life and industrial ideals—and this is a very dangerous
attitude and one which cannot fail to affect very seriously the fate of
the home in the future. It is this that causes me such grave fear. The
ideals that we set before us do exercise an influence greater than we
know.
Now, I am not much moved by this modern cry for liberty. What is
this freedom for which women have been clamouring? In what
tyranny are they held other than that in which their womanhood
holds them? Is the new liberty to be found as sweated workers? Will
it come even now when women’s industrial work is being sought for
and well paid? Can it ever come from the fevered effort to live the
same lives as men live and do the same work that men do?
But this kind of view is of a most superficial sort, and one that,
comparatively speaking, is new. Before the coming of industrialism
the ideals of women were far different and were centred in the
home. The family was then firmly established on the patriarchal
system.
I have just read a Russian book[70] which gives a perfect picture
of the patriarchal home. The scene is described by a child: the head
of the house has died and the new male-head comes from the
death-bed. He is thus received by the women of the house—

“Suddenly the door opened, and my father came in.


He looked thin and pale and sad. Instantly all rose and
went to meet him; even grandmother, who was very
stout and could not walk without some one supporting
her, dragged herself towards him, and all his four
sisters fell down at his feet and began to ‘keen.’ It was
impossible to catch all they said and part I now forget,
but I remember the words, ‘You are our father now: be
kind to us poor orphans.’ My father with tears lifted
them all up and embraced them; when his mother
advanced towards him, he bowed to the ground before
her, kissed her hands, and vowed that he would always
submit to her authority, and that no changes would be
made by him.… They then sat down to eat so heartily
—my mother did not—that I watched them with
astonishment. My Aunt Tatyana helped fish-soup out of
a large tureen, and, as she put bits of roe and liver on
the plates, she begged all to do justice to them: ‘How
poor father loved the roe and the liver!’”

Now, to the self-assertive, feminist mind, imbued with industrial


ideals, this scene may make no appeal. Its peace is too quiet. Here
is none of the modern unrest, the boredom, the moving about in
worlds unrealised. But I do not think this will be noted. The one
suggestion that will leap to the thoughts is the dependent position of
the women. This is true, but it is equally true that the power of the
women is far greater than it is in any industrial home. And we find
that such power is not exercised by the young women and on
account of any sexual attraction, in the way to which we are
accustomed and have come to expect, but the power is held by the
mother, whose desires through life are a law to her son. I can hardly
emphasise too strongly this power and influence of the mother at all
times when the family is firmly established. I think it must be
granted that the mother has lost her position of influence in the
home wherever industrial views of life have penetrated. She has little
power over her grown-up sons or even over her daughters. Self-
assertion is also the desire of the children; they want to break away
from the mother. Perhaps this is inevitable, and maybe it is right. It
is very difficult to be certain.
I will not dwell on this question. I would, however, ask you to
keep fixed in your attention this hesitation that has entered as a
disease into our modern consciousness. We are without purpose,
and have no absolute standard of conduct. And the result for most
of us is a life of confused aims, restless and seeking, achieving by
accident what is achieved at all.
There have been, of course, many separate causes and influences
uniting to bring this unrest, but the disorganisation of the patriarchal
home, with the change in the ideal and desires of women, has acted
very strongly as a disturbing force. We have lost, especially, that
harmony in life which woman alone is able to create.
Within the patriarchal family-group women lived a life that was
complete in itself, the home was self-contained because it included
all the elements necessary for the carrying on of a useful and
healthy life. True this home life, complete as it was in itself, was not
life in the fullest sense of living, for it lacked some of the larger
elements that only freedom of action can give. It was for women a
restricted, and, in later times, even a stunted life: in the end it came
to be a parasitic life. But for long it was a natural and satisfying life
and it was always entirely feminine, because motherhood embraced
it all, inspiring every motive and guiding every act.
What we want is the family reconstructed, with all its historic
bonds of unity and sanctity preserved and yet fitted to meet modern
needs. It must be a home where life can be lived in its fulness and
its depth. It is clear that this reconstruction is not going to be easy.
Such a task must even be held to be absurd, if we view life from the
modern standpoint, which can only be that of the doctrine of self-
assertion. Where the Self is so insistent, there can be no
consciousness of duty as something fixed and of life as being
purposive, consecrated to an end, which may not be left or taken
up. And the first thing necessary is to break through the separate
aims that cause such confusion in women’s thoughts and desires. No
standard of action can be fixed until we know what we want.
Separation must arise from self-assertion. Nothing worth doing can
be done until the collective consciousness of women has found itself
and regained a unifying ideal.
Life at the moment is in a state of too violent instability for any
attempts to reconstruct the home to be of any avail, and, in any
case, it is difficult to believe that any new form of the family can in
modern times exercise the sway that the patriarchal system wielded
in times gone by. And yet some standard we must have, or the
confusion in women’s lives will go on, and all feminine idealism must
perish through the very number of its varieties.
Now, it may be that the forces which acted against the family in
its past history are acting again to-day. Communal living and group
homes have been tried already in the beginnings of civilisation. They
were developed on account of conditions of danger which
threatened the primitive family-groups, forcing them to unite with
one another for mutual protection and help.[71] To-day again the
home is threatened. Industrialism has steadily undermined its
foundations, and changed the desire of women. Industrial workers
have departed far indeed from the ideal of absolute self-dedication
and service to the home that once was the supreme conception of
woman. And now a further step has been taken. War has made
necessary conditions that industrialism first taught women to desire.
For the first time in our industrial history a demand has arisen for
women’s labour as pressing and large as the supply. Hundreds and
thousands of women and girls have been called from their homes to
carry on the necessary work of the country. There are already
195,000 women employed in munition work, while 275,000 more
women are engaged in industrial occupations.[72]
Women have shown that there is hardly any work of men that
they cannot do. They are driving motor-lorries, they are working on
the railways, acting as conductors on trams and buses; they are
doing the postman’s round and carman’s deliveries; they are
ploughing and sowing the land; they are standing long hours at the
mechanic’s lathe. Women are everywhere.
And day by day the country is calling for more, and yet more
women workers. They are wanted on the land, they are wanted in
the factories, they are wanted in the shops, in offices, in schools,
they are wanted in every kind of industry. Women will answer the
call; they will take the places of those who have gone to fight, for
their patriotism is as strong as the patriotism of men. That women
should work to-day is unavoidable: it is war.
Yet necessary as this working of women is for the duration of war,
it is equally necessary that the conditions of their labour should be
regulated to meet the special needs of their feminine constitution. In
all cases where women are doing men’s work they should work
shorter hours, have longer rests and more holidays. Do we
understand what the results of overwork may be? It is racial suicide
to allow adolescent girls and young women, who are, or who will be,
mothers, to do work which may break into or overstrain their reserve
strength, using up now what ought to be given to the next
generation. A nation’s wealth and future depend directly on the
health and nerve reserve of its women. It is deplorable that these
forces of life are being used so wastefully. I know well that in the
confusion of the times it is not easy to get public attention for the
needs of women workers. Yet the importance of this matter is such
that delay may be disastrous.
A further consideration arises, and one, too, that is vital. After the
war, what will happen? Peace is the normal state of the world and
we shall return to it—some day. Are these conditions of continuous
work for women to go on then? There is much to cause grave fear.
Women—and I have spoken to many of them on the subject—seem
to regard this taking on of men’s work, not as a temporary thing
forced on them by the necessities of war, but as the gaining of a
goal for which for long they have been fighting.
Here is some of the talk that I have heard at women’s meetings or
read in recent articles by feminist writers: “New fields of action lie
open to women on all sides, the opportunities are coloured with
splendid possibilities”; or “The need for workers is woman’s
opportunity, and as such she recognises and will use it.” Again, “The
path lies open and clear before women, their hour has come to
establish a rooted and solid foundation for the woman worker of the
future.” And yet again, “Woman has done more than any man could
have imagined to win this war. At the same time she has won a new
station for herself.”
Now to me all such talk is the visible sign of the deplorable failure
in women’s lives. Feminists tell me that the breaking up of the
individual home with the institutional rearing of children will liberate
women. By this plan of reform they will be free, able to have
children and also to devote themselves to gainful work. They will
gain the economic independence for which they are so loudly crying.
Motherhood will be but a short interruption in the professional or
industrial career—mother-care a superstition of the past.
What can I say to show how misplaced and how mischievous is
the outlook of those who thus turn away from the long experience of
the past? It is not so that the problems of the future can be solved.
The past gives us proof enough that woman’s creation, the home,
has been her great contribution to civilisation. No transitory needs or
seeming personal gains can counterbalance the loss that must come
to us as a people from woman’s neglect of positive duties. There has
been neglect under industrial conditions. Escape was impossible.
And in our homes there has been urgent need for reform. Here I am
in agreement with those who discredit the value of the home. I, too,
am certain that our family and home life, in many directions, have
been as bad as they could be. A radical change is needed, but I
hope it will be in the opposite direction from the plan of institutional
upbringing of the children, and the substitution of the communal
dwelling-house for the individual home.
I know well, as every woman must know, that the creating of the
right kind of home is no easy task, but one that demands the
continuous presence of the mother, with an unceasing giving of
herself in body and in soul.
And the trouble is that under industrial ideals of restless
discontent and of pulling down the barriers, the majority of women
have become more and more unfitted for efficient home-making. Of
one fact I am certain. Things cannot go on as before. Here is the
reason. The supervision of the home and the maintenance of any
true form of family life is not compatible with the regular outside
occupation of married women. Such a duplication of a woman’s
energies can be undertaken only by her using for herself and her
work the reserve of physical, mental, and spiritual energy that
should be stored and given to her children. To deny this is
foolishness. Are women possessed of inexhaustible stores of energy?
Do the ordinary rules of arithmetic and subtraction not hold good in
their case? It would seem so. For women are maintaining that to
divert so large a proportion of their energies in fresh directions will
not involve any diminution of the strength available for their own
affairs. Women are oddly blind.
Yet modern experience makes it daily more evident that to do any
work well requires the employment of one’s whole time with a
complete concentration of attention. Now the woman is rare who
can put the best of herself both into professional work and into her
home. One or other must suffer, and since the standard required in
the outside work is fixed and cannot, as a rule, be lowered, if the
position is to be retained, it is the home that is certain to suffer. A
wife’s and a mother’s duties cannot be accomplished in stray hours
snatched from professional work. I speak from my own experience. I
know that the attempt to do this results too often in failure, together
with an intolerable overstrain.
The case is much worse with the industrial worker, the conditions
of whose existence make any kind of home life impossible. What,
then, is the remedy? The answer that will be given by many is the
raising of women’s wages to the same level as the wages of men
and the improving of the conditions of labour. This will do
something, but it will not do what I want. Conditions that at bottom
are continuously wrong need revolutionising, not patching up. The
change must be a different one, if the ideal of the home for which I
am pleading is to be saved. There is one way out, and only one. The
socially wasteful, racially suicidal, and body and soul withering
consequences of the working of mothers outside the home must
cease.
I know well the difficulties. Self-centred professional women,
worldly women who have never found their souls, cultured
intellectuals chasing the new, dreamers who think to reform society
—all these and many other women are preaching the doctrine that
the economic independence of woman is essential for her own well-
being and equality with men. This, as I believe, is a profound
mistake that is dependent on industrial values. But on this question I
have spoken already, and I shall speak again in a later chapter.
Let us clear our thoughts absolutely, or at least as far as we
humanly can, from personal standards of value. The home is not a
bygone contrivance to be given up as useless in the march of
humanity. Each home that is established in love will burn in its
children an ineradicable impression that no folly from those who
have missed its protection will be strong enough to destroy.
The demand that women shall prepare for competition with men
at all costs will fall into foolishness under wiser conditions of life.
This must surely be. For women’s qualities and capacities are
different from those of men. What is paramount in woman is
secondary in man; her dominant qualities are not the same as his,
but different. And by using her subordinate qualities, as she must
do, in competition with man, she is up against the dominant qualities
in him and will be beaten by him: on the other hand, if woman
develops her dominant qualities with a wise education in youth and
afterwards by training herself in the right performance of her own
work, she cannot fail increasingly to occupy a position of power. And
this is only another way of saying that woman can achieve her
highest position only as a woman. As a worker she has at all times
and in all races occupied a secondary place, as woman she is the
strongest force in life. We cannot escape from nature, and no matter
how seemingly urgent it is for women to train themselves to act like
men on account of prevailing economic conditions, it is always
wrong at the bottom to yield to those conditions: the results will not
fail to bring evil in the future.
Let us know where we are going.
War conditions have rushed women forward at a racing speed on
the paths which their desire previously had made them seek. If after
the coming of peace the desire of women is not turned back to
family duties and the home, if it still seems better and happier to
them to do men’s work than to do their own—then the individual
home may be swallowed up and replaced by some form of
communal living. This may be necessary; it can never be an ideal.
And further, let us remember that it will not be a step forward in
progress; rather will it be a sign of failure, a step made necessary by
the confusion and conflicts of our industrial civilisation. We delude
ourselves for want of knowledge when we think that we are thus
advancing to something that is new. The long houses of Iroquois
Indians, the joint tenement houses of the Pueblo peoples of New
Mexico and Arizona, and the village communities common among
the Panang Highlanders of Sumatra are a few instances of the many
early experiments in communistic life. Even Garden Suburbs have
been tried by the Creek Indians of Georgia, where the natives live
together in groups of associated dwellings.[73] Did I not tell you that
many of the reforms we are seeking in the belief that they are new
discoveries, giving proof of our progress, are really worn-out forms
that are as old as mankind? They are even older. I would recall the
curious experiments in co-operative child-rearing made by the Adélie
penguins, noted in Chapter V. These pre-human parents would seem
to be troubled with a strongly developed egoism. Craving liberty for
play, they pool their families in what I may perhaps call “the
primordial co-operative nursery scheme”—a plan of child-rearing
much advocated by advanced feminists. Among the penguins the
results are not satisfactory. True, the penguin mothers have liberty
to play with the penguin fathers, but the price thereby paid is an
excessively high mortality among the young birds.[74]
I recognise that co-operative nurseries and proposals for freeing
mothers to work outside the home have interest for some women,
and consequently have their use: they will help, no doubt, those
women who while desiring and physically fit to bear children, yet
have no capacity or wish to care for them. There are many such
women to-day. I regard this as a great evil.
It has been left to modern intellectual women to fail utterly to
understand the primary value of the home. Its first service is to
immerse the child in a protective environment of its own. I wish to
emphasise these five concluding words. They will make clearer why I
believe so firmly in the patriarchal individual family. Each child needs
to feel in personal connection with its surroundings—that what is
nearest to him belongs to him and is his own. And this connection
can be established only by love, and maintained by a lasting
tradition of duty on the part of both the parents bound to each other
in service to the child.
It is often objected that children are happier and healthier away
from their parents, and that no conditions could possibly be worse
than those which exist in countless homes. I know this. But it is no
indictment against the home as an institution, rather it is an
indictment of the kind of home and of the mother and the father.
I can hardly express too strongly my own want of faith in the
expert child-trainer. I have found always that they regard the child,
mainly, if not entirely, as something to be improved and instructed
on a definite plan. The expert is never human, and the child has
need of all the human element that it can get. It has absolute need

You might also like