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

Android Programming in Kotlin Starting With An App 1st Edition James pdf download

The document is a promotional overview of the book 'Android Programming in Kotlin: Starting With An App' by Mike James, which serves as an introduction to Android programming using Kotlin and Android Studio. It emphasizes the ease of getting started with Android development and the importance of understanding the system to create effective applications. The book focuses on building user interfaces and covers essential concepts and tasks needed to develop simple apps.

Uploaded by

adaratiibe
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)
13 views

Android Programming in Kotlin Starting With An App 1st Edition James pdf download

The document is a promotional overview of the book 'Android Programming in Kotlin: Starting With An App' by Mike James, which serves as an introduction to Android programming using Kotlin and Android Studio. It emphasizes the ease of getting started with Android development and the importance of understanding the system to create effective applications. The book focuses on building user interfaces and covers essential concepts and tasks needed to develop simple apps.

Uploaded by

adaratiibe
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/ 60

Android Programming in Kotlin Starting With An

App 1st Edition James pdf download

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

Get Instant Ebook Downloads – Browse at https://ebookname.com


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

Android Programming In Java Starting with an App 3rd


Edition James

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

Android Development with Kotlin 1st Edition Marcin


Moskala

https://ebookname.com/product/android-development-with-
kotlin-1st-edition-marcin-moskala/

Android Game Programming For Dummies 1st Edition Derek


James

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

Quintilian on the Teaching of Speaking and Writing


Translations from Books One Two and Ten of the
Institutio oratoria 2nd Edition James J. Murphy

https://ebookname.com/product/quintilian-on-the-teaching-of-
speaking-and-writing-translations-from-books-one-two-and-ten-of-
the-institutio-oratoria-2nd-edition-james-j-murphy/
Moral Character An Empirical Theory 1st Edition
Christian B. Miller

https://ebookname.com/product/moral-character-an-empirical-
theory-1st-edition-christian-b-miller/

HIV and the Pathogenesis of AIDS 3rd Edition Jay A.


Levy

https://ebookname.com/product/hiv-and-the-pathogenesis-of-
aids-3rd-edition-jay-a-levy/

Mastering Technical Communication Skills A Student s


Handbook 1st Edition Edition Peter Wide

https://ebookname.com/product/mastering-technical-communication-
skills-a-student-s-handbook-1st-edition-edition-peter-wide/

Autistic Spectrum Disorders in the Early Years 1st


Edition Lynn Plimley

https://ebookname.com/product/autistic-spectrum-disorders-in-the-
early-years-1st-edition-lynn-plimley/

Turbulence Coherent Structures Dynamical Systems and


Symmetry 2ed. Edition Holmes P.

https://ebookname.com/product/turbulence-coherent-structures-
dynamical-systems-and-symmetry-2ed-edition-holmes-p/
The House Will Come to Order How the Texas Speaker
Became a Power in State and National Politics 1st
Edition Patrick L. Cox

https://ebookname.com/product/the-house-will-come-to-order-how-
the-texas-speaker-became-a-power-in-state-and-national-
politics-1st-edition-patrick-l-cox/
Android Programming In Kotlin:
Starting with an App

Using Android Studio 3

First Edition

Mike James

I/O Press
I Programmer Library
Copyright © 2017 IO Press

All rights reserved. This book or any portion thereof may not be reproduced
or used in any manner whatsoever without the express written permission of
the publisher except for the use of brief quotations in a book review.

Mike James Android Programming In Kotlin: Starting with an App


1st Edition
ISBN Paperback: 978-1871962543
First Printing, 2017
Revision 0

Published by IO Press www.iopress.info


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

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

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

3
It is assumed that you can program, but not necessarily in Kotlin or Java – any
general object-oriented language will do as a starting point. As long as you are
happy with the idea of a loop, conditional, function and what objects are,
then you should have no problem working with Kotlin and Android.
Finally the development tool used is the latest version of Android Studio
because it doesn’t make sense not to use it or to use anything else.
This is the place to start.
Mike James
December 2017

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


Adventures With Android Studio on the I Programmer website:
www.i-programmer.info

There are additional articles on I Programmer that form the basis of the more
advanced books that are still in preparation. After updating and revision,
Android Adventures – Mastering Fragments will be published in print as
Android Programming: Mastering Fragments & Dialogs. The first draft of
Android Programming: Structuring a Complex App, which goes further into
threading, concurrency, life cycle and other topics crucial to a real world app,
is currently work in progress on the website.

To keep informed about forthcoming titles in the Android Programming


series visit the publisher’s website:
www.iopress.info
This is also where you will also find errata, update information to keep up
with changes in Android Studio and Android itself and, most importantly,
the code from the books. You can also provide feedback to help improve
future editions of Android Programming.

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

5
Chapter 4
Android Events 83
How Java Passes Functions...............................................................83
Android Events..................................................................................84
The Kotlin Object..............................................................................85
Passing Functions In Kotlin..............................................................87
Function References..........................................................................87
Anonymous Functions......................................................................89
The Lambda.......................................................................................89
Events Using Lambdas......................................................................90
Closure...............................................................................................91
Using Breakpoints.............................................................................93
Modern Java Event Handling............................................................94
Summary...........................................................................................96
Chapter 5
Basic Controls 99
Basic Input Controls..........................................................................99
Button Styles and Properties............................................................99
All Attributes...................................................................................104
Text Fields.......................................................................................105
The onEditorAction Event..............................................................108
CheckBoxes.....................................................................................109
Switches and Toggle buttons..........................................................110
Radio Buttons .................................................................................111
Summary.........................................................................................113
Chapter 6
Working With Layouts 115
Understanding Layouts...................................................................115
Layout Properties............................................................................116
Width and Height............................................................................118
Units................................................................................................118
A Control is Just a Box....................................................................120
Gravity.............................................................................................121
The FrameLayout............................................................................122
LinearLayout....................................................................................124
RelativeLayout.................................................................................128
Summary.........................................................................................133

6
Chapter 7
The ConstraintLayout 135
Automatic Constraints....................................................................136
Manual Constraints.........................................................................141
Bias Constraints...............................................................................143
Chains..............................................................................................144
A Chained Keypad..........................................................................147
Guidelines........................................................................................151
Groups.............................................................................................152
Sizing...............................................................................................153
Barriers............................................................................................158
Troubleshooting..............................................................................161
Summary.........................................................................................163
Chapter 8
Programming The UI 165
A UI Library.....................................................................................165
The View.........................................................................................165
Using setContentView.....................................................................166
The ViewGroup...............................................................................168
Programming Layout Properties.....................................................169
The View Hierarchy........................................................................171
XML Layout.....................................................................................171
Inflation Theory..............................................................................172
Finding View objects.......................................................................173
How to Build a UI?..........................................................................174
Summary.........................................................................................176
Chapter 9
Menus – Toolbar 177
Creating a Menu Resource..............................................................177
The Menu Tree................................................................................178
Displaying a Menu..........................................................................180
Using the Toolbar............................................................................181
Creating the App Bar ......................................................................185
Where's My Toolbar?.......................................................................186
Responding to Menu Events...........................................................186
Changing Menus in Code................................................................189
Controlling the Toolbar...................................................................192
Summary.........................................................................................193

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

8
Chapter 13
Life Cycle Of An Activity 243
Lifetime and State...........................................................................243
The Life Cycle of an App................................................................244
The Simple Approach.....................................................................245
Lifecycle Explorer...........................................................................246
Trying It Out....................................................................................247
Retaining State – the Bundle..........................................................248
Saving Additional UI Data..............................................................250
Complex UI Elements.....................................................................251
Advanced State Management.........................................................252
Summary.........................................................................................253
Chapter 14
Spinners 255
The Spinner and the Layout Editor................................................255
Introducing the ArrayAdapter........................................................257
Handling the Selection...................................................................259
Creating an ArrayAdapter from a Resource...................................262
Changing The List...........................................................................262
Summary.........................................................................................264
Chapter 15
Pickers 265
Working with Pickers......................................................................265
TimePicker.......................................................................................266
TimePicker in Code.........................................................................267
Updating the Time..........................................................................268
DatePicker........................................................................................269
Number Picker.................................................................................272
Multi-Digit Input.............................................................................276
Summary.........................................................................................279
Chapter 16
ListView 281
Understanding the Adapter............................................................281
Extending the ListAdapter Class....................................................282
Using the ArrayAdapter..................................................................283
Working with the Data....................................................................285
A Custom Layout.............................................................................288
A Custom ArrayAdapter.................................................................291
Reuse, Caching and General Layouts.............................................295
Custom Adapter..............................................................................298
Summary.........................................................................................299

9
Chapter 17
Android The Kotlin Way 301
What You No Longer Have To Type...............................................301
var & val...........................................................................................302
No More get & set............................................................................302
View Objects As Properties.............................................................304
Event Handlers................................................................................304
Data..................................................................................................306
Null Safety.......................................................................................307
Java Types and Null........................................................................308
Kotlin Aims to Help........................................................................310
Summary.........................................................................................311

10
Chapter 1

Getting Started With Android Studio

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

11
The Language Choice
With the release of Android Studio 3 you now have a choice of programming
in Java or Kotlin. The advantage of Java is that it is a well known and well
supported language. If you already program in Java or want to acquire the
skill then you might well be better off starting with Android Programming In
Java: Starting with an App ISBN: 978-1871962550
Kotlin may be a be a new language but it is already well supported for the
simple reason that it is 100% compatible with Java. The Android libraries are
all written in Java, but Kotlin can make use of them with no problems. It is
this that makes Kotlin Android development possible. What is more, you
aren’t restricted to Kotlin in a project. You can add Java code to your new
Kotlin project and you can add Kotlin code to an existing Java project.
Put simply, there is very little risk involved in moving to Kotlin and there is a
lot to be gained. Kotlin is a much simpler and cleaner language than Java. It
has had the benefit of seeing how Java evolved and avoiding those mistakes.
Kotlin attempts to get straight to the point. In Java you tend to write some
code over and over and it can be time consuming and hides the simplicity of
what you are trying to do. Whenever this happens Kotlin modifies the
language so that you can express what you are doing succinctly. Programmers
moving from Java to Kotlin generally find that they like it because they get
more done with less typing. Programmers who only know Kotlin don’t know
how lucky they are!
Kotlin does things differently from Java and while you can pick up the
language as you go you might like to read Programmer's Guide To Kotlin
ISBN:978-1871962536. It isn’t necessary, as long as you know Java or another
object-oriented language, you can pick up Kotlin as you develop your
Android apps but I recommend learning the finer points of the language
sooner or later. It pays off to know your language.
The way Kotlin is used and the ways it changes Android programming in
particular are introduced as we go along. However, the final chapter is a brief
look at the major influences of Kotlin on Android programming. If you want a
quick overview before you start then read the final chapter, but in many ways
it makes more sense to read it as a summary after you have encountered the
ideas in context.
The bottom line is that, unless you have a commitment to Java, you probably
should start new projects in Kotlin and convert existing projects to Kotlin a
bit at a time.

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

Making a Start
I'm not going to spend a lot of time explaining how to install Android Studio
in a step-by-step way as the Android website does a good job and it is more
likely to be up-to-date. It is worth, however, going over the basic principles.
https://developer.android.com/studio/
The installer will download everything you need including the JDK.
Windows:
1. Launch the downloaded EXE file,
android-studio-bundle-<version>.exe.
2. Follow the setup wizard to install Android Studio.
Mac OS X:
1. Open the downloaded DMG file,
android-studio-bundle-<version>.dmg
2. Drag and drop Android Studio into the Applications folder.

13
Linux:
1. Unpack the downloaded ZIP file,
android-studio-bundle-<version>.tgz,
into an appropriate location for your applications.
2. To launch Android Studio, navigate to the
android-studio/bin/
directory in a terminal and execute studio.sh. You may want to add
android-studio/bin/
to your PATH environmental variable so that you can start Android
Studio from any directory.
Accept any defaults that the setup program offers you – unless you have a
good reason not to. It installs not only Android Studio, but the SDK and the
virtual device system that lets you test your application.

In most cases Android Studio just installs with no problem.


Now you should be able to run Android Studio. If not the most likely cause of
the problem is the JDK and so re-installation is a best first option.

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

If you have already created some programs you might well see them listed in
Recent projects.
Assuming this is your first project select the option:
Start a new Android Studio project

15
You can ignore the details of the new project for the moment. All you have to
do is supply a name for your application – HelloWorld in this case. Also make
sure you have Include Kotlin support ticked – this is what makes the project
use Kotlin rather than Java. Accept the other defaults that Android Studio
has filled in for you.

When you click Next you are given the chance to pick what devices you are
targeting. Again simply accept the defaults:

Most of the time you will want to create apps that run on a version of Android
that captures the biggest market but if this isn't a concern then it can be better
to select a more recent Android version.

16
The next page lets you select a template for your project. In this case change
the selection to Basic Activity. This gives you some additional generated code
which makes the app easier to create an app that looks right. Every Android
application consists of at least one Activity and this template generates a
project with a single Activity ready for you to customize:

On the next page you can assign custom names for the various components of
your project that the template generates. For a real project you would assign
names that were meaningful but in this case you can accept the defaults:

Finally you can click the Finish button and wait as Android Studio creates all
the files you need. Even a simple Android project has lots of files so again it
all takes time.

17
First Look
When everything is ready you will see Android Studio for the first time.
As long as everything has worked you should eventually, it takes about three
minutes or more, be presented with a view of your new project starting off in
the Layout Editor:

Problems?
If you get any error messages then the chances are that your project hasn't
finished being processed. Wait a little while longer for the activity to stop. If
you look at the status line at the bottom of the window you will see a message
saying “Gradle Build Finished” when Android Studio has finished with your
new project.
If you still have problems it is worth trying the File,Invalidate Caches/Restart
command. This usually works for "Missing styles" and similar errors.

18
The IDE
Although there looks like a lot to master in Android Studio's user interface,
most of it you will only visit occasionally. The key things to notice are that
moving from left to right you have:
● The Project window
● The tool Palette and the Component Tree window
● The Layout Editor
● The Attributes window
Most of the time you will be using the Project window and the Attributes
window. You will also see different editors depending on what sort of file
you have selected. In this case you have by default a layout file,
content_main.xml, selected and hence you have a layout editor in the middle
of the screen.
Before we go into layout, which is one of the main topics of this book, it is
important that you know a little about the file structure of a project so that
you can navigate to its different parts.

Basic Project Structure


When the project has finished building all of the files created can be viewed
by opening the Projects tab. The main thing to notice is that there are a great
many folders and files:

It seems almost unbelievable that the simplest Android app you can create
involves so many files.

19
Don't panic. Most of the files that have been created are auto-generated and
most of the time you don't need to know anything about them, let alone open
or edit them. In fact opening and editing auto-generated files really isn't a
good idea.
So let's focus on the files that matter to us.
For our simple program there are only two important files. One of them
determines the behavior of the Activity:
MainActivity.kt
The other determines the visual appearance, or View, of the app:
content_main.xml
You can set which Activity is the one that the system starts, but by default it
is the single activity that you created and named when you set up the project.
You can change the default names but for the moment leave them as they are.
Despite this being a Kotlin project, the java directory, from your point of view,
is where most of the construction of your app occurs, so make sure you know
where it is. The res directory is where you store all of the resources, layouts,
bitmaps, etc, that your app needs.
So while things look complicated at the moment the only two project files
that matter to you, and your project, are MainActivity.kt in the java folder
and content_main.xml in the res folder.
The two other folders in the java folder are concerned with creating tests for
your program. This is not something that we need to worry about when first
starting to write Android apps.

Anatomy of an Activity
An Android app is made up of one or more Activity classes.
You can think of an Activity as being something like a web page complete
with HTML to determine what displays and JavaScript to determine what it
does.
In the case of an Activity the layout is determined by the XML file in resource
(res) folder, this is often called the View, and the behavior is determined by
the Kotlin or Java code in the java folder.
The XML can be thought of as a markup language much like HTML or XAML.
It defines an initial layout for the screen when the app first runs. It is possible
to generate new layout components at runtime from the Java file. In fact, if
you really want to, you can dispense with the XML file and generate
everything from code, but as you will discover the XML markup approach is
much the best way to do the job because of the availability of the Layout
Editor.

20
So to be 100% clear in a Kotlin project:
● The kt file contains the code that makes your app behave in particular
ways.
● The .xml layout file contains a definition of the initial UI, the View, of
your app.

Hello Layout Editor


Let's take a look at the two files that have been generated for our initial Hello
World application beginning with the XML layout. Double click on
content_main.xml file in the Project tab and the file will open (if it isn't
already open). If it is already open you can also select its tab displayed just
above the editor area. You can select any file that is open for editing by
selecting its tab.
You can work with the XML directly to define where all the buttons and text
go, and later you will learn how to edit it when things go wrong or to fine
tune it. However, Android Studio provides you with a very nice interactive
editor – the Layout Editor and this is worth using.
As you become more experienced the idea of switching between a design
view and an XML view will become second nature. Think of the interactive
editor as a very easy way of generating the XML that otherwise would take
you ages to get right. If you look at the bottom left you will see two tabs –
Design and Text:

You can switch between editing the XML as text, and editing it in the drag-
and-drop Layout Editor simply by clicking on the tab. If you now click on the
tab the window will display the Layout Editor but be patient the first time
you do this it might take a few moments.

21
The Layout Editor looks a little too much to take in when you first see it but
you will quickly get used to it. On the left is a Palette of all of the components
or controls - buttons, text, checkboxes and so on - that you can place on the
design surface:

In the middle is the design surface and this defaults to the screen size and
appearance of the Nexus 5. You can select other devices to work with.

22
There are, in fact, two views of the layout that you can use, the design and the
blueprint. By default you are shown the design view but you can display
either view using the menu at the top left of the design area.

You can display both views together but in most cases available screen area is
the main issue and showing just one is the best option. The design view
shows you the layout as a close approximation to how it will appear on a real
device. The blueprint view doesn’t try to render the UI realistically but it does
provide you will more layout information to help you position and size
elements. Use whichever you are most happy with.

23
On the left, below the Palette, you have the Component Tree which shows
you the structure of your layout, that is how different UI components are
contained inside others. It shows you the structure of the XML file in an
easier to use form. You can use the Component Tree as an easy way of to
select individual UI components by clicking on their names. You can also
drag-and-drop UI components onto the Component Tree to position them
accurately within the hierarchy.
On the right you have the Attributes window that can be used to set the
attributes, such as width, height, color and so on of any component in the
layout. If you have used any drag-and-drop Layout Editor then this will seem
familiar and if you have struggled with detailed layout using a markup
language, be it HTML, XAML or XML, you will appreciate how easy the
Layout Editor makes building and testing a UI.
In the case of our sample program the only component is a single TextView
already containing the text "Hello World". A TextView is the standard
component to use when all we want to do is to display some static text.

24
You can modify the greeting text if you want to. Select the TextView
component either on the design or in the Component Tree and use the
Attributes window to find its Text attribute. Change this to read "Hello
Android World":

Use the text field without the spanner icon. The properties with the spanner
icon next to them are used to set values that only show in the Layout Editor.
In this case the text field without the spanner icon is the one that controls
what appears in your app at runtime.
You can use the Layout Editor to create any UI you care to and you really
don't have to get involved in the XML that corresponds to the layout – unless
things go wrong or you need to do something so sophisticated that the Layout
Editor doesn't support it.

25
Random documents with unrelated
content Scribd suggests to you:
Pokebroc

In Pokebroc Robertus de Cauz i. hid. et. i. virg. de feudo


Regis. Ibidem Walterus de Clopton ii. hid. et dim. de
feudo Burgi. Ibidem Rogerus Marmium i. hid. et i. virg.
de eodem feudo.

In Armeston [Armston] de Burgelay ii. hid. [et] dim. de


eodem feudo. Ibidem Turkil i. hid. de eodem feudo.
Ibidem Wydo Maufee i. hid. de eodem feudo. Ibidem
Galfridus de Gunthorp ii. partes dim. hid. de eodem
feudo. Ibidem Tedrik' iii. partes de dim. hid. de eodem
feudo.

In Pappele [Papley] i. hid.

In Lillington [Lutton] i. hid.

In Hennington Berengerus le Moyne ii. hid. [et] dim. de


feudo de Rammes[eye]. Ibidem Ricardus filius Gilberti i.
hid. et i. virg. et dim. de feodo Burgi. Ibidem Wydo
Maufe dim. hid. et dim. virg. de eodem feodo. Ibidem
Reginaldus le Moyne dim. hid. et dim. virg. de eodem
feodo.

In Kynesthorp [Kingsthorp] Walterus de Lodington i.


hid. et i. virg. de feodo Burgi. Ibidem Willelmus de
Chirchetot dim. hid. de feodo Regis.

In Therninge [Thurning] Rogerus Marmioun iii. parvas


virg. de feodo Burgi.

In Ayston [Ashton] Abbas de Burgo iiii. hid. in dominico.


Ibidem Papilun dim. hid. de eodem feodo. Ibidem
Leuenoth dim. hid. de eodem feodo.
In Undele [Oundle] Abbas in dominico vi. hid. Ibidem
Vivien i. parvam virg.2

Duo Hundred de Nasso

In Stinton Willelmus de Lisurs ii. hid.

In Bernak Fulco paynel iii. hid.3

In Wirthorpe Abbas Croylaund ii. hid. Ibidem de feodo


Eudonis Dapiferi i. virg.

In Eston [Easton] Simon i. hid. [et] dim.

In Peychirche [Peakirk]. In Etton. In Northburgo dim.


virg.

In dominico Abbatis de Burgo sancti Petri lxx. hid. et iii.


virg. et dim.

Hundred de Sutton

In eadem villa [King's Sutton] Dominus Rex habit in


dominico iiii. hid.

In eadem villa Willelmus de Quency i. hid. [et] dim. et


parvam virg. terre de Comitat[u] Leycestr[ie]. Ibidem
Alfredus viii. parvas virg. de Gilberto de Pinkeny. Ibidem
Paganus i. hid. et dim. et i. parvam virg. de feodo
Comit[is] Leycestri[ie], Robertus filius Osberti tenuit.

In Evenle i. hid. et i. parvam virg. de feodo Comit[is]


Leyc[estrie].
In Preston dim. hid. de feodo Comit[is] Leyc[estrie].

In Croulton [Croughton] iiiior. parvas virg. de feodo


Comit[is] Leyc[estrie]. Ibidem Sewar' i. hid. et ii. parvas
virg. de feodo Leyc[estrie]. Ibidem Brien filius Comitis i.
hid. [et] dim. et ii. parvas virg. de feodo de Walinford.

In Neubottle Regis [sic] de Reynes vi. hid. et i. parvam


virg. de feodo Comitis Leyc[estrie], Willelmus de Lepyn
tenuit.

In furningho [Farningho] iiii. hid. de feodo Comitis


Leyc[estrie].

In Cherlington [Charlton] Maynardus i. hid. [et] dim. et


i. parvam virg. Ibidem Simon Chendut i. hid. [et] dim.
de feodo de Berkamstede et i. parvam virg. Ibidem Odo
dapifer viii. parvas virg. de feodo de Colescestra.

In Gremesbir' [Grimsbury] Aunsel' de Chokes ii. hid. et


iiii. parvas virg. scil. quarta pars ii. hid.

In Middleton Willelmus Me[s]chin i. hid. et dim. et i.


parvam virg. de feodo Willelmi de Curcy.

In alia Middleton [Middleton Chenduit] Simon Chendut


ii. hid. de feodo de Berkamstede.

In Thayniford [Thenford] Mainfenn de Walrentone i. hid.


Ibidem Robertus Basset i. hid. de feodo de Walingford.

In Ayno [Aynho] Willelmus de Mandeville iii. hid.

In Middelton monachi de sancto Eu'ald4 ii. hid.

In Walton i. hid. cum ii. virg. in Sutton quas Suouild


tenuit.
In Gildeby i. hid. et vii. parvas virg. de feodo de Mortal'
[sic].

Hundred de Albodestowe

In Chacombe iiii. hid. de feodo Episc. Lincoln.

In Evenle ii. hid. et [sic] i. parvam virg. minus quas


Alouf de Merke tenuit.

In Thorpe [Thorpe-Mandeville] ii. hid.

In Stanes [Stene] Gilbertus de Pinkeny ii. hid.

In Colewyth [Culworth] Willelmus ii. hid. et iiii. parvas


virg. Ibidem Otuer i. hid.

In Stotebyr[e] [Stotesbery] ii. hid. quas monachi Norht'5


tenent.

In Rodestone [Radston] ii. hid. de feodo Comitis


Cestr[ie].

In Wytefeld [Whitfield] Gilbertus de Monte ii. hid. et ii.


virg. in dominico.

In Merston [Merston St Lawrence] Radulfus Murdac iiii.


hid. de feodo Comitis Leyc[estrie].

In Siresham Thomas Sorel i. hid. [et] dim. Ibidem


Comes Leyc[estrie] i. parvam virg. Ibidem Gilo dim. hid.
Ibidem Willelmus filius Alui' [? Alan] iiii. parvas virg.

In Helmendene [Helmedon] Willelmus de Torewelle iiii.


hid. de feodo Comitis Leyc[estrie].
In Chelverdescote dim. hid. Idem. Comes Leyc[estrie].

In Brackle et Hausho [Hawes] idem Comes vii. hid. [et]


dim.

Hundred de Wardon

In Wardon Ricardus foliot6 ii. hid. [et] dim. et i.


magnam virg., scilicet quarta pars i. militis de feodo
Regis in capite.

In Estone [Aston] et Apeltreya [Apeltre] Willelmus de


Bolonia vii. hid. de feodo Comitis de Mandeville.

In Bottolendon [Boddington] Fulco Paynel7 ii. hid. una


ex illis de feodo Cestr[ie]. Ibidem Willelmus Meschin i.
hid. Ibidem i. hid. de feodo Episcopi Lincoln.

The only writer, it would seem, who has used this important survey is
Bridges, who refers to it throughout in his Northamptonshire as of the
time of 'Henry II'. A good instance of the confusion caused by this
assumption is seen in the remarks of Bridges as to Barnack (ii. 491),
where he is puzzled by our record, giving as its lord, not Gervase
Paynell, but Fulc Paynell (who was really his grandfather). To refute
his conclusion, it is sufficient to refer to the first name entered—that
of 'Albricus Camerarius'. This was no other than Aubrey de Vere, a
trusted minister of Henry I, who was made by him Great Chamberlain
in 1133, and who was slain in May 1141.8 His Northamptonshire
estate descended to his younger son, Robert, who, as 'Robertus filius
Albrici Camerarii', made his return as a Northamptonshire 'baron' in
1166.9 There can, therefore, be no confusion between Aubrey the
Chamberlain (d. 1141) and his eldest son and namesake. Yet if, from
the occurrence of his name, we pronounced the date of this survey to
be 1133-41, we should be in error. There are names belonging to an
earlier, as to a later, date than this.

Among the earliest are 'Ricardus filius Wydonis', the son and
successor of Guy de Raimbercurt, a great Domesday tenant-in-chief;
Walter fitz Winemar, whose father was both a tenant in capite and
under-tenant in Domesday; and Ralf fitz Oger, whose name illustrates
the value of these early surveys; for the entry proves that Oger, the
Northamptonshire tenant-in-chief (D.B., i. 228), was identical with
Oger 'Brito', the Lord of Bourne, Linc. (i. 364b), and that the son and
successor of this Oger was Ralf. We also recognize Roger Marmion,
who was succeeded, under Henry I, by Robert; Nigel de Albini, the
founder of the house of Mowbray; Michael de Hanslape, who died
under Henry I; and 'Robertus filius Regis', who became Earl of
Gloucester circ. 1122. Other tenants, living temp. Hen. I, are William
de Mandeville,10 William Meschin, Richard Basset, Viel (Vitalis)
Engaine, Baldwin fitz Gilbert, and Brian fitz Count. As for Ascelin de
Waterville and Alouf de Merke, they are found as under-tenants in
Domesday itself. On the other hand, such a name as 'Comes Warenn
de Morteyn' points to the latter years of Stephen's reign, or to the
early days of that of Henry II; while the mention of the earldoms of
Arundel, Ferrers (Derby) and Essex preclude, of course, an earlier
date than 1140.

After careful examination, I propound the solution that this survey


was originally made under Henry I, and was subsequently corrected
here and there, to bring the entries up to date, down to the days of
Henry II. The late transcriber, to whom we owe the survey in its
present form, has incorporated these additions and corrections in a
single text with the most bewildering result. We trace exactly the
same process in the Red Book of the Exchequer. In the Black Book the
later additions that were made to the barons' cartae of 1166 are
distinguished by the difference in handwriting. But in the Red Book
these interpolations are found transcribed in the same hand as the
genuine original returns. To the uninitiated this has been the cause of
no small confusion. So, too, in the above list of Peterborough knights
(p. 157), the very first entry, made temp. Hen. I, has been carried on
by a later hand to the time of Henry III. But there Stapleton, who
transcribed the list, carefully discriminated between the two.11 It is
probable that the lists of Abingdon knights, published in the Abingdon
cartulary, are rendered untrustworthy in places from the same cause
of error.

The transcriber's ignorance is clearly shown by such a name as


'Comes Mauricius', which is evidently his erroneous extension of an
original 'Comes Maur'', i.e. Count of Mortain! So also we are enabled
to detect proof of the theory I advance in such an entry as 'Willelmus
Meschin de feodo Wellelmi de Curcy'; for William de Curcy held, temp.
Henry II, the barony held by William Meschin (his maternal
grandfather, according to Stapleton12) temp. Henry I. Thus, the
original entry will have run 'William Meschin', while a later hand, in his
grandson's days, will have added, by way of substitution, 'De feodo
William de Curcy'.13 Our transcriber, combining the two, has, of
course, made nonsense of the whole. The same explanation applies to
the entry, 'Robertus filius Regis de feodo Glovernie', where the first
three words represent the original entry, while the others were added,
probably under Henry II, to connect the holding with the fief of [the
Earl of] Gloucester. 'Brien filius Comitis de feodo de Wallin[g]ford' is
another instance in point, and so, I suspect, is 'Odo [sic] dapifer de
feodo de Colcestra'; for I take it that the entry was originally made in
the lifetime of Eudo Dapifer (d. 1120) and that, as his 'honour' passed
into the King's hands, the 'de feodo de Colcestra' was added at a later
time.14

I have given sufficient of the survey to prove that, in spite of


confusion and corruption, it possesses a real value. If we take, for
instance, Polebrook ('Pochebroc'), a township of five hides, we find
that in Domesday (221b, 228) Eustace ('the Sheriff') held a hide and a
quarter in capite and three hides and three quarters as a tenant of
Peterborough Abbey (see p. 138). Now our survey shows us the
former holding in the hands of Robert de Cauz, while the other has
been broken up, two-thirds of it passing to Walter 'de Clopton' and
one-third to Roger Marmion.

Just below, in the case of Hemington, also a Vill of five hides, which
was equally divided between the Abbeys of Peterborough and
Ramsey, we read in Domesday that 'iii. milites' held the Peterborough
half (221b). Our survey enables us to distinguish their tenancies—
Richard fitz Gilbert holding a hide and three-eighths; Guy Maufe, five-
eighths of a hide, and Reginald le Moyne the same.15 But we can go
further and identify the first, from his holding, as the son of Gilbert
Fauvel, the Domesday tenant (see p. 138); while the second was the
heir, and probably the son of Roger Malfed (see p. 132).

One more instance may be given. Our survey reckons Clapton


('Cloptone') as five and a quarter hides, of which 'Walter' held one and
a quarter in capite. Here again he had succeeded Eustace, whose
Domesday estate at 'Dotone' (228) ought, as Bridges conjectured, to
have been entered 'Clotone'.16 On the other hand, his tenancy of the
Abbot at 'Clotone' had been broken up, half a hide of it passing to
Ascelin de Waterville. All this goes to show that the fief of Eustace the
Sheriff did not, as has been alleged, descend to his heirs.

Such an entry as 'In Lilleford, Willelmus Olyfart v. hidas de feudo


Regis Scotiæ' is peculiarly suggestive. It reminds us that David
Holyfard, godson of King David of Scotland, and his protector in 1141,
was the founder of the house of Oliphant; and in the family's
possession of Lilford (which was held of the Countess Judith in 1086)
we see the origin of their Scottish connection. William 'Olifard' was of
Northamptonshire, and Hugh 'Olifard' of Huntingdonshire in 1130;17
while Hugh 'Olifart' (of Stoke) was a knight of the Abbot of
Peterborough in rather earlier days. The earliest member of the
house, however, it would seem, on record is Roger Olifard, who
witnessed (doubtless as his tenant) Earl Simon's charter to St.
Andrew's, Northampton, granted, probably, not later than 1108. This,
of course, is but one of the cases in which the son of a Norman house
settled in Scotland through its King's connection with the earldoms of
Huntingdon and Northampton.

At the close of the survey I have here discussed there is a list of the
knights of Peterborough (fos. 99b, 100) holding in Northamptonshire.
It ought to be carefully compared with the one I have examined
above (p. 131), being, it seems probable, about a generation later.
Such entries as these, at least, are conclusive for the holding to which
they refer:

Paganus de Roger
Helpestun fil[ius]
terciam Pagan[i]
partem unius in
militis Helpestun
(Chronicon terciam
Petroburgense, partem i.
p. 171). militis
(Vesp. E.
xxii., fo.
100).

In the same way, Roger Marmion had been succeeded by Robert. This
second list is of special value from the fact that the Peterborough
carta of 1166 gives no particulars of the knights or of their fees.

1 Or Sh——.

2 See Chronicon Petroburgense, p. 158.

3 See Bridges' Northamptonshire, ii. 491.

4 St. Evroul, Grantmesnil's in Domesday.

5 St Andrew's Priory, Northampton.


6 The heir of Guy de Raimbercurt.

7 Clearly Fulk Paynel the first, Founder of Tykford Priory.

8 Geoffrey de Mandeville, p. 81.

9 See also as to Twywell itself. Mon. Ang., ii. 603:

'Ego Albericus, regis camerarius terram de Twiwell quamdiu vixero de


domino abbate Guntero et monachis de Thorneya per talem
conventionem teneo adfirmam.'
'Ego Robertus filius Albrici camerarii regis terram de Twiwelle quamdiu
vixero de domino abbate Roberto et monachis de Thorneia per eandem
conventionem in feodi firmam teneo per quam conventionem pater
meus ante me tenuit.'
The Great Chamberlain occurs again on fo. 97b, where we read:
'In alia Adington Albric[us] Camerar[ius], ii. hid. de feodo Regis.'

10 If, as probable, the son of the Domesday Baron.

11 Chronicon Petroburgense, pp. 168-9.

12 Holy Trinity Priory, York, p. 35.

13 Since this was written I have come across a curious confirmation of the
hypothesis advanced. In the Lindsey Survey (Ed. Greenstreet), an entry on
fo. 20, in the original ran: 'Comes Odo [tenet] in Aldobi', above which a
later hand has interlined, 'De feodo Comitis Albemerle'. It is curious that in
the same survey another later interlineation—'Comes Lincoln'—was, though
distinguished by Hearne, incorporated with the text by Mr Waters (see p.
151).

14 Eudo was identified with Colchester.

15 Giving a total of 2⅝, instead of 2½—a trivial discrepancy.

16 It is singular that in Sussex the 'Cloninctune' of Domesday is, conversely,


an error for 'Doninctune'. The source of the error in both cases must have
been the likeness of 'cl' to 'd' in the original returns, on which these names
cannot have begun with a capital letter.
17 Rot. Pip., 31 Hen. I.

THE INTRODUCTION OF KNIGHT SERVICE INTO


ENGLAND1
'The growth of knighthood is a subject on which the
greatest obscurity prevails; and the most probable
explanation of its existence in England, the theory that
it is a translation into Norman forms of the thegnage of
the Anglo-Saxon law, can only be stated as probable.'—
Stubbs, Const. Hist., i. 260.

In approaching the consideration of the institutional changes and


modifications of polity resulting from the Norman Conquest, the most
conspicuous phenomenon to attract attention is undoubtedly the
introduction of what it is convenient to term the feudal system. In the
present paper I propose to discuss one branch only of that process,
namely, the introduction of that military tenure which Dr Stubbs has
termed 'the most prominent feature of historical feudalism'.

In accordance with the anticataclysmic tendencies of modern thought,


the most recent students of this obscure problem have agreed to
adopt the theory of gradual development and growth. The old views
on the subject are discredited as crude and unhistorical:2 they are
replaced by confident enunciation of the theory to which I have
referred.3 But when we examine the matter closely, when we ask for
details of the process by which the Anglo-Saxon thegn developed into
the Norman knight, we are met at once by the frank confession that
'between the picture drawn in Domesday and the state of affairs
which the charter of Henry I was designed to remedy, there is a
difference which the short interval of time will not account for'.4 To
meet this difficulty, to account for this flaw in the unbroken continuity
of the series, a Deus ex machinâ has been found in the person of
Ranulf Flambard.

Now this solution of the difficulty will scarcely, I venture to think, bear
the test of investigation. It appears to have originated in Dr Stubbs'
suggestion that there must have been, between the days of Henry I
and of William I, 'some skilful organizing hand working with neither
justice nor mercy'5—a suggestion subsequently amplified into the
statement that it is to Ranulf Flambard 'without doubt that the
systematic organization of the exactions' under William Rufus 'is to be
attributed',6 and that by him 'the royal claims were unrelentingly
pressed', his policy being 'to tighten as much as possible the hold
which the feudal law gave to the king on all feudatories temporal and
spiritual'.7 There is nothing here that can be called in question, but
there is also nothing, be it observed, to prove that either 'feudal law'
or 'military tenure' was introduced by Ranulf Flambard. Indeed, with
his usual caution and unfailing sound judgment, our great historian is
careful to admit that 'it is not quite so clear' in the case of the lay as
of the church fiefs 'that all the evil customs owed their origin to the
reign of William Rufus'.8 And, even if they did, they were, it must be
remembered, distinctly abuses—'evil customs', as Henry I himself
terms them in his charter—namely (in the matter we are considering),
'excessive exactions in the way of reliefs, marriages and wardships,
debts to the crown, and forfeiture. In the place,' we are told, 'of
unlimited demands on these heads, the charter promises, not indeed
fixed amercements, but a return to ancient equitable custom'.9 All this
refers, it will be seen, to the abuse of an existing institution, not to
the introduction of a new one. The fact is that Ranulf's proceedings
have been assigned a quite exceptional and undue importance.
Broadly speaking, his actions fall under a law too often lost sight of,
namely, that when the crown was strong it pressed, through the
official bureaucracy, its claims to the uttermost; and when it found
itself weak, it renounced them so far as it was compelled. Take, for
instance, this very charter issued by Henry I, when he was 'playing to
the gallery', and seeking general support: what was the value of its
promises? They were broken, says Mr Freeman, to the Church;10 they
were probably broken, says Dr Stubbs, to the knights;11 and they
were certainly broken, I may add, to the unfortunate tenants-in-chief,
whom the Pipe-Roll of 1130 shows us suffering from those same
excessive exactions, of which the monopoly is assigned to Ranulf
Flambard, and which 'the Lion of Justice' had so virtuously renounced.
I might similarly adduce the exactions from the Church by that
excellent king, Henry II (1159), 'contra antiquum morem et debitam
libertatem'; but it is needless to multiply examples of the struggle
between the interests of the crown and those of its tenants-in-chief,
which was as fierce as ever when, in later days, it led to the
provisions of the Great Charter. What the barons, lay and spiritual,
complained of from first to last, was not the feudal system that
accompanied their military tenure, but the abuse of that system in the
excessive demands of the crown.

Mr Freeman, however, who had an equal horror of Ranulf Flambard


and of the 'feudal system', did not hesitate to connect the two more
closely even than Dr Stubbs, though invoking the authority of the
latter in support of his extreme views. The passages to which I would
invite attention, as expressing most concisely Mr Freeman's
conclusions, are these:

The system of military tenures, and the oppressive


consequences which were held to flow from them, were
a work of the days of William Rufus.

If then there was any time when 'the Feudal System'


could be said to be introduced into England, it was
assuredly not in the days of William the Conqueror, but
in the days of William the Red. It would be more
accurate to say that all that we are really concerned
with, that is, not an imaginary 'Feudal System', but a
system of feudal land-tenures, was not introduced into
England at all, but was devised on English ground by
the malignant genius of the minister of Rufus.12
As the writer's line of argument is avowedly that of Dr Stubbs, it is
only necessary to consider the point of difference between them.
Where his predecessor saw in Henry's charter the proof that Ranulf
Flambard had abused the existing feudal system by 'excessive' and
'unlimited' demands, Mr Freeman held, and endeavoured to convince
us, that he had introduced not merely abuses of the system, but the
actual system itself.13 The question virtually turns on the first clause
of the charter;14 and it will not, I think, be doubted that Dr Stubbs is
right in adopting its natural meaning, namely, that the novelty
introduced by Ranulf was not the relevatio itself, but its abuse in
'excessive exactions'. Indeed, even Mr Freeman had virtually to admit
the point.15 If, then, the argument breaks down, if Ranulf cannot be
shown to have 'devised' military tenure, how are we to bridge over
the alleged chasm between the date of Domesday (1086) and that of
Henry's charter (1100)? The answer is simply that the difficulty is
created by the very theory I am discussing: it is based on the
assumption that William I did not introduce military tenure,16
combined with the fact that 'within thirteen years after the
Conqueror's death, not only the military tenures, but the worst abuses
of the military tenures, were in full force in England'.17 But, here
again, when we examine the evidence, we find that this assumption is
based on the silence, or alleged silence, of Domesday Book.18 Now no
one was better aware than Mr Freeman, as an ardent student of 'the
great Record', that to argue from the silence of Domesday is an error
as dangerous as it is common. Speaking from a rather wide
acquaintance with topographical works, I know of no pitfall into which
the local antiquary is more liable to fall. Wonderful are the things that
people look for in the pages of the great survey; I am always
reminded of Mr Secretary Pepys' writing for information as to what it
contained 'concerning the sea and the dominion thereof'.19 Like other
inquests, the Domesday Survey—'the great inquest of all', as Dr
Stubbs terms it—was intended for a special purpose; special questions
were asked, and these questions were answered in the returns. So
with the 'Inquest of Sheriffs' in 1170; so also with the Inquest of
Knights, if I may so term it, in 1166. In each case the questions asked
are, practically, known to us, and in each they are entirely different.
Therefore, when Mr Freeman writes:

The survey nowhere employs the feudal language which


became familiar in the twelfth century. Compare, for
instance, the records in the first volume of Hearn's Liber
Niger Scaccarii. In this last we find something about
knights' fees in every page. In Domesday there is not a
word—20

it is in no spirit of captious criticism, but from the necessity of


demolishing the argument, that I liken it to basing conclusions on the
fact that in the census returns we find something about population in
every page, while in the returns of owners of land there is not a word.
As the inquest of 1166 sought solely for information on knights and
their fees, the returns to it naturally contain 'something about knights'
fees in every page'; on the other hand, 'the payment or nonpayment
of the geld is a matter which appears in every page of the survey' [of
1086] because 'the formal immediate cause of taking the survey was
to secure its full and fair assessment'.21 Nor is this all. When the
writer asserts that 'in Domesday there is not a word' about knights'
fees, he greatly overstates his case, as indeed is shown by the
passages he proceeds to quote. I shall be able to prove, further on,
that knights' fees existed in cases where Domesday does not mention
them, but even the incidental notices found in the Great Survey are
quite sufficient to disprove its alleged silence on the subject. As Mr
Freeman has well observed:

Its most incidental notices are sometimes the most


precious. We have seen that it is to an incidental, an
almost accidental notice in the Survey that we owe our
knowledge of the great fact of the general redemption
of lands.22

Here then the writer does not hesitate to base on a single accidental
notice the existence of an event quite as widespread and important as
the introduction of knight service.23

I have now endeavoured to make plain one of the chief flaws in the
view at present accepted, namely, that it is mainly grounded on the
negative evidence of Domesday, which evidence will not bear the
construction that has been placed upon it—and further that, even if it
did, we should be landed in a fresh difficulty, the gulf between
Domesday and Henry's charter being only to be bridged by the
assumption that Ranulf Flambard 'devised' and introduced military
tenure, with its results—an assumption, we have seen, which the facts
of the case not only fail to support, but even discountenance wholly.

Let us pass to a second difficulty. When we ask the advocates of the


view I am discussing what determined the number of knights due to
the crown from a tenant-in-chief, we obtain, I venture to assert, no
definite answer. At times we are told that it was the number of his
hides; at times that it was the value of his estate. Gneist, who has
discussed the matter in detail, and on several occasions, has held
throughout, broadly speaking, the same view: he maintains that 'since
Alfred's time the general rule had been observed that a fully equipped
man should be furnished for every five hidæ, but it had never been
established as a rule of law as in the Carlovingian legislation':24
consequently, he urges, 'a fixed standard for the apportionment of the
soldiery was wanting' at the time of the Conquest, and this want was
a serious flaw in the Anglo-Saxon polity. William resolved to make the
system uniform, and

the object that the royal administration now pursued for


a century was to impose upon the whole mass of old
and new possessors an equal obligation to do service
for reward. The standard adopted in carrying out this
system was approximately that of the five hides
possession of the Anglo-Saxon period; yet with a stricter
rating according to the value of the produce.25
The difficulty encountered in ascertaining this value was a main cause
of the Domesday Survey being undertaken. This is Gneist's special
point on which he invariably insists: 'Domesday book laid the basis of
a roll of the crown vassals';26 upon it, 'in later times, the fee-rolls
were framed'.27 By its evidence, 'according to the extent and the
nature of the productive property, could be computed how many
shields were to be furnished by each estate, according to the
gradually fixed proportion of a £20 ground rent'.28 For 'the feuda
militum thus computed are no knights' fees of a limited area',29 but
'units of possession', the unit being £20 in annual value.

Dr Stubbs, on the other hand, while rejecting the view that military
service, since the days of Alfred, had been practically fixed at one
warrior for every five hides,30 leans nevertheless to the belief that the
knight's fee was developed out of the five-hide unit, and that the
military 'service' of a tenant-in-chief was determined by the number of
such units which he possessed. But, as he also recognizes the £20
unit, there will be less danger of misrepresenting his views if I append
verbatim the relevant passages:

The The value of


customary the knight's
service of fee must
one fully already have
armed man been fixed—
for each five twenty
hides was pounds a
probably the year.32
rate at
which the
newly
endowed
follower of
the king
would be
expected to
discharge
his duty ...
and the
number of
knights to
be furnished
by a
particular
feudatory
would be
ascertained
by inquiring
the number
of hides that
he held.31

The number It cannot


of hides even be
which the granted
knight's fee that a
contained definite
being area of land
known, the was
number of necessary
knights' fees to
in any constitute a
particular knight's
holding could fee; ... It is
be easily impossible
discovered.33 to avoid the
conclusion
All the that the
imposts of extent of a
the ... knight's fee
Norman was
reigns, were, determined
so far as we by rent and
know, raised valuation
on the land, rather than
and acreage,
according to and that
computation the
by the hide: common
... the feudal quantity
exactions by was really
way of aid ... expressed
were levied in the
on the twenty
hide.34 librates,
etc.35

The
variation in
the number
of hides
contained in
the knight's
fee.36

Mr Freeman's views need not detain us, for he unhesitatingly accepts


Dr Stubbs' arguments as proving that the Norman military tenure was
based on 'the old service of a man from each five hides of land'.37

We find then, I submit, that the recognized leaders of existing opinion


on the subject cannot agree among themselves in giving us a clear
answer, when we ask them what determined the amount of 'service'
due from a Norman tenant-in-chief, or, in other words, how that
'service' was developed in unbroken continuity from Anglo-Saxon
obligations.
The third point that I would raise is this. Even assuming that the
amount of 'service' bore a fixed proportion—whether in pecuniary or
territorial units—to the extent of possession, we are, surely, at once
confronted by the difficulty that the owner of x units of possession
would be compelled, for the discharge of his military obligations, to
enfeoff x knights, assigning a 'unit' to each. A tenant-in-chief, to take
a concrete instance, whose fief was worth £100 a year, would have to
provide ex hypothesi five knights; if, as was quite usual, he enfeoffed
the full number, he would have to assign to each knight twenty
librates of land (which I may at once, though anticipating, admit was
the normal value of a knight's fee), that is to say, the crown would
have forestalled Henry George, and the luckless baro would see the
entire value of his estate swallowed up in the discharge of its
obligations.38 What his position would be in cases where, as often, he
enfeoffed more knights than he required, arithmetic is unable to
determine. I cannot understand how this obvious difficulty has been
so strangely overlooked.

The fourth and last criticism which I propose to offer on the subject is
this. If we find that under Henry II—when we meet with definite
information—a fief contained, as we might expect, more 'units of
possession' than it was bound to furnish knights (thus leaving a
balance over for the baro after sub-infeudation), we must draw one of
two conclusions: either this excess had existed from the first; or, if the
fief (as we are asked to believe) was originally assessed up to the hilt
for military service, that assessment must, in the interval, have been
reduced. In other words, Henry I—if, as Dr Stubbs in one place
suggests,39 he was the first to take a 'regular account of the knights'
fees'—must have found the land with a settled liability of providing
one knight for every five hides, and must, yet, have reduced that
liability of his own accord, on the most sweeping scale, thus, contrary
to all his principles, ultroneously deprived himself of the 'service' he
was entitled to claim.

Having completed my criticisms of the accepted view, and set forth its
chief difficulties, I shall now propound the theory to which my own
researches have led me, following the same method of proof as that
adopted by Mr Seebohm in his English Village Community, namely
working back from the known to the relatively unknown, till the light
thrown upwards by the records of the twelfth century illumines the
language of Domesday and renders the allusions of monks and
chroniclers pregnant with meaning.

1. THE 'CARTAE' OF 1166

In the formal returns (cartae) made to the exchequer in 1166 by the


tenants-in-chief (barones) of England, of which the official transcripts
are preserved in the Liber Niger and the Liber Rubeus, we have our
earliest glimpse of the organization of that purely feudal host among
whom our lands had been parcelled out to be held, as I shall show, by
military service. We have, therefore, in them our best starting-point
for an inquiry into the origin and growth of military tenure in England.

It may be well perhaps, at the very outset, to contrast these cartae of


1166 with those of the Domesday Inquest eighty years before.40 For
the essentially feudal character of the former is at once, by the
comparison, thrown into relief. The original returns of the Domesday
Inquest were made Hundred by Hundred; those of 1166 were made
fief by fief. The former were made by the jurors of the Hundred-court;
the latter by the lord of the fief. Thus, while the one took for its unit
the oldest and most familiar of native organizations, the other,
ignoring not only the Hundred, but even the shire itself, took for its
unit the alien organization of the fief.41 The one inquest strictly
continued, the other wholly repudiated, the Anglo-Saxon system.

It is consequently worse than lost labour to examine these two


inquests, based as they are on opposite systems, and giving us as
they do a cross-division as if they were but successive editions of the
national register or rate-book.
The first point to be considered is this: What was the information
which the tenants-in-chief were called upon to supply in these
returns? It was not, as Dr Stubbs and others have supposed, the
amount of 'service' due from each fief to the crown.42 The information
asked for was the number of 'milites' actually enfeoffed by each
'baron' and his predecessors in title, with the number of 'servitia' due
from each such 'miles' to the 'baron'. In this distinction, missed by Dr
Stubbs, we find the key to the problem. The crown, we shall see,
must previously have known the total amount of 'service' due from
each fief; but what it did not know, and what it wished to know, was
the number of knights' fees which, up to 1166, had been created on
each fief.

Although there is great diversity in the form of return adopted—a


diversity which imparts to the cartae a pleasant flavour of character—
it may fairly be assumed that, as in similar cases, they were called for
throughout the realm by one uniform writ. If we may deduce the
purport of that writ from the collation of those returns which refer to
it most explicitly, we must infer that the information asked for was to
be given under four heads:

(1) How many knights had been enfeoffed before the


death of Henry I?

(2) How many have been enfeoffed since?

(3) How many (if any) remain to be enfeoffed to


complete the 'service' due from the fief. Or, in other
words, what is the balance of your 'service' remaining
chargeable to your 'demesne'?

(4) What are the names of your knights?

In support of these statements I append the whole of the relevant


returns.
Archbishop of Bishop of
Bishop of Exeter
York Durham
Praecepistis Praecipit Praecepit
mihi quod dignitas vestra nobis,
mandarem omnibus domine,
vobis per fidelibus vestra
breve meum vestris clericis sublimitas,
sigillatum et et laicis, qui quod literis
apertum, de vobis nostris
non quot tenent de sigillatis,
servitia capite in extra sigillum
militum vobis Eboracsira, ut pendentibus,
debeam, sed mandent vobis vobis
(1) quot per literas mandaremus
habeam suas, extra (1) quot
milites sigillum milites
feffatos de pendentes (1) feffatos
tempore quot milites haberemus
Regis Henrici quisquis de veteri
avi vestri, et habeat de feffamento et
(2) quot post veteri (2) de novo,
mortem feffamento de scilicet, anno
ipsius, et (3) tempore Regis et die quo
quot sint Henrici avi Rex Henricus
super vestri, scilicet fuit vivus et
dominium de die et anno mortuus et
meum.43 quo ipse fuit de [sic] post
vivus et mortem ejus
mortuus, et ... (3) super
(2) quot dominium
habeat de vero
novo nostrum, de
feodamento quo similiter
feffatos post mandare
mortem bonae præcepistis,
memoriae avi etc. (pp. 416,
vestri 418).]
ejusdem, et
(3) quot feoda
militum sint
super
dominium
uniuscujusque,
et (4) omnium
illorum
nomina, tam
de novo
feffamento
quam de
veteri
feffatorum
quae sint in
illo brevi
scripta, quia
vultis quod si
aliqui ibi sunt
qui vobis
nondum
fecerunt
ligantiam, et
quorum
nomina non
sunt scripta in
rotulo vestro,
quod infra
dominicam
primam xlae
ligantiam
vobis faciant
(p. 412).
Herbert De Engelard De Robert De
Castello Strattone Brintone
Michi et Michi et Michi et aliis
comparibus ceteris comparibus
meis comparibus meis per
mandastis ut meis qui de litteras
vobis per vobis vestras
breve nostrum tenemus in innotuistis ut
pendens extra capite per per fidem et
sigillum, litteras ligantiam
mandaremus vestras quam vobis
(1) quot mandastis ut debemus per
milites vobis per breve
antiquitus breve nostrum
feodatos de nostrum pendens
tempore Regis pendens extra sigillum
Henrici avi extra sigillum mandaremus
vestri mandaremus (1) quot
habeamus et (1) quot milites
(2) quot de milites haberemus
novo habeamus de de veteri
feodamento.... veteri feodamento
Et hii omnes feodamento de tempore
ligantiam et de tempore Henrici Regis
homagium Henrici Regis avi vestri, et
vobis fecerunt avi vestri, et (2) quot
(pp. 275-6). (2) quot milites
habeamus de haberemus
novo de novo
feodamento feodamento
(p. 276). post tempus
Regis Henrici
avi vestri, et
(3) quot
milites
habeamus
super
dominium
nostrum....
Et vobis
quidem et
filio vestro
ligantiam et
homagium
fecerunt (p.
277).44

Let me here break off for a moment to consider one of the most
important points suggested by this great inquest, namely, the issue of
the writs under which it was held. It has been generally assumed that
each tenant received his writ direct from the crown; and a casual
reading of the cartae might, perhaps, favour such a view. I have,
however, been led to the conclusion that a general writ was issued to
the sheriff of each county, and that its terms were communicated by
him to the several tenants-in-chief, whose capita baroniæ lay within
his jurisdiction.

Baderun of Monmouth has heard the writ read out in the county
court;45 Earl Patrick also has heard the writ read out.46 William fitz
Siward derives from the sheriff, he tells us, his knowledge of the
writ:47 even the bishop of Chester has received his instructions from
the sheriff.48 But more especially do I rely upon the return of the
Archbishop of York because he recites the tenor of the writ in terms
which can leave no doubt that it was addressed, through the sheriff,
to the whole shire collectively.49 If the Archbishop of York did not
receive a special writ, we may fairly infer that no other tenant can
have done so.

Further, I believe that as the 'barons' received their instructions from


the sheriffs, so they also sent in their returns through those officers.
The memorandum, for instance, on the missing carta of Osbert fitz
Hugh informs us that it was brought to the exchequer by William de
Beauchamp. Now, William de Beauchamp was sheriff of the shire. This
would account for the grouping of the returns 'per singulos comitatus',
as Swereford expresses it, and indeed this arrangement would but
follow the existing practice of collecting the scutage shire by shire.

Returning now to the terms of the inquiry, it is obvious that the tenant
(baro) to whom such queries were addressed must of necessity have
belonged to one of these three classes—

(a) Those who had created the exact number of knights'


fees sufficient to discharge their 'service'.

(b) Those who had created more than sufficient.

(c) Those who had created less than sufficient.

This last class requires some explanation. When the number of


knights' fees created was not sufficient to discharge the baron's
'service', the balance of that service remained charged on the non-
infeudated portion of his fief, that is, on the 'demesne', and was
technically said to be 'super dominium'. It is all-important that this
should be grasped, for it might otherwise be supposed that such a
phrase as 'quot milites super dominium' implied the existence of
actual knights enfeoffed on the demesne, which, to those who realize
the working of the system of knight-service, is an absolute
contradiction in terms. This, it will be found, beautifully explains the
first article of the Assize of Arms (1181)—that every tenant is to keep
in stock harness for as many knights 'quot habuerit feoda militum in
dominio suo'.50 That is to say, that if, after deducting the knights
actually enfeoffed, there remained due from his fief a balance of
knight-service, he must keep in readiness harness sufficient for those
knights whom he would have to provide himself to discharge that
balance.51

Having made this point clear, I now pass to the immediate object of
the inquest of 1166. What that object was, no one has as yet
discovered. Dr Stubbs, for instance, in his preface to the Pipe-Roll of
1166, writes: 'On the immediate purpose for which the inquiry was
made—and it can scarcely be doubted that it was for the collection of
a scutage—we shall look for further information in the rolls of the
succeeding years.' My own researches enable me to assert that this
inquest formed part of a financial revolution hitherto ignored, which
deserves to be compared with those other innovations in
administration and finance that characterized the latter half of the
twelfth century in England.

When we come to place side by side the returns of 1166 and the
payments made upon those returns in 1168, we find (at least, on the
lay fiefs) the same distinction in both between 'the old feoffment' and
'the new'. But while the returns, as we saw, were made under three
heads,52 the payments were made under two, namely, under the two
feoffments. The reason of this difference can be established beyond
dispute: the exchequer clerks had, in every instance, added the
returns under the third head to those under the first, and classed
them together as 'old feoffment'. This is one of the points which, I
think, have never been hitherto explained.

Plenty of examples might be given, but these two will suffice. Walter
de Aincurt returns 24 fees de veteri, 5 de novo, and 11 super
dominium. The exchequer, in 1168, records him as paying on 35 fees
de veteri, and on 5 de novo.53 Richard de Haie returns 11 fees de
veteri, 4 de novo, and 5 super dominium. The exchequer records him
as paying on 16 de veteri, and 4 de novo.

The main point, however, on which I propose to insist, is that these


returns were intended to provide, and, as a matter of fact, did provide
a new feudal assessment, wholly superseding the old one, in no case
to the advantage of the tenant, but in many to the advantage of the
crown. The modus operandi was as follows. Instead of either adhering
to the old assessment (servitium debitum), or uniformly substituting a
new one based on the fees actually created, the crown selected in
every case whichever of these two systems told in its own favour and
against the tenant of the fief. If he had enfeoffed fewer knights than
his servitium debitum required, the crown retained that servitium as
the irreducible minimum of his assessment; but if he had created an
excess of fees, the crown added that excess to his pre-existing
assessment and increased the 'service' due from him pro tanto. This
discovery is no conjecture, but is capable of arithmetical
demonstration.

It should be noticed how skilfully the queries were framed in the


inquest of 1166, to entrap the unwary tenant, and make him commit
himself to the facts. If his enfeoffed knights were short of the required
number, he was caught under the third query; if, on the other hand,
he had an excess, he was caught under the others. Now, did the
'barons', when they made their returns, anticipate this sweeping and
unwelcome reform? Presumably not. They appear to have drawn up
their cartae carefully and willingly, few of those who had an excess of
knights taking even the precaution of mentioning their servitium
debitum.54 The church, moreover, from the terms in which her
payments are thenceforth entered (vide infra), must have uniformly
and systematically adopted an attitude of protest. Yet there is no trace
of such protest in her returns. May we then infer that the crown
sought to deliberately entrap its tenants? Two circumstances might
favour that view. In the first place the tenants had to make their
returns extra sigillum pendentes, thereby solemnly committing
themselves;55 in the second, the tenants would, of course, have been
tempted to conceal or understate their excess of knights, had they
foreseen the use that the crown would make of their returns.

The question may very fairly be asked, 'What check had the crown
upon a tenant in the event of the latter omitting some of his "excess"
fees?' The answer is supplied, I think, by a clause in the invaluable
return of the northern primate. He there requests that his return may
be accepted 'without prejudice', as a lawyer would say, in case of his
omitting some small fees. That is to say, these formal returns might
be brought up as evidence against tenants-in-chief who had omitted
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like