100% found this document useful (1 vote)
27 views67 pages

Programming Google Glass 2nd Edition Build Great Glassware Apps With The Mirror API and GDK Eric Redmond Download PDF

Eric

Uploaded by

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

Programming Google Glass 2nd Edition Build Great Glassware Apps With The Mirror API and GDK Eric Redmond Download PDF

Eric

Uploaded by

burkskuduka8
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/ 67

Visit https://ebookfinal.

com to download the full version and


explore more ebook

Programming Google Glass 2nd edition Build Great


Glassware Apps with the Mirror API and GDK Eric
Redmond

_____ Click the link below to download _____


https://ebookfinal.com/download/programming-google-
glass-2nd-edition-build-great-glassware-apps-with-the-
mirror-api-and-gdk-eric-redmond/

Explore and download more ebook at ebookfinal.com


Here are some recommended products that might interest you.
You can download now and explore!

Programming Google App Engine with Python Build and Run


Scalable Python Apps on Google s Infrastructure 1st
Edition Dan Sanderson
https://ebookfinal.com/download/programming-google-app-engine-with-
python-build-and-run-scalable-python-apps-on-google-s-
infrastructure-1st-edition-dan-sanderson/
ebookfinal.com

Programming Google App Engine Build and Run Scalable Web


Apps on Google s Infrastructure Animal Guide 1st Edition
Dan Sanderson
https://ebookfinal.com/download/programming-google-app-engine-build-
and-run-scalable-web-apps-on-google-s-infrastructure-animal-guide-1st-
edition-dan-sanderson/
ebookfinal.com

Google Glass For Dummies 1st Edition Eric Butow

https://ebookfinal.com/download/google-glass-for-dummies-1st-edition-
eric-butow/

ebookfinal.com

Mining Google Web Services Building Applications with the


Google API 1st Edition John Paul Mueller

https://ebookfinal.com/download/mining-google-web-services-building-
applications-with-the-google-api-1st-edition-john-paul-mueller/

ebookfinal.com
Glass Mechanics and Technology 2nd Edition Eric Le Bourhis

https://ebookfinal.com/download/glass-mechanics-and-technology-2nd-
edition-eric-le-bourhis/

ebookfinal.com

Hire With Your Head Using POWER Hiring to Build Great


Teams 2nd Edition Lou Adler

https://ebookfinal.com/download/hire-with-your-head-using-power-
hiring-to-build-great-teams-2nd-edition-lou-adler-2/

ebookfinal.com

Hire With Your Head Using POWER Hiring to Build Great


Teams 2nd Edition Lou Adler

https://ebookfinal.com/download/hire-with-your-head-using-power-
hiring-to-build-great-teams-2nd-edition-lou-adler/

ebookfinal.com

Programming Entity Framework Building Data Centric Apps


with the ADO NET Entity Framework Second Edition Julia
Lerman
https://ebookfinal.com/download/programming-entity-framework-building-
data-centric-apps-with-the-ado-net-entity-framework-second-edition-
julia-lerman/
ebookfinal.com

Tapworthy Designing Great iPhone Apps 1st Edition Josh


Clark

https://ebookfinal.com/download/tapworthy-designing-great-iphone-
apps-1st-edition-josh-clark/

ebookfinal.com
Programming Google Glass 2nd edition Build Great
Glassware Apps with the Mirror API and GDK Eric
Redmond Digital Instant Download
Author(s): Eric Redmond
ISBN(s): 9781941222188, 1941222188
Edition: 2
File Details: PDF, 9.81 MB
Year: 2015
Language: english
www.it-ebooks.info
Under Construction: The book you’re reading is still under

ß
development. As part of our Beta book program, we’re releasing
this copy well before a normal book would be released. That
way you’re able to get this content a couple of months before
it’s available in finished form, and we’ll get feedback to make
the book even better. The idea is that everyone wins!

Be warned: The book has not had a full technical edit, so it will contain errors.
It has not been copyedited, so it will be full of typos, spelling mistakes, and the
occasional creative piece of grammar. And there’s been no effort spent doing
layout, so you’ll find bad page breaks, over-long code lines, incorrect hyphen-
ation, and all the other ugly things that you wouldn’t expect to see in a finished
book. It also doesn't have an index. We can’t be held liable if you use this book
to try to create a spiffy application and you somehow end up with a strangely
shaped farm implement instead. Despite all this, we think you’ll enjoy it!

Download Updates: Throughout this process you’ll be able to get updated


ebooks from your account at pragprog.com/my_account. When the book is com-
plete, you’ll get the final version (and subsequent updates) from the same ad-
dress.

Send us your feedback: In the meantime, we’d appreciate you sending us your
feedback on this book at pragprog.com/titles/erpgg2/errata, or by using the links
at the bottom of each page.

Thank you for being part of the Pragmatic community!

Andy & Dave

www.it-ebooks.info
Programming Google Glass,
Second Edition
Build Great Glassware Apps with the Mirror API and GDK

Eric Redmond

The Pragmatic Bookshelf


Dallas, Texas • Raleigh, North Carolina

www.it-ebooks.info
Many of the designations used by manufacturers and sellers to distinguish their products
are claimed as trademarks. Where those designations appear in this book, and The Pragmatic
Programmers, LLC was aware of a trademark claim, the designations have been printed in
initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer,
Pragmatic Programming, Pragmatic Bookshelf, PragProg and the linking g device are trade-
marks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes
no responsibility for errors or omissions, or for damages that may result from the use of
information (including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team create
better software and have more fun. For more information, as well as the latest Pragmatic
titles, please visit us at https://pragprog.com.

For international rights, please contact [email protected].

Copyright © 2015 The Pragmatic Programmers, LLC.


All rights reserved.

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


transmitted, in any form, or by any means, electronic, mechanical, photocopying,
recording, or otherwise, without the prior consent of the publisher.

Printed in the United States of America.


ISBN-13: 978-1-941222-18-8
Encoded using the finest acid-free high-entropy binary digits.
Book version: P1.0—February 13, 2015

www.it-ebooks.info
Contents

Changes in the Beta Releases . . . . . . . . vii

Preface . . . . . . . . . . . . . . ix

1. Wrapping Your Head Around Glass . . . . . . . 1


Getting to Know Glass 1
Learning to Navigate 2
Glass Hardware 7
Glass Software 8
Wrap-Up 9

Part I — The Mirror API


2. The Google App Engine PaaS . . . . . . . . 13
Setting Up GAE 14
Making a Web App 16
Deploying to the Web 20
Fancy Templates 22
Wrap-Up 24

3. Authorizing Your Glassware . . . . . . . . . 27


Activating Your Mirror API 28
A Short Primer on OAuth 2.0 30
Applying OAuth to Create Glassware 34
Wrap-Up 40

4. Building the Timeline . . . . . . . . . . 41


Mirror HTTP Requests 41
Timeline Items 45
Multicards: Bundles and Paginating 51
Menus 54

www.it-ebooks.info
Contents • iv

Cron Jobs 56
Wrap-Up 58

5. Tracking Movement and User Responses . . . . . . 59


Geolocation 59
Using Location 62
Subscriptions 66
Accepting Notifications 68
Custom Menu Items 72
Wrap-Up 74

6. Making Glass Social . . . . . . . . . . . 75


Creating Contacts 75
Sharing Assets with Glassware 77
Getting and Setting Attachments 81
Wrap-Up 85

7. Designing for Glass . . . . . . . . . . . 87


A Little UX 87
Design Layout 89
Look and Feel 92
Wireframes and Mock-Ups 94
Wrap-Up 97

8. Turning a Web App to Glassware . . . . . . . . 99


ChittrChattr App 99
Glassifying the Actions 103
The Mirror Code 105
Wrap-Up 109

Part II — Glass Development Kit


9. Introducing the GDK . . . . . . . . . . 113
Choosing the GDK by Use-Case 114
Setup a GDK Dev Environment 116
An Android Primer 120
Wrap-Up 122

10. An Android Introduction on Glass . . . . . . . 125


Generating a Simple Android App 125
Basic Android SDK+GDK 131
The Activity Component 135

www.it-ebooks.info
Contents •v

Service, Broadcast Receiver, and Content Provider 139


Wrap-Up 145

11. Live Cards . . . . . . . . . . . . . 147


Planning a Live Card Project 147
Implementing a Live Card Glassware 152
A Card Menu 156
Launching an App with Voice 159
Updating RemoteViews 162
Wrap-Up 164

12. Advanced Rendering and Navigation . . . . . . 167


High Frequency Rendering 167
Scrolling Through Multiple Cards 176
Gestures and Sound Effects 180
Launching the Balloon Count Scroller from the Menu 183
Taking Photos with the Camera 185
Wrap-Up 188

13. Voice and Video Immersions . . . . . . . . 189


An Immersion App 189
A Speech-to-Text Caption App 192
Sending Data to a Web Service 197
Adding Geolocation 202
A QR Code Reading Camera 205
Wrap-Up 216

14. Creating an Immersive Game . . . . . . . . 219


Start The Game with a Splash Screen 220
Gesture and Sensor Inputs 223
Rendering Visuals and Playing Audio 229
Game Logic 235
Wrap-Up 242

15. Preparing For the Real World . . . . . . . . 245


Testing Glass Apps 245
Debugging and Profiling 251
Command-line Power Tools 255
Monkeyrunner 260
Signing your Glassware 262
Wrap-Up 263

www.it-ebooks.info
Contents • vi

16. Turning an Android App to Glassware . . . . . . 265


Notoriety App 266
Designing a GDK Glassware UI 270
The GDK Code 274
Wrap-Up 282

A1. HTTP and HTML Resources . . . . . . . . 283


Timeline 283
Timeline Attachments 288
Locations 288
Subscriptions 289
Contacts 291
Map Parameters 293
HTML 293

Index . . . . . . . . . . . . . . 295

www.it-ebooks.info
Changes in the Beta Releases
P1.0, Feb 13, 2015
• Replaced all ADT examples in Part Two with Android Studio.

• Due to Google’s recent announcement that the Glass Explorer program


has ended, thus suspending any further purchase of Google Glass, we
are following suit and suspending production of our book, Programming
Google Glass. Thanks to everyone who took the leap of faith with us and
reviewed or purchased the beta.

Beta 3, Dec 15
• Added the final chapter, Chapter 16, Turning an Android App to Glassware,
on page 265.

Beta 2, November 13
• Added Chapter 15, Preparing For the Real World, on page 245.

• Updated with XE changes and added a few minor clarifications

Beta 1, October 21

www.it-ebooks.info report erratum • discuss


Preface
Google Glass is the new wearable computer that everyone is talking about.
Some people love it, some hate it, but folks can’t seem to help but talk about
it. In short, Glass is a head-mounted computer with an optical display, a
camera, several sensors, and a voice or touch interface. You can walk around,
hands-free, check your email, watch or take videos, play games, and most
anything else you can do with a smartphone. Equally important, it’s gaining
traction for enterprise purposes, from fast-food restaurant employee training
to use in surgical settings.

You can program Glassware (Glass applications) in two ways: by using the
HTTP-based Mirror API web-service, or by creating native applications using
the Glass Development Kit (GDK). This book covers how to program both.

You’ll get a glimpse of what Glass is and what it is not, and how users can
interface with Glass. In Part One of this book you’ll learn how to develop a
Glass application fast, by using the Mirror API to manipulate timeline cards
and menus, track a Glass’s geolocation, create rich interactions by responding
to user inputs, and capture or serve user images and videos. In Part Two
you’ll learn how to shape user experience with the GDK by interacting with
Glass hardware, from voice-to-text inputs, to QR code reading with the live
camera, to building your own video game with fine-grained sensor inputs.
You’ll see how to properly design new Glassware or update existing applica-
tions to become Glassware. This is the book to read if you want a shortcut to
this brave new world.

What’s the Big Deal with Glass?


Imagine a world where computers did not exist, but the abilities that comput-
ers provided did. Rather than pulling a phone out of your pocket to talk with
someone, you’d simply speak their name and you’d be connected. Or instead
of taking out a laptop to play a video game, you would merely ask to play a
game and it would appear. Or rather than sitting in front of a television screen

www.it-ebooks.info report erratum • discuss


Preface •x

to watch your favorite movies, a panel would hover conveniently in the air
visible only to you, or sharable with friends who wish to watch as well. The
idea of Google Glass is not to add more technology to your daily life, but rather
sit idly in the background, available when you need it. It’s about getting
technology out of your way, while still providing its benefits.

The first future-facing movie that I can recall containing consumer HUD
(heads-up display) goggles was Back to the Future 2. This HUD was worn in
the future year 2015 (I know, right?), not by a military commander or an air-
ship pilot, but by young Marty McFly, Jr., as he sat with his family around
the kitchen table. This was a consumer device capable of, at least, displaying
text and accepting phone calls.

Although Glass is sometimes considered to be an augmented-reality device,


it’s better thought of as an ever-present optical interface for a mobile device.
It’s a self-contained computer, yes, but it is also most useful when paired
with an external paired smartphone for some actions, such as geolocation or
continuous Internet access. Glass is sometimes refered to as having the
power of a smartphone available, without the inconvenience of digging in your
pocket.

Is This Book for You?


This book is designed to help experienced developers quickly start writing
Google Glass applications with the Mirror API. Although this book covers
using the interface with Google’s Java Mirror Client code, the Mirror API itself
is an HTTP interface with support for many languages. This means that many
of the lessons about the Mirror API itself can apply to languages beyond the
simple Java client.

The pertinent code is covered in the book, and the rest can be downloaded
along with the book (or from GitHub.1)

You needn’t be a Java expert to follow Part One of this book, but it can help
to know your way around the syntax and Eclipse editor. You may also get
more out of Part One if you’re familiar with Google App Engine, although you
can use any Platform as a Service (PaaS) or host your own Glassware applica-
tions. Part Two requires a much more in depth knowledge of Java, and there
we’ll be using The Intellij-based Android Studio.

1. https://github.com/coderoshi/glass

www.it-ebooks.info report erratum • discuss


What’s in This Book? • xi

What’s in This Book?


This book is intended to be read sequentially, from the first to last chapter.
It covers most of the Mirror API and the GDK, but it’s not designed to be a
reference book. There are plenty of online documents2 for more detailed refer-
ence material.

Part One
After an introduction to Glass and two styles of programming Glassware in
Chapter 1, Wrapping Your Head Around Glass, on page 1, we will dive into
the Mirror API web service. In Part One we work on slowly building up a
complete Glassware, along the way using most of the components of the
Mirror API. Although I’d recommend you read both the Mirror API and GDK
parts to get a full appreciation of your Glassware options, you are free to skip
straight to Part Two if you have no interest in the Mirror API service.

Chapter 2, The Google App Engine PaaS, on page 13


Here we set up our Mirror API development and deployment environments.
Since the Mirror API must run as a web service, we need a web provider to
host the application. We chose Google App Engine, just to keep it in the Google
family. The Glassware we’re creating is called Lunch Roulette, which randomly
chooses a lunch option for you.

Chapter 3, Authorizing Your Glassware, on page 27


Using the Mirror API also requires that end users of your Glassware authorize
your application to interoperate with their Glass. Here we follow the OAuth
2.0 steps necessary to authorize our application. OAuth can be complex, so
we cover the minimum amount necessary to keep you moving.

Chapter 4, Building the Timeline, on page 41


Finally the wait is over—we dig into the actual Mirror API, starting with the
Glass Timeline. We add and remove timeline items, and add custom menu
options to Lunch Roulette.

Chapter 5, Tracking Movement and User Responses, on page 59


Learn how to subscribe to notifications of Timeline changes, such as when a
user deletes a card, or chooses a custom menu option. We’ll also track user
movement by Geolocation. We’ll leverage notifications to expand Lunch
Roulette to choose a restaraunt currently close to the Glass user.

2. https://developers.google.com/glass/develop/

www.it-ebooks.info report erratum • discuss


Preface • xii

Chapter 6, Making Glass Social, on page 75


Here we finish up Lunch Roulette by adding some social aspects, such as
calling the chosen restaraunt to make reservations, or sharing images with
your Contacts, and the Lunch Roulette application. We also look into
attaching assets, such as an image, to a user’s timeline.

Chapter 7, Designing for Glass, on page 87


One of the most important aspects of learning Glass is how it changes the
world of application design. With its smaller screen, lack of a touchscreen or
keyboard, and alternative input options, you have to approach UX design
differently.

Chapter 8, Turning a Web App to Glassware, on page 99


If you have an existing web application, this chapter is a useful exercise. We
take an existing blog application, and build Glassware from it. This way we
leverage existing code, but also allow users the option of interfacing with our
blog using a web browser or Glass.

Part Two
The chapters in Part Two are designed to build up from simple to more complex
examples. Unlike Part One, however, the examples in each chapter are self
contained. You should follow these chapters in order, rather than jump
around, since previous sections are sometimes refered to later.

Chapter 9, Introducing the GDK, on page 113


This chapter kicks off Part Two by outlining what the GDK is, and how it
differs from the Mirror API. It also goes through the steps of setting up a GDK
development environment, and how to sideload your own apps onto Glass.

Chapter 10, An Android Introduction on Glass, on page 125


You have to crawl before you can walk, so we’ll start by crawling through the
basics of Android development. Details about Android can, and does, fill
several books on its own. So instead of a full treatment, we’ll do a flyover of
the parts you’ll need to jump into GDK programming. We’ll cover Android
development basics, project layouts, and Android programming model objects
like Intents, Views and Components.

Chapter 11, Live Cards, on page 147


The first GDK UI elements we’ll introduce are Live cards. Live cards are
interactive cards that are rendered in realtime, as opposed to the static variety

www.it-ebooks.info report erratum • discuss


What’s in This Book? • xiii

rendered by the Mirror API. We’ll create and launch a live card application to
gradually display statistics about the inner workings of Glass, including a
simple menu to close it.

Chapter 12, Advanced Rendering and Navigation, on page 167


There are many ways to render live cards, but for applications that need video
quality we must interact directly with the Glass rendering surface. We’ll take
advantage of this more complex method of rendering high frequency live cards
to write a party application that animates balloons over an image. We’ll create
a more complex interface with multiple scrollable cards, and take photos with
the Glass camera.

Chapter 13, Voice and Video Immersions, on page 189


Next we cover the other GDK UI element option called immersions. Immersions
provide the full power of an Android application by running outside the con-
straints of the Timeline experience. We’ll learn about immersions by creating
a text-to-speech application with geolocation capabilities. We’ll also create a
QR code reading application that captures and renders video realtime from
the Glass camera.

Chapter 14, Creating an Immersive Game, on page 219


We’ll finish up our GDK tour by writing a side-scrolling video game for Glass.
The game will use the built-in gravity sensor and gesture bar to control a
player, while playing background music and sound effects.

Chapter 15, Preparing For the Real World, on page 245


Once we have the GDK under our belts, we’ll look into the hardware of Google
Glass. Then we’ll cover some details about the Android operating system, and
how to hack it, debug and optimize your applications. We’ll optimize one of
our previous examples to make it run nice and smoothly.

Chapter 16, Turning an Android App to Glassware, on page 265


Finally, we’ll take an existing Android application and convert it into a Google
Glass app. This follows a similar pattern to Chapter 8, Turning a Web App to
Glassware, on page 99, where an existing application was introduced, the
necessary user stories were extracted, and we redesigned the app to work for
Glass. And like the Mirror API example, much of the app code will be reusable,
allowing us to leverage existing investments.

www.it-ebooks.info report erratum • discuss


Preface • xiv

Online Resources
You can download the code and other resources used in this book from the
Pragmatic Bookshelf website or my GitHub repository.3 4 You are free to use
this source code for anything you wish.

You’ll also find the community forum and the errata-submission form on the
Pragmatic site, where you can report problems with the text or make sugges-
tions for future versions.

The official Google Mirror API is also an excellent resource for the most up-
to-date changes in the API, as well as other viewpoints on creating Glassware.5

Getting Going
Wearable computers, like Google Glass, are a growing topic, getting larger by
the day. We could have easily created a book twice this length on Glass con-
cepts, the Mirror API, good design, musings on the future, and so on. It was
a conscious decision to keep this book slim so you can get a quick head start
on this future.

We’re beginning an exciting new journey in software development and design.


Let’s take our first steps into it.

Eric Redmond
Feb 2015

3. pragprog.com/book/erpgg/programming-google-glass
4. https://github.com/coderoshi/glassmirror
5. http://developers.google.com/glass/

www.it-ebooks.info report erratum • discuss


CHAPTER 1

Wrapping Your Head Around Glass


The importance of Glass cannot be overstated. It is a huge leap forward in
human-machine interface, and one step closer to a ubiquitous access of the
world’s information. Google cofounder Sergey Brin stated that the vision
behind Glass was to improve information access from its current form: staring
down at a mobile phone all day.

Glass is a head-mounted form factor for consuming or sharing information.1


Glass isn’t the first or, frankly, even the best wearable computer with an
optical display. However, it does mark the first time a company the size and
stature of Google has thrown its formidable resources at crafting a consumer-
oriented wearable computer. This project is currently the best chance for wide
adoption of head-mounted computers by regular people.

And as you can see in the figure, wearing Glass looks cool.

Getting to Know Glass


Glass’s defining characteristic is its optical display that hovers above your
right eye. As I’ve worn Glass quite a bit in my day-to-day life, I’ve come to

1. http://en.wikipedia.org/wiki/Computer_form_factor

www.it-ebooks.info report erratum • discuss


Chapter 1. Wrapping Your Head Around Glass •2

learn that in its current form, It is wonderful for effortlessly acquiring and
sending out information.

You’ll know within a second or two if you want to open an email. You can
send a photo or video without digging for your phone. You’ll be quicker to
respond to text messages since they pop up in your field of vision and can
accept verbal replies. You can ask Google a question and get a reasonable
answer. I recently asked Glass, “What’s the capital of Belize?” while standing
at a Belize-themed food cart (it’s Belmopan).

On the other hand, many people believe Glass is some sort of virtual-reality
device. In fact, most of the time the display is turned off. You’ll get an audible
notification of when you receive new items, but you won’t walk around with
the screen on, because it’s both a distraction and a battery drain. Although
a future generation of Glass will undoubtedly trend toward reality-augmenting
capabilities, it’s not very good for that sort of thing right now.

Learning to Navigate
All actions in Glass are done by voice command, head motion, or touch pad.
When you start up Glass, you’ll see a screen with the time. A handful of Google
engineers call this the clock screen, but I’ve come to refer to it as the home
card (who can say if it will always contain a clock?), and will for the rest of
this book. A card is a single screen visible on the display, as the following
figure shows.

The big plastic piece of Glass is where all of the electronics are housed, as
you can see in Figure 1,An overhead view of Glass, on page 3. The back
portion is the battery pack and the middle part in front of your ear is where
the computer resides. The outermost casing is a touch interface called the
swipe bar.

www.it-ebooks.info report erratum • discuss


Learning to Navigate •3

Figure 1—An overhead view of Glass

If you tap the swipe bar on the side of your Glass while it’s in power-save
mode (the screen is off), you’ll start at the home card. From here, saying the
voice trigger “OK, Glass” out loud will open up a menu of commands, as
shown in the following figure.

www.it-ebooks.info report erratum • discuss


Chapter 1. Wrapping Your Head Around Glass •4

The list scrolls off the page, which leads us to the head gesture. Vertical
scrolling in Glass is almost always performed by tilting your head up and
down. As you look down, the list will scroll up as though you were holding
up a dinner menu and perusing down it.

Saying any of the commands out loud will begin that action. The ellipses (...)
at the end of the command represent the remainder of the request. Valid
input is fairly intuitive.

If you need directions to Las Vegas, say “OK, Glass, get directions to Las
Vegas.” In that case, “OK, Glass” is the trigger, “get directions to” is the
command, and “Las Vegas” is the input.

If you have a contact named “Mom” in your list, you can be a good kid and,
assuming you’re paired to your mobile phone, start a phone call with “OK,
Glass, make a call to Mom.”

Voice commands and head-bobbling are only part of using Glass. The other
component is swipe-bar gestures. When you’re ready to close an active card,
you hold a single finger to the side and swipe down, as you see here.

To exit a process, such as ending a phone call, you can touch two fingers to
the swipe bar and swipe down. This is the close gesture, which goes straight
back to the home card and power-save mode. Most times you’ll use the single
swipe action, but when in doubt, try two fingers.

If you tap the side of your Glass again from the home card, you’ll see a menu
of options, not entirely unlike the voice-command menu. The difference here
is that you can bring up your menu choices without speaking, which is useful
in company meetings and movie theaters.

Timeline
From the home card, you can swipe forward, which will move your display
through your timeline, as you can see in the following image. The timeline is
a chronological listing of cards, each displaying a single cell of information.
That information is usually simple, be it an email, a past phone call or SMS
conversation, a Google search, or some information populated by a Glass
application, called Glassware.

www.it-ebooks.info report erratum • discuss


Learning to Navigate •5

For example, you can sign up for the Twitter Glassware that keeps you up-
to-date on new tweets. You can use the Android Glass app, which you see
here, but you can also visit http://google.com/myglass for the same options.

Now anytime someone sends you a tweet, it creates a new card in your time-
line, stamped with the time of creation.

If you tap the swipe bar while viewing the card, aka “tap the card,” you’ll see
a menu of options. These can be defined or customized with Glassware. If you
want to delete a tweet from the timeline, you swipe through to the end of the
menu list to the Delete action, and tap to choose it.

www.it-ebooks.info report erratum • discuss


Chapter 1. Wrapping Your Head Around Glass •6

The action will pause for two seconds to give you a chance to abort. If you’re
really intent on letting it delete, it will signal success and be removed from
the timeline. On the other hand, if you wish to abort or leave the menu
entirely, swiping down vertically with one finger is the cancel or back com-
mand. Single-finger swipes along the swipe bar or down are the most common
gestures you’ll make.

If you start at the home card again and swipe the other direction, you’ll see
a set of non-timeline cards. There are relatively few cards on this side of the
home card, since they’re meant to be shortcuts. These are known as pinned
cards, often populated by the Google Now application and containing informa-
tion like the local weather or airline flight information. We’ll cover pinning
cards in Chapter 4, Building the Timeline, on page 41.

At the end of all pinned cards, you can see the settings card.

This is the center of all Glass-based configurations. You can scroll through
settings options like those in the following image.

www.it-ebooks.info report erratum • discuss


Glass Hardware •7

Tapping on this allows you to join a Wi-Fi network and specify on-head
detection, debug mode, and other system settings.

There is plenty more to know about using Glass. If you need help, search the
wealth of information online or contact the Glass support team.

Glass Hardware
These hardware specs are good to be familiar with, especially if you had any
currently unattainable dreams of rendering highly detailed scenes on Glass
in real time or running 24 hours uninterrupted. The hardware just isn’t
powerful enough for that yet. The design is rather basic, as you saw in Figure
1,An overhead view of Glass, on page 3.
Glass currently does not use cutting-edge technologies, but rather combines
standard technologies in a cutting-edge manner. The following hardware details
were gathered from a Sparkfun-sponsored teardown,2 the blog post "Sensors on
Google Glass,"3 the GDK documentation,4 and Glass tech specs.5 Obviously any
of these specs can and likely will change with later versions, but I’ve listed them
here to give you an idea of what is packed into Glass’s small form factor.

• Touchpad: Synaptics T1320A


• Processor: Texas Instruments OMAP4430 1.2Ghz dual-core ARMv7
• RAM: Elpida mobile DRAM 1GB
• Storage: 16 GB of SanDisk flash (12 GB usable)
• Battery: Lithium polymer 570 mAh
• Wi-Fi: 802.11b/g
• Bluetooth 4.0
• GPS: SiRFstarIV GSD4e
• Gyroscope, accelerometer, compass (each three-axis): MPU-9150 nine-
axis MEMS MotionTracking
• Proximity sensor: LiteON LTR-506ALS
• Microphone: Wolfson WM7231 MEMS
• Audio: Bone-conduction transducer; Micro USB earphone attachment
• Camera: 5 megapixel photos, 720p videos
• Display: 640×360 LCOS array projected on a prism

One of the most interesting pieces on the list is the display. It requires very
high-definition LCOS (liquid crystal on silicon) projecting an image onto a

2. http://www.catwig.com/google-glass-teardown/
3. http://thecodeartist.blogspot.com/2013/05/sensors-on-google-glass.html
4. https://developers.google.com/glass/develop/gdk/
5. https://support.google.com/glass/answer/3064128?hl=en&ref_topic=3063354

www.it-ebooks.info report erratum • discuss


Chapter 1. Wrapping Your Head Around Glass •8

prism, which reflects an image onto the retina. Despite the prism’s sitting
about an inch from your eye, you see the equivalent of a 25-inch high-defini-
tion screen quite clearly from eight feet away.

The bone-conduction transducer (BCT) is also a nice touch, since it relieves


the necessity for an earpiece for simple audio. Since the BCT conducts sounds
into the ear by vibrating bones in the skull, it also frees up the ear to still
hear ambient sounds, following one of Glass’s design goals: to be nonintrusive.
The downside of the BCT is that it can be hard to hear in noisy environments.
For listening to audio long-term, a mono earbud USB attachment can be
purchased.

Glass runs a custom version of Android. As of press time, that’s Android


version 4.4.2 (API level 19), which is relevant for writing Glassware.

You would be well served to understand Glass’s hardware limitations. But


this book is about what you can do with Glass, so let’s move on to the much
more interesting software side.

Glass Software
As with the shift from desktop to mobile-phone development, Glass presents
new challenges for programmers. Its limited touch interface means that you
have to consider other inputs, such as voice and head movements, to interact
with Glassware. Its small 640×360 display presents viewport problems even
greater than the average smartphone’s. In this book you’ll learn not only the
technical details of writing Glassware with the Mirror API, but also the prac-
tical tradeoffs you’ll have to consider.

For example, the built-in web browser effectively projects a portion of a website
in front of you, and you move your head to pan around the page. It’s as though
you’re looking at a large poster fixed in space, but you can view only a piece
at a time. This is one way the Glass engineers used the head-bobble interface
to solve the problem of a small display.

As mentioned previously, there are currently two ways to write Glassware: a


Google-managed web service called the Mirror API, and a user-installed
Android app option called the Glass Development Kit (GDK). This book covers
the Mirror API.

Mirror API
The Mirror API is focused primarily on manipulating and reacting to changes
to the Glass timeline. Your software communicates to the Mirror API, which
Google in turn uses to populate your users’ timelines in some way. All

www.it-ebooks.info report erratum • discuss


Wrap-Up •9

Glassware users have authorized your Glassware to manipulate their timelines


by approving the software and access scope using Google’s OAuth 2.0 flow.
Any discussion of the Mirror API must begin with an overview of writing
software (see Chapter 2, The Google App Engine PaaS, on page 13) and
authorizing a user (covered in Chapter 3, Authorizing Your Glassware, on
page 27).

Glass Development Kit


The GDK is focused on expanding Glass’s functionality beyond the constraints
of the Mirror API and the preinstalled interfaces. We can share pictures using
the Mirror API, but manipulating those photos on the Glass device requires
the GDK. Nearly any application we could write for a very small mobile phone
in Android we can write on Glass with the GDK.

The GDK’s purpose is threefold: First, to interface with the user or with devices
not provided by Glass Android or the Mirror API (for example, a notepad app
that pairs with a Bluetooth keyboard). Second, to allow natively installed
software that can run absent of an Internet connection (Mirror API timeline
manipulations require a Wi-Fi connection). Third, to create applications outside
the confines of the timeline (for example, a service that takes a picture when
the user blinks).

The reasons someone chooses the Mirror API over a GDK app are similar to
why a mobile-phone developer would choose a mobile-optimized web app over
a native app.

Wrap-Up
Navigating Glass is easy, but it does present new challenges for developers.
Its new form factor reduces the amount of information you can display on a
screen, and limits interaction to certain voice commands and touch gestures
(swipe forward, backward, up, or down). Bobble-head gestures present a new
dimension for interactivity, but will also require great care for programmers
and designers to use correctly—as with any new style of interface.

Our next couple of chapters are focused on setting up an environment where


we can launch our Glassware and authorize users to use a Mirror API–based
application. But more important than the technical details at this point is
getting excited to embark on a new age in the computer-human interface!

www.it-ebooks.info report erratum • discuss


Part I

The Mirror API

www.it-ebooks.info
CHAPTER 2

The Google App Engine PaaS


The modern world runs on the Web. Banks, shopping, social networks, and
more all run as web applications. These apps generally have two audiences:
end users (customers) and other applications (third-party apps). Web apps
that interact with users are generally called websites, whereas those that
interact with other applications are called web services. The Mirror API is one
of the latter, and we’ll write an application to interact with it.

Since Glassware applications using the Mirror API require a web application
to generate content, we have to begin with the steps necessary to create a
web application. Unlike applications that are installed natively—the kind you
might download on iOS or Android—Mirror API apps are installed and operate
exclusively on a remote server.

But we get to take a shortcut. Rather than installing and configuring your
own server, we’ll take advantage of Google’s Platform as a Service (PaaS) called
Google App Engine (GAE). Using GAE, we can host our own Mirror API–based
Glassware for free, up to five million page views a month. Look at Figure
2,The actors in creating Glassware using the Mirror API, on page 14. At the
bottom is your application, which GAE will host.

You can interact with any approved user’s Glass device through JavaScript
Object Notation-encoded HTTP requests to the Mirror API. Google’s servers
handle the details of communicating directly with your user’s Glass data on
your behalf. But before you can start firing off requests that make your
Glassware tick, you’ll need two things: someplace to run your Glassware
code—we’ll be publishing code to Google App Engine—and authorization for
your application to read from or write to a user’s Glass data.

In this chapter we’ll tackle the first of those items by setting up and publishing
a GAE-hosted Java web application that we’ll use throughout the book. This

www.it-ebooks.info report erratum • discuss


Chapter 2. The Google App Engine PaaS • 14

Figure 2—The actors in creating Glassware using the Mirror API

is the skeleton of our Glassware. Our project is called Lunch Roulette, which
will suggest a random lunch idea to any of our Glass users. It’ll start rather
basic, but as we move on it will become increasingly sophisticated, complete
with geolocation, restaurant suggestions, and fancy designs and images, and
will even allow users to call the restaurant (perhaps to make a reservation).

But first we should set up a development environment.

Platform as a Service
Google App Engine is Google’s PaaS. The idea behind all PaaS providers is to allow
developers to deploy web-app code to the provider’s infrastructure. PaaS handles
many of the operation details, like installation, deployment, and adding servers, so
you can focus on writing code. Although you could use other PaaS providers, such
as Heroku, we’ll stick with a full Google stack in this book.

Setting Up GAE
Before we dive into our Glassware, we’ll need to set up a Google App Engine
application. Happily, any Google account, such as Gmail, can be used to
create one.

www.it-ebooks.info report erratum • discuss


Setting Up GAE • 15

1. Visit https://appengine.google.com and click Create Application. If this is your


first application, you’ll have to verify your account.

2. Enter a unique Application Identifier (app ID), that will be your subdomain
at GAE’s ‘appspot.com‘ domain—for example, ‘glassbooktest‘.

3. We’ll be building an application called Lunch Roulette, so enter that in


the Application Title field, as you see in the following figure.

4. Select Open to All Google Accounts Users under Authentication Options.


This will allow any Glass user to try out your application.

5. Select High Replication under Storage Options. This is the default and
future-proof storage engine, since Master/Slave is being deprecated in
GAE.

6. Click Create Application.

Figure 3—Creating an application

With everything set up, you can visit your web app. Its URL is your app ID
prepended as a subdomain of appspot.com. Since the example ID in this book
will be glassbooktest, you would visit https://glassbooktest.appspot.com.

The page will output Error: Server Error. This is expected since the app location
exists but nothing has been deployed.

Android Developer Tools


Throughout Part One of this book we’ll be using the Eclipse integrated
development environment (IDE). Eclipse is very stable and popular, and Google
provides several plug-ins that simplify GAE development and deployment.
This code can weigh in at some heavy megabytes (around 200 MB), plus there

www.it-ebooks.info report erratum • discuss


Chapter 2. The Google App Engine PaaS • 16

are some plug-ins. It can also be a bit of a memory hog, so don’t go installing
this on your Raspberry Pi. No matter the power of your system, these steps
can take a while to download and install.

First, ensure you have the Java 7.0 Java Development Kit (JDK) installed on
your machine. Any JDK type (OpenJDK, Oracle, and so on) should work,
though I tend to stick with the Oracle release. Next, install Eclipse for your
operating system.1 All examples in Part One are based on Eclipse version 4.2
(Juno).

The first time you launch Eclipse it will have to create a workspace. This is
just a directory that will house all projects created from the IDE, and some
other working files.

Once Eclipse is finished launching, we need to install the GAE plug-ins. Select
Help in the top menu bar, then Install New Software. A window will pop up
to add available software; it should look something like Figure 4,Adding the
GAE plug-ins to Eclipse, on page 17.

We need to enter a Work With URL that tells the IDE where to find the plug-
ins: http://dl.google.com/eclipse/plugin/4.2. If that does not work, visit the Google
Plugin for Eclipse (https://developers.google.com/eclipse/) website to find installation
instructions, which will provide a correct URL.

Several plug-in options will populate. You’ll need only the following:

• Google App Engine Tools


• Google Plugin for Eclipse
• SDKs -> Google App Engine Java SDK

Click Next, then wait a bit while your tools download and install. You may
have to agree to some licenses and restart Eclipse after install.

With your tools installation complete, you should find a little Google logo in
the lower corner of your IDE’s workspace. Click it. A window will pop open
requiring you to log in using the same Google account you used to create
your GAE application. If you have multiple Google accounts, ensure you use
the correct one.

Making a Web App


Now let’s have some fun by making a simple GAE web application, building
on the skeleton of our previously mentioned project, Lunch Roulette. Lunch
Roulette will eventually become a web service that populates a user’s Glass

1. http://developer.android.com/sdk/index.html

www.it-ebooks.info report erratum • discuss


Making a Web App • 17

Figure 4—Adding the GAE plug-ins to Eclipse

timeline with lunch suggestions. But in this first pass we’ll create a simple
web app that outputs a random lunch suggestion every time we refresh the
web page.

Creating a Java Web App


To create the Java web app that is the skeleton of Lunch Roulette, click on
the Google icon in the top bar, and select New Web Application Project, like
you see in Figure 5,New Web Application drop-down option, on page 18.

It will launch a web-app project wizard, where you can enter a project name
and package. Enter LunchRoulette and test.book.glass, respectively. Uncheck
Use Google Web Toolkit (we won’t use it anywhere in this book), and ensure
Use Google App Engine is checked. Also check Generate Project Sample Code,
since this will be the basis of our Lunch Roulette project. Click Finish after

www.it-ebooks.info report erratum • discuss


Chapter 2. The Google App Engine PaaS • 18

Figure 5—New Web Application drop-down option

your setup looks like the one in Figure 6,Your setup should look like this, on
page 19.

You should now have a project in your Eclipse sidebar called LunchRoulette
that contains some generated Java web-app files. The files worth looking at
are LunchRouletteServlet.java and war/WEB-INF/web.xml. The LunchRouletteServlet.java file
will contain the code we’re going to write and the web.xml file contains the
metadata for the web app—specifically, it defines which URL gets routed to
which servlet.

We’ll modify the generated Java servlet to accept HTTP GET requests at
/lunchroulette and reply with a random lunch suggestion, such as Italian, Chi-
nese, American, or whatever you add to the list. To output a random sugges-
tion, replace the generated LunchRouletteServlet class with the following code.
public class LunchRouletteServlet extends HttpServlet
{
/** Accept an HTTP GET request, and write a random lunch type. */
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException, ServletException
{
resp.setContentType("text/plain");

String lunch = LunchRoulette.getRandomCuisine();


resp.getWriter().println(lunch);
}
}

Finally, create a new class called LunchRoulette and define a new getRandomCuisine()
method.

www.it-ebooks.info report erratum • discuss


Making a Web App • 19

Figure 6—Your setup should look like this.

www.it-ebooks.info report erratum • discuss


Chapter 2. The Google App Engine PaaS • 20

chapter-02/LunchRoulette/src/test/book/glass/LunchRoulette.java
public static String getRandomCuisine()
{
String[] lunchOptions = {
"American", "Chinese", "French", "Italian", "Japenese", "Thai"
};
int choice = new Random().nextInt(lunchOptions.length);
return lunchOptions[choice];
}

This file will contain most of the custom code we’ll create as we build our
Lunch Roulette app throughout the book.

Our final step is to deploy the app to the GAE servers.

Deploying to the Web


You can either right-click the project and find Google in the menu, or select
the project and click the Google icon in the top bar. Either way, choose Deploy
to App Engine. You’ll get a wizard that complains, “LunchRoulette does not
have an application ID.” Click the App Engine Project Settings link at the
bottom to correct this.

www.it-ebooks.info report erratum • discuss


Deploying to the Web • 21

In this pop-up (so many pop-ups!) enter your GAE application ID and click
OK.

You should be back at the deployment wizard, so now you can click Deploy.
You’ll see a lot of text running through your console as it tries to deploy. If
all goes according to plan, you’ll see the log message “Deployment completed
successfully.”
------------ Deploying frontend ------------

Preparing to deploy:
Created staging directory at: '/var/folders/lz/s8dy1m9x0r9g2z7zt4ktpsgr0000gn
/T/appcfg6810984979425725784.tmp'
Scanning for jsp files.
Scanning files on local disk.
Initiating update.
Cloning 2 static files.
Cloning 22 application files.

www.it-ebooks.info report erratum • discuss


Chapter 2. The Google App Engine PaaS • 22

Deploying:
Uploading 5 files.
... snip ...
Deploying new version.
Closing update: new version is ready to start serving.
Uploading index definitions.

Deployment completed successfully

If anything goes wrong, the log will give a hint as to the problem. If your
deployment fails, ensure you’re logged in and that you’ve entered the correct
application ID. Many other problems could arise here. The Glass Developers
community and Stack Overflow are excellent places to find help.2,3

To verify everything is deployed, visit your GAE root URL (mine was
‘https://glassbooktest.appspot.com/‘). You’ll be greeted by an index page
(generated for you by the GAE plug-in) with a link to your ‘LunchRoulette‘
servlet, like in the following figure.

Figure 7—The index page with a link to your servlet

Click on the link to harvest the fruits of all of your hard work: a random lunch
type—you should feel proud! Refresh to get a new lunch option.

Fancy Templates
So far our servlet has only sent plain text to the browser. Rather than writing
HTML inline or using Java Server Pages—the common alternative to servlets
in Java—we’ll introduce a simple templating library called FreeMarker.4

2. https://developers.google.com/glass/community
3. http://stackoverflow.com/questions/tagged/google-mirror-api)
4. http://freemarker.sourceforge.net/

www.it-ebooks.info report erratum • discuss


Fancy Templates • 23

Download the GAE-compatible binary FreeMarker .jar, and drag it into your
project’s war/WEB-INF/lib directory. If the JAR doesn’t show up as one of the
Referenced Libraries, click the project’s properties, select Java Build Path,
and under Libraries choose Add JARs… then drill down to war/WEB-INF/lib,
choosing the JAR.

We need to add a method to the LunchRouletteServlet that renders a template file


with some given data, and write the result to the response stream. This
function assumes the FreeMarker template generator can find template files
under WEB-INF/views.
chapter-02/LunchRoulette/src/test/book/glass/LunchRoulette.java
public static String render(ServletContext ctx, String template,
Map<String, Object> data)
throws IOException, ServletException
{
Configuration config = new Configuration();
config.setServletContextForTemplateLoading(ctx, "WEB-INF/views");
config.setDefaultEncoding("UTF-8");
Template ftl = config.getTemplate(template);
try {
// use the data to render the template to the servlet output
StringWriter writer = new StringWriter();
ftl.process(data, writer);
return writer.toString();
}
catch (TemplateException e) {
throw new ServletException("Problem while processing template", e);
}
}

Then change the servlet’s doGet method to populate a random food and render
the template, rather than simply printing out the string. We also need to set
the content type as HTML.
chapter-02/LunchRoulette/src/test/book/glass/LunchRouletteServlet.java
public class LunchRouletteServlet extends HttpServlet
{
/** Accepts an HTTP GET request, and writes a random lunch type. */
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException, ServletException
{
resp.setContentType("text/html; charset=utf-8");

Map<String, Object> data = new HashMap<String, Object>();


data.put("food", LunchRoulette.getRandomCuisine());

String html = LunchRoulette.render(


getServletContext(), "web/cuisine.ftl", data);

www.it-ebooks.info report erratum • discuss


Chapter 2. The Google App Engine PaaS • 24

resp.getWriter().append(html);
}
}

Finally, we need to create the template file under war/WEB-INF/views/web/cuisine.ftl.


This is just regular HTML with an interpolated variable food inside of the ${ ...
} directive.

chapter-02/LunchRoulette/war/WEB-INF/views/web/cuisine.ftl
<!doctype html>
<html>
<head>
<title>Lunch Roulette</title>
<style>
h2{ color:#db1; }
body{ background-color:black; color:white; }
</style>
</head>
<body>
<article>
<h2>Your Lunch</h2>
<strong>${ food }</strong>
</article>
</body>
</html>

With our code in place, now is a good time to test it. You don’t have to deploy
the application to test these changes. Click the run icon in Eclipse (it looks
like a green triangular play icon), or choose Run As -> Web Application. This
runs a small GAE environment locally—basically, a Java web-app server.
Then visit http://localhost:8888/. This is useful in later chapters, since you can
test your Glassware without deploying your application to GAE.

If all works according to plan, you should be redirected to the Google autho-
rization page, requesting access to view account information, your Glass
timeline, and your Glass location.

This may also be a good time to choose Deploy to App Engine.

Wrap-Up
I promise we’re making great strides toward our first Glassware application.
We activated our Google App Engine service, set up the development environ-
ment, generated a web application, and deployed it to GAE. We also made a
small step toward eventually customizing our Glass content with dynamically
rendered HTML.

www.it-ebooks.info report erratum • discuss


Wrap-Up • 25

Soon we’ll populate Glass timelines the world over with delicious lunch sug-
gestions in Chapter 4, Building the Timeline, on page 41. But first, we must
expand our existing web-server code to allow a user to log into the system.
This is the crux of the next chapter.

www.it-ebooks.info report erratum • discuss


CHAPTER 3

Authorizing Your Glassware


In Chapter 2, The Google App Engine PaaS, on page 13, we set up a simple
Google App Engine (GAE)–hosted Glassware shell. But it wasn’t Glassware
because it could never run on Glass. To do so requires authorization.
Authorization is required to both flag an application as real Glassware and
interact with a user on a personal level, such as by inserting cards directly
into a user’s timeline.

Whereas authentication is about verifying who a user is, authorization is


fundamentally about user experience. Formal definitions cite security and
access control, but our purpose for authorization is to uniquely identify the
correct user to customize his experience in some way by accessing and
sometimes managing his data.

In this chapter we’ll leverage our GAE application to hook into the Glassware
application pool, allowing users to authorize our application. This is the last
step necessary to create real Glassware.

Additionally, you’ll learn how to personalize Glassware for users by accessing


their protected data, with the users’ permission, of course. We’ll achieve this
by authorizing a user, then using credentials to make requests.

In any web-based application (which all Mirror API applications are) the first
step of a custom user experience is knowing who the user is. This need not
involve personal information like a name or email address; it need only consist
of some token that a user can share with the web application to identify her-
self.

Security, such as a password or OAuth 2.0, is to ensure that only that user
has access to her own personal information, be it credit-card details or a
collection of family photographs. We’ll use Google’s OAuth 2.0 interface for
the rest of this book. OAuth can be quite complex, and sticking with one

www.it-ebooks.info report erratum • discuss


Chapter 3. Authorizing Your Glassware • 28

implementation for one purpose will let us charge through this necessary but
sometimes mind-melting topic.

Power and Responsibility


With great power comes great responsibility. Users give you access to their data (like
Facebook pictures) or permissions to perform actions (such as posting tweets) so they
can conduct their own pursuits. Users are not interested in helping your company
mine data or more easily sell them products.

Google has policies to help make this agreement more explicit. You can and should
read the details here: https://developers.google.com/glass/policies. In sum, allow users to
manage their own data, take proper security measures, and don’t ever share users’
data.

Activating Your Mirror API


Before your app can begin authenticating users, you must activate its Mirror
API and secure both a client ID and a client secret key. Here’s the rub: until
Glass is available to the general public, you must be a Glass Explorer to
activate this API.

Like all API activations, you access this through Google’s APIs Console. If you
notice a message at the top of the screen that says something like “Try the
New Cloud Console”, click that. These steps won’t work for the old API console.

Also please note that Google is still in the midst of creating the new Developer
Console, and some of these steps are liable to change after publication.

Steps for activating are as follows:

1. Visit Google’s new Developer Console.1

2. Select APIs & Auth, then toggle the Google Mirror API to ON.

Figure 8—APIs and auth screen

1. https://console.developers.google.com/

www.it-ebooks.info report erratum • discuss


Exploring the Variety of Random
Documents with Different Content
place where the chest had stood, in Koku’s room, and outside the
building.
“It sure is,” agreed the young inventor. “All my plans for the train-
stopping device were in that chest. Now they’re gone, and I have no
duplicates!”
“And your tidal engine, too,” suggested Ned.
“Yes,” sighed Tom. “I guess my dream of harnessing the ocean
will not be realized for some time. Of course I may be able to work
out the ideas in some other way, but it means a big loss. And there
are other papers, too. There were dad’s designs of the gyroscope
flier, and——”
“What’s that about my gyroscope flier?” asked Mr. Swift, at that
moment entering the place. “I’ve come for those plans now, Tom. I
have just thought of a new idea in connection with the engine.”
“I’m afraid you can’t have the plans, Dad,” returned the son.
“They’re gone! The whole chest of secrets has been stolen!”
Tom had been debating in his mind whether or not to tell his
father the bad news, fearing the effect it might have on the elderly
man’s heart. But Barton Swift was no weakling. Like a charger
sniffing the powder of battle from afar, he drew himself up and
together at the same time crying:
“So our enemies are at some of their old tricks, are they, Tom?
Well, don’t let them see that we mind! Don’t show the white feather.
We’ll fight ’em, Tom! We’ll fight ’em!”
“That’s the talk!” cried Ned, while Tom was much delighted to
note that his father took the blow standing up.
“I can reconstruct those gyroscope plans!” cried the old man. “I
remember most of them, though it will set me back very much to
have them taken. Of course it’s a big loss, Tom. The whole chestful
gone! How did it happen?”
He was told, and then he confirmed Tom’s first idea that he had
heard nothing during the night to indicate an attack on the shop.
“I done t’ink I heard somethin’,” Eradicate said when they asked
him about the matter. “It was a sort of hootin’, hollerin’ sound. But I
figgered it was an owl bird, an’ I went to sleep again!”
“That was probably Koku shouting at the robbers,” decided Tom.
“He’s either still after them or they’ve done for him.”
“Koku gone?” cried Rad, and when told him that the giant was
missing the colored man forgot all his petty animosity against the big
fellow and expressed only sympathy. “I’s gwine to find him!” declared
Eradicate. “I go look for him!”
Tom did not pay much attention to his colored helper, since there
were other matters that needed his attention. The net result of the
searching on the part of his men was nothing. There were no clews
that could be followed. Reconstructing the crime, it was thought that
the gang of men had gained entrance by means of a false key. Then,
being unable to open the chest because of the special locks on it,
they had carried it away.
Surprised at this by Koku, they must have silenced the giant in
some manner and have carried him off while he was unconscious.
Doubtless an auto was used, though so many of these came and
went at the Swift office that the tire marks of no special one could be
picked out.
“All that remains is for us to make a search,” suggested Tom.
“And we have this much to go on—that I suspect my chest was
stolen by the same men, or some representing them, whose offer I
turned down when Mr. Damon made it on behalf of Mr. Blythe.”
“Then why not have Mr. Damon over here,” suggested Mr. Swift.
“He may be able to give us some clews as to these scoundrels.”
“I’ll do it!” cried Tom, and he sent an airship for Wakefield Damon
at once.
“Bless my fire insurance policy, Tom Swift, but this is a terrible
affair!” cried the odd man when he entered the office a little later. “I
wouldn’t have had it happen for a million dollars! Bless my check
book if I would! And it’s all my fault.”
“How do you make that out?” asked Tom, with a smile.
“I was foolish enough to bring you that offer from Mr. Blythe,
though I took it in good faith, and never knew he was such a
scoundrel! To think of his kidnapping Koku and taking your chest.”
“Blythe didn’t do it!” exclaimed Tom. “Nor did he have anything to
do with it! Blythe isn’t that kind of a man. I know that from my oil-
gusher dealings with him. Doubtless he has been deceived by these
men as I was deceived by Barsky. And I think if we could get hold of
Barsky we’d have the key that would unlock this whole puzzle. Why
we sent for you, Mr. Damon, is to ask if you could give us any clews
as to the men associated with Blythe.”
“I think I can,” was the answer. “Oh, Tom Swift, to think that such
a thing could happen! Bless my overshoes! it’s enough to make a
man a misanthrope all the rest of his life.”
By dint of further questioning Tom and Ned gleaned certain facts
from Mr. Damon, and these were a little later communicated to Mr.
Plum, the lawyer, with instructions to set certain confidential
investigators at work in distant cities.
“Do you think, Mr. Plum, that this robbery here had any
connection with the theft of the Liberty Bonds of which my father is
accused?” asked Ned.
“I don’t know,” was the answer. “It’s possible. There’s no obvious
connection, but I’ll check up on the matter and let you know.”
With this Tom and Ned had to be content for the time being. After
all the information possible had been collected, the foremen went
back to their shops and work was resumed. Mr. Swift at once began
to redraw his gyroscope plans, and Tom, sick at heart over his big
loss, late in the afternoon spoke to Ned about the advisability of
going for a ride across country.
“We might get a trace of Koku or the robbers in that way,” Tom
said.
“Good idea,” commented Ned. “It will be something to be on the
move. Nothing is worse than sitting still waiting for news. Come on.”
As they were about to start in the electric runabout, Eradicate,
who had disappeared soon after the discovery of the robbery, came
hurrying to the garage.
“Massa Tom! Massa Tom!” cried the colored man, much excited.
“I’s done found ’im!”
“Found them? You mean Koku and my chest of secrets?”
shouted the young inventor.
“No, I didn’t find de chest, but I found Koku! I found dat big giant!”
“Is he—is he dead?” faltered Tom.
“No, Massa Tom. Dat giant’s off in de woods tied to a tree! I
couldn’t loose de ropes or I’d a set him free. Dat’s why I came back
fo’ you all. But I done found Koku!”
CHAPTER XX
MANY STRANGE CLEWS

“Come on, Rad! Hop in! Show us where Koku is and we’ll soon
have him loose!” cried Tom, as he motioned to the rear of the
runabout, for he and Ned were seated in front.
“How is Koku taking being tied up?” asked Ned while the colored
man climbed in as quickly as his rheumatic joints would allow. “Is
Koku mad?”
“Mad? He done froth at de mouth!” cried the old servant. “By
golly, I wouldn’t like to be de one whut done tied him up after he gits
free!”
“Koku would be one of the best fellows in the world to take along
on the search for the robbers, Tom,” suggested Ned. “He’ll be so
angry he can easily handle half a dozen with one hand—if there
should prove to be that many in the gang.”
“Shouldn’t wonder but what there are more than that in the plot,”
agreed Tom. “It’s a queer game! But come on. We must help Koku.
Where is he, Rad?”
“Over by Lake Carlopa—dat place where you and me used to go
fishin’.”
“You mean Chestnut Point?”
“Dat’s de place, Massa Tom.”
“A lonely region,” remarked the young inventor, as he started the
runabout. “They couldn’t have picked out a better—or rather, a worse
—place to leave poor Koku. How’d you happen to think of looking
there, Rad?”
“Well, Massa Tom, I t’ought maybe Koku might go there of his
own se’f. Onct I kotched a big fish there, an’ I was tellin’ him ’bout it.
He always said he could kotch a bigger fish’n whut I did. So I t’ought
maybe he was tryin’ to beat me, an’ maybe de robbers didn’t tuk him
after all. So I looked an’ I done see him tied to a tree!”
The run to Chestnut Point did not take long, and, following the
directions of Eradicate, Tom guided his machine along a lonely road.
They had traversed this a short distance when Ned cried:
“Hark!”
“What did you think you heard?” asked Tom, shutting off the
motor to render the machine silent.
“Some one calling,” answered Ned. “Listen!”
A loud voice was borne to their ears by the wind, and Tom had no
sooner heard it than he cried:
“That’s Koku! And he sure is mad!”
The giant was like an enraged bull, but so securely was he bound
to a tree with many strong ropes and straps that even his great
strength was of no avail, especially as he was so cunningly bound
that he was unable to exert his full strength.
“Good you come, Master Tom,” grunted Koku, as he saw his
friends approaching in a run. “You friend of mine from now on, Rad—
you bring help to me.”
“Cou’se I’s you’ friend,” chuckled Eradicate. “De only time when
we has any disputations is when you tries to take my place wif
Massa Tom.”
It was the work of some time for Ned and Tom, even with their
sharp knives, to cut the straps and the ropes, the knots of which had
proved too hard for the colored man to loosen. Then, working his
great arms and striding up and down amid the trees to restore his
stagnant circulation, the giant cried:
“Where are ’um? Where are ’um mans that tied me? Once I git
’um—I mince pie ’um!”
“Guess he’s heard the expression ‘make mince meat of them,’ ”
remarked Ned to Tom.
“Very likely. But I’ve got to get him quieted down so I can
question him. He will be the best one to give us clews by which we
may trace these fellows.”
Accordingly Tom talked to his giant helper and finally got an
account of what had happened. Tom could do more with Koku and
understand his peculiar English better than any one else. Also Tom
knew something of the giant’s own language.
Gradually a coherent story emerged. Koku had been left on
guard the previous night in Tom’s private office building, following the
attack on the young inventor. The early part of the evening had
passed without anything to disturb the giant’s sleep. Later, however,
the alarm bell over his bed rang. Tom had not trusted altogether to
his giant remaining awake when on guard, and, as old readers know,
the whole place was wired in burglar alarm fashion.
So that, even though the door was opened with a skeleton key,
as was proved later to have been done, the swinging of the portal set
off one signal, the wire to which had remained intact, and Koku
awakened.
He had been awakened some months before by the alarm bell,
but that time it was Tom himself who entered the place late at night
to make notes on a certain plan before he should forget the idea that
occurred to him. Tom forgot about the burglar alarm, and set it off,
bringing Koku running with a gun in his hands.
Of course Tom laughed at the incident, but Koku now
remembered this, and, thinking it might be another false alarm, he
did not at once rush to the floor below, but proceeded cautiously. If
the intruder should prove to be some one with a right to enter, Koku
would go back to bed again.
Going down softly, and looking in the room where the big oak box
was kept, the giant saw several strange men trying to force the
locks. This being beyond them, one of the men had cried, as Koku
understood it:
“Let’s take the whole shooting match along! The Blue Bird will
carry it and we can open it in the woods.”
So they had picked up Tom Swift’s chest of secrets and carried it
out of the office. Even then Koku did not give the alarm, for his brain
did not work as fast as the brain of an ordinary person. Then, too,
the giant thought he had plenty of time, and could, when he got
ready, sweep the robbers off their feet and take the chest away from
them.
But he delayed too long. Following the men—there were eight of
them, he counted on his fingers—Koku went out of the office building
into the darkness. The men carried the chest to a large automobile
that was waiting in the road, the motor running and the lights off.
Then, just as they loaded it in and Koku was about to spring on
them, the men discovered his presence and jumped on the giant
before he could get into action.
Even a little man will have the advantage of a much larger and
more powerful fellow if the little man gets started first, and this was
what happened in the case of Koku. Besides, there were eight of the
robbers, and though under some circumstances Koku might have
been able to fight eight, or even ten men, taken as he was by
surprise, he was knocked down.
He struggled, but the men threw “something into his face” that
stung and made him “feel funny” and he was gagged, bound and
lifted into the auto, though his weight made the men “grunt like pigs,”
as the giant expressed it.
So the thing happened, and Koku, helpless, a little stunned, and
silent, was driven off in the night, no struggle at all having taken
place in the office.
Where he was taken the giant did not know in the darkness. But
after a while he was lifted out of the car and tied to the tree where
Eradicate found him.
“But what became of the robbers and Tom’s chest?” asked Ned.
“ ’Um robbers go off in Blue Bird with chest of secrets,” answered
the giant.
“What does he mean—Blue Bird?” asked the manager.
“It’s a big aeroplane painted blue,” explained Tom. “The men had
it hidden in a cove on the lake. It must be a hydroplane, though
possibly it’s a combination of both types of machine. Koku had a
glimpse of it because the robbers used pocket flashlights. They put
the chest in the blue aeroplane and soared off with it. Koku said he
could hear the throb of the motors for a long time after they were
gone.”
“What’s the next thing to be done?” asked Ned. “We can’t do
anything here, and it’s getting late. Did Koku see any of the faces of
these fellows?”
“They all wore masks,” Tom said. “Yes, Koku, what is it?” the
young inventor asked, for he noticed that his giant wanted to tell him
something in addition.
Followed then more of the queer, jumbled talk of the big man,
who, now and then, used some of his own words, which Tom alone
could translate. Then came silence.
“He says,” interpreted Tom, “that one of the men walked with a
slight limp and had a queer habit of throwing his left elbow out from
his side.”
“Limping! Throwing out his elbow!” excitedly cried Ned.
“Does that mean anything to you?” asked Tom.
“Does it? I should say it does. Why, that’s the very thing Renwick
Fawn does!”
“Renwick Fawn!” exclaimed Tom. “You mean——”
“The man who accused my father of taking the Liberty Bonds!”
fairly shouted Ned. “I always thought that fellow was a crook, and
now I know it. Tom, he’s in with the scoundrels that robbed you!”
“Maybe,” assented the young inventor. “I wouldn’t put it past him,
since I’ve had a look at his face. But if this is the case, we have
several clews to work on now, Ned. The limping man with the queer
elbow action, the blue aeroplane, and some other things that Koku
told me. Let’s go back and get busy!”
CHAPTER XXI
SCOUTING AROUND

Fairly well satisfied that he had secured some clews that would
be of value to him, Tom Swift hurried home with Ned, Koku and
Eradicate in the electric runabout. On the way the giant recovered
somewhat from the rough treatment accorded him by the robbers,
and talked of what he would do to them when he caught them.
“You must be hungry,” suggested Ned, as they neared Shopton.
For Koku had been taken away the previous midnight and evening
was now coming on again.
“Me eat ten loaves of bread!” cried the giant, opening wide his
enormous mouth.
“We’ll give you something else, too!” chuckled Tom. “But I know
poor Mrs. Baggert will almost faint when she sees you begin to eat.”
The giant’s appetite was always a source of wonder to the
housekeeper, and now, starved as he was by his enforced fast, it
might reasonably be expected that he would clean out the pantry.
Tom had the foresight to stop and telephone word to Mrs. Baggert of
the situation, so she sent out and got in plenty of food before the
wayfarers returned. Thus was Koku provided for.
“Well, Ned, let’s get together and talk this thing over,” suggested
Tom to his manager, leaving the giant still eating, long after the
others had finished. Eradicate, true to his promise to be friends with
the big man, remained to help serve him.
“Yes,” agreed Ned, “we had better make some plan to work on.
But this discovery that Renwick Fawn is in the plot rather surprises
me.”
“I must see if Mr. Damon knows anything about him in this
connection. He may have heard Blythe speak of him.”
Mr. Damon was communicated with over the telephone, and after
several queer “blessings” announced that, as far as he knew, Fawn
was a stranger to Mr. Blythe.
“He doesn’t know anything of Blodgett either,” Tom told Ned,
recalling the conversation Mary had overheard in the restaurant.
“Then we’ll have to tackle Fawn on our own account,” said Ned. “I
know where he lives. Shall we go to his house and ask for him?”
“What shall we say to him if he’s at home?” Tom wanted to know.
Ned thought for a moment and replied:
“We can ask him, for a starter, if he has recovered any of the
Liberty Bonds he says my father took. Then, after that opening, you
can mention the theft of your box and ask if Fawn thinks there is any
connection between the two.”
“Then what?” Tom inquired.
“Well, if things turn out the way we expect—I mean if this Fawn
has really had a part in the robbery at your place—he’ll get confused
and maybe give himself away. That’s our one hope—that he will give
himself away.”
“It’s worth trying,” decided Tom, after a little consideration. “Come
on.”
A little later in the evening the two young men set off in a small
gasoline car to call at the home of the suspected man. Ned had had
occasion to go there before some time since, months prior to the
accusation against Mr. Newton.
But it was with some feelings of apprehension and with
wonderings as to what they had best say to the man when he saw
them that Ned and Tom walked up the steps of the Fawn home.
A maid answered the door, and when they said they had called to
see Mr. Fawn she remarked:
“I think Mr. Fawn is not at home, but Mrs. Fawn is. Please come
in and I will tell her you are here.”
Mrs. Fawn, a small, pale, unimpressive woman, came timidly into
the room where the boys waited.
“You wanted to see my husband?” she asked, and Tom jumped
at once to the conclusion (in which Ned later joined) that she knew
nothing of the man’s peculiar activities. Their feeling that he was a
brute and a bully toward her was afterward borne out by facts.
“We have some business to transact with Mr. Fawn,” stated Ned.
“But the maid said he wasn’t at home.”
“No, he isn’t,” answered Mrs. Fawn, and the boys did not doubt
her. “He has gone to Chicago on business. At least I think it is
Chicago,” she added. “He goes to so many places I sometimes
forget. But I know it was out West.”
“Well, if he’s that far off, I guess we can’t see him to-night,”
returned Tom with a smile as he arose to go. “When did he leave
town?”
“The day before yesterday,” answered Mrs. Fawn.
Ned had not given his name, and though Tom had mentioned his,
he did not believe Mrs. Fawn knew enough of her husband’s
business to connect her callers with the bond accusation against Mr.
Newton.
But the two young men glanced sharply at each other when Mrs.
Fawn spoke of her husband having gone to Chicago two days
previous. If that was the case he could hardly have been engaged in
the theft of Tom’s strong box.
“Do you want to leave any word for Mr. Fawn when he returns?”
asked his wife.
“Thank you, no,” answered Tom. “It wasn’t important. We’ll see
him when he gets back.”
When they were outside Ned asked:
“Well, what do you think now, Tom?”
“I don’t know what to think. Koku is pretty sharp. When he says
he saw a thing you can make up your mind that he did. Of course it’s
possible there may be two men who limp and throw out their left
elbows, you know.”
“It’s possible, but not very probable,” answered the young
manager. “I believe Fawn is guilty, but his wife may not, and very
likely doesn’t, know anything about it. She’s a meek little lady.”
“Yes, indeed,” agreed Tom. “Well, we’re stuck for the time being.
However, to-morrow is another day. Something may turn up then.
Anyhow, even if it doesn’t, I’m going to start out.”
“Start out where?” Ned wanted to know.
“To look for that blue aero-hydroplane. I’m going to scout around
in the Blackbird and see if I can’t get on the trail of the fellows who
have my chest of secrets.”
“I’d like to go with you.”
“Wouldn’t think of taking off without you, old scout!” cried Tom.
He guided the car down the street and out on a wide avenue,
going along at a steady pace and with such an evident object in view
that Ned asked:
“Where are you heading?”
“I thought I’d stop at the Nestors’ a minute,” answered Tom.
“Then let me out here and I’ll take a trolley home,” said Ned.
“Let you out here! What’s the idea?” cried Tom.
“Well, you’re going to call on Mary, and——”
“Forget it!” laughed Tom, clapping his chum on the back. “This is
a sort of joint call, and you’re coming in. Mary isn’t fussy that way,
and she always likes to see you.”
“Thanks,” murmured Ned.
The two young men were no strangers in the Nestor home, Tom
especially; and soon the whole family was in conversation. Tom
mentioned the fact that he and his chum had just called on Mr. Fawn
but found that he had left for the West two days before.
“Left for the West!” exclaimed Mr. Nestor. “That’s queer!”
“Why so?” Tom asked.
“Because I saw him in town yesterday morning. And he couldn’t
have been going to Chicago.”
“Are you sure?” inquired Ned.
“Of course. I know the man as well as I know you. He was
limping along, tossing his left elbow out every now and then as he
has a habit of doing.”
Ned and Tom glanced at one another. If this was the case it
would explain matters. Fawn may have told his wife he was leaving
for Chicago, and even have packed a bag to go. But he went to
some other place and remained about Shopton long enough to take
part in the robbery that night.
Mr. Nestor’s mention of the peculiar gait of the man and his habit
of tossing his left elbow away from his body while walking or talking
was almost positive proof that there could be no mistake.
But Tom was not yet ready to let it be known that Fawn was
caught in a falsehood. There were many more points to be cleared
up before the affair was on the way to be solved. So, passing the
matter off as though it did not amount to much, murmuring that
possibly he had misunderstood Mrs. Fawn, Tom turned the talk into
other channels.
The chums left the Nestor home near midnight, Mary expressing
her indignation at the loss inflicted on Tom and asking if she could
not do something to help.
“I’ll let you know if you can,” Tom told her as he pressed her
hands.
For a few minutes Tom and Ned rode on in silence, each busy
with his thoughts, and then Ned asked:
“Well, Tom, what do you make of it?”
“You mean about Fawn not going to Chicago at all?”
“Yes.”
“Well it means he’s a trickster surely, but more than that. He’s in
the plot, of course. And I’m beginning to believe that it’s bigger than I
thought. Fawn and Barsky—both in the same town, both probably
working together against dad and me. It was a sorry day when I let
that so-called Russian into my shop!”
“It surely was,” agreed Ned. “But it’s too late to think of that now.
What is the next move? I want to get my hands on Fawn, as well as
on the others.”
“We start scouting to-morrow morning!” decided the young
inventor. “It oughtn’t to be hard to pick up the trail of this blue
aeroplane. I had some inquiries made around Lake Carlopa, and she
seems to have headed west. That, naturally, would be the best place
for the robbers to go—plenty of open places to land, and with widely
scattered cities and towns they wouldn’t run so much risk of being
captured. We’ll start scouting in the morning.”
Accordingly the Blackbird was made ready. This craft was not as
small nor as speedy as the Hummer, but she would carry three, and
Tom decided to take Koku along to identify the robbers if possible.
“Good luck, Tom!” called his aged father, as he was ready to take
off the next morning. “Bring back that chest!”
“I’ll do my best!” was the answer.
CHAPTER XXII
A STRANGE MESSAGE

Though he had no more than very slight clews on which to


pursue the robbers, Tom Swift was not without a definite plan on
which he proposed to operate.
As he had mentioned to Ned, he had obtained information which
indicated that the big blue aeroplane, after the robbers had put the
chest on board and had left Koku tied to the tree, had departed
toward the west. Of course there was no guarantee that it would
keep on this course, and absolutely no way of telling how long it
would hold it.
“But we can stop from time to time,” said Tom to Ned, “and make
inquiries about the plane. A big blue aeroplane isn’t easily hidden
from sight.”
“It sounds like good dope,” agreed Ned.
Koku was no stranger to aeroplane rides, and he felt perfectly at
home in the Blackbird. Indeed, as those of you remember who have
read the earlier books of this series, Koku was brought from his
home in a strange land by an airship. He rather liked to ride in them.
So Tom, Ned and Koku flew off on their strange quest.
Up into the air soared the Blackbird. She was a powerful
machine, and, as has been said, was roomy. Really, she was built to
carry four, but on account of the size of Koku a partition between two
cockpits had been taken out, making a large space where he could
dispose of his enormous legs and big body.
Before starting on the search for his chest of secrets, Tom had
caused inquiries to be made about the missing Barsky. But the man
seemed to have disappeared completely after leaving Tom in the
cistern.
“Though of course he might have been, and probably was, one of
the gang that took the chest and bound Koku,” suggested Ned.
For several hours the trio of adventurers soared along, not going
so high but what they could from time to time make observations of
the earth below them through field glasses. For of course it was
possible that the blue aeroplane might be on the ground.
She also might be soaring along in the air, and Tom and Ned did
not neglect to scan the heavens for signs. Once they saw a plane
coasting along, and gave chase. But when within good viewing
distance they made out that it was one of the government mail-
carriers, and they turned back on their original course.
It was near noon when Ned heard Tom give a sudden
exclamation.
“See anything?” asked the young manager.
“Nothing that gives me any pleasure,” replied Tom grimly. “I see a
leak in one of the oil pipes and that means we’ve got to go down and
mend it. Lucky I discovered it in time!”
An aeroplane engine, or for that matter an auto motor, that does
not receive copious and continuous lubrication is going to overheat,
bind and stop in a surprisingly short time.
A look over the side showed Tom that they were flying across
fairly open country, and, picking out a broad meadow as a suitable
landing place, he, having shut off his motor, headed for it. Koku, half
asleep in his enlarged cockpit, sensed that they were going down
and asked:
“We catch ’um robbers?”
“Not yet, Koku,” replied Tom, with a grim laugh. “So far they are a
couple of tricks ahead of us, but the game has only started.”
The Blackbird made a perfect landing under Tom’s skillful
guidance, and when it had come to a stop after a run over the
somewhat uneven field, Tom and Ned got out to begin work on
repairing the oil pipe. Ned had some knowledge of mechanics, and
could at least help his chum.
“It isn’t as bad as I thought,” Tom said, after a careful inspection.
“It’s just a loose union connection, and not a break. I won’t have to
solder anything, and I think I have a spare union in the tool box.”
It was while he was looking for this and while Koku was strolling
about, heaving big stones for his own amusement (and possibly with
the sensation that he was thus treating his enemies) that Ned called:
“Some one’s coming, Tom!”
The young inventor, who had found the union connection he was
looking for, looked up and saw a farmer approaching across the field.
“Maybe he’s going to order us off,” suggested Ned. “We’re
trespassers all right. Didn’t even ask his leave to drop in on him.”
“No, we didn’t have time,” grimly chuckled Tom. “But if he makes
a fuss I guess a few dollars will make him see the light of reason.
I’ve dealt with that kind before.”
However, the farmer, for such he proved to be, was a friendly
person. He smiled at the chums, looked with amazement at Koku,
who was lifting a rock that three ordinary men could not have
handled, and then asked:
“Are you having trouble? Can I help you?”
“Thank you, very much,” responded Tom. “It’s only a slight defect,
and I’ll have it mended in a minute or two.”
“We thought possibly you were coming to order us off,” said Ned,
as he got ready to help his chum replace the broken union on the oil
feed pipe.
“Oh, no,” laughed the farmer, who gave his name as Mr. Kimball.
“We’re getting used to aeroplanes landing here.”
“You mean the government machines?” asked Tom. “I know this
is their route.”
“Well, a mail plane was forced down in this field last year,” said
Mr. Kimball. “But I didn’t mean that. Only yesterday a big blue
machine had to come down about where you are.”
“A blue machine?” repeated Tom, concealing his excitement.
“Regular landing or a crash dive?” asked Ned.
“I guess they came down on purpose,” said Mr. Kimball. “They
landed gently enough—no crash. It seems they ran out of water in
their radiator. That’s happened to me many a time in my little Ford,
so I knew just how they felt about it. I came over and showed them a
spring where they could get water. Then they went on again.”
Ned and Tom looked at each other. They did not want to tell too
much of their plans, yet they must make inquiries and get
information. Koku was still doing his “daily dozen” with the big rocks.
“How many men were in this blue machine?” asked Tom.
“Oh, four or five, I should say. Maybe half a dozen. It was the
biggest aeroplane I’ve ever seen. But then they look a lot bigger on
the ground than when they’re up in the air.”
“It must have been a pretty good-sized plane to carry four or five
men,” observed Ned. “Did you notice any of the passengers? Did
one of them walk with a limp?”
“Why, yes, come to think of it, one of them did seem a bit lame,”
replied Mr. Kimball. “And he had a queer habit of jerking his elbow
out like this,” and the farmer illustrated.
“Was it his right elbow?” asked Tom, emphasizing the word that
indicated the dexter hand.
“No—let me see now—no, it was his left. Why? Do you know
him?”
“Yes,” answered Ned, with a queer look at Tom. “We know him.”
“I suppose they’re friends of yours, both of you being in the
airship business, so to speak,” went on Mr. Kimball.
Neither of the young men answered that, but Tom, after he had
taken off the damaged union coupling, asked:
“Did you happen to notice if one of the men had red hair?”
The farmer considered for a moment, and then replied:
“No, I didn’t see any one like that.”
This was not surprising, considering that Barsky’s hair was so
short that its redness could not be noticed until he took off his hat.
And very likely he would be wearing a leather helmet in the
aeroplane.
But Tom and Ned had established the fact that the blue
aeroplane containing the robbers had passed this way recently. Tom
made a cautious inquiry about the chest, but Mr. Kimball had not
noticed that. And, very likely, it was stowed away in the fuselage of
the craft, out of sight.
“How long did they stay?” asked Ned.
“Oh, only long enough to buy some food off me and take on
water, then they soared away again.”
“Headed west?” asked Tom.
“Headed west,” answered Mr. Kimball.
The farmer remained, an interested observer, while Tom and Ned
made the slight repairs needed. When they had finished and were
about to go on, Mr. Kimball, with a glance toward the giant, asked:
“Is he yours?”
“Yes, in a way,” replied Tom. “Why?”
“Um! I only want to say if you ever want to get rid of him I’d like to
hire him. What a hired man he’d make! My, the chores he could do
without getting tired! He’d be worth three ordinary hired men—and
they’re so hard to get now. But I don’t suppose you want to let him
go?”
“No,” answered Tom, with a laugh and a glance at Koku, who, to
amuse himself, was tossing up great rocks and catching them in his
bare hands.
“Well, I don’t know as I blame you,” said Mr. Kimball.
Having made repairs and gotten some unexpected and valuable
information, Tom and Ned called to the giant, took their places in the
machine again, and, after Koku had spun the propeller, once more
were off.
All that day they traveled, Tom and his chum keeping a lookout
for the blue machine, but not seeing it. The young inventor had so
laid his plans that before it got too dark he descended in a broad
field on the outskirts of a big city. As the aeroplane was large enough
to permit of sleeping in it and as Tom had brought along blankets,
they decided to spend the night in the Blackbird.
It was the next morning about nine o’clock, and just about the
time Tom and Ned were taking off again on the second day of their
trip, that Mr. Swift was summoned to the telephone in his office.
“Dey’s somebody dat wants to talk to you ’ticklar like,” reported
Eradicate.
“Perhaps it’s a message from Tom!” exclaimed Mr. Swift. “He may
have caught the robbers and gotten back his chest.”
“No, sah, it don’t sound like Massa Tom,” said the colored man.
The voice to which the aged inventor listened was not that of his
son. Instead, over the wire came strange tones asking:
“How much will you pay us for the return of your chest of
secrets?”
Mr. Swift was so surprised that he almost dropped the receiver.
CHAPTER XXIII
THE BLUE MACHINE

Barton Swift was the true father of his energetic son, and Tom
inherited his qualities from his father. Which is to say that in his youth
Barton Swift had been fully as active and quick as was now the
young inventor.
Though age and illness had to some extent dimmed and
enfeebled the powers of the man, still it needed but this spark—that
strange telephone message—to galvanize him into action. After the
first shock of hearing so unexpectedly about the stolen chest of
secrets, Mr. Swift was ready to take active measures to trace the
voice coming out of the machine.
“What’s that you say?” he asked, nerving himself to carry on an
ordinary conversation about a most extraordinary topic. “Who are
you and where are you?”
“Don’t you wish you knew?” came back the challenging inquiry.
“Are you ready to talk business?”
“Of course I am,” answered Mr. Swift. “We want that chest back,
and we’ll pay any reasonable amount.”
“I’m not saying the amount will be reasonable,” was the reply, and
emphasis was laid on the last word. “But you’ll pay our price or you
don’t get the chest. And I warn you that if you try to communicate
with the police or set the detectives on our trail we’ll immediately
break off negotiations.”
Trying to get in touch with the police was just what Mr. Swift was
then doing. Ned Newton’s father had entered the office, and, seeing
him, Mr. Swift at once took pencil and paper from his desk and while
he talked in a rather general way with his unseen listener, he jotted
down a few words, explaining matters and suggesting that Mr.
Newton go to another telephone to learn from the central operator
where the mysterious call was coming from.
There were several trunk telephone lines running into the Swift
office, so it was a comparatively easy matter for Mr. Newton to go to
another instrument to get the information needed.
Meanwhile Mr. Swift was holding the other man in conversation.
Having started Mr. Newton to ferreting out some information, the
aged inventor asked:
“How much do you want to return the chest and how can I get in
touch with you?”
“If you will take fifty thousand dollars in unmarked bills, make a
bundle of them and bring them——”
But at that moment the criminal either heard something—perhaps
the movements of Mr. Newton—or he suspected something, for he
sharply broke off what he was saying and cried:
“It’s all off! You’re trying to double cross me! Now you’ll never get
your chest back!”
There was a click which told that the distant receiver was hung
up, and then the line went dead.
“Wait a minute! Wait just a moment! I want to talk business with
you!” cried Mr. Swift, rapidly moving the hook of the receiver up and
down.
But it was too late. Only silence ensued until finally the operator,
attracted by the flashing light which resulted when Mr. Swift moved
the hook, asked:
“Number, please?”
“I was talking to some one, but I was cut off,” said the inventor.
“Can you get them back for me? It’s important.”
“What number were you talking to?” the girl asked.
“That’s just what I want to know,” said Tom’s father.
“I’m sorry, but if you don’t know the number I can’t ring it for you.”
Mr. Swift knew only too well that this was the case. It was not the
girl’s fault—it was the fault of the system, and not so much the fault
as the limitation.
“If I had only had Tom’s photo-telephone attachment hitched on
here I could have seen who it was I was talking with,” lamented Mr.
Swift. “How about it, Mr. Newton, did you succeed in getting any
information?” he asked, as the latter came away from the second
instrument.
“The manager said he would try to trace the call for you,” was the
reply. “But I didn’t have much time. Whoever it was got suspicious
too quickly.”
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like