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

Getting Started with NativeScript Explore the possibility of building truly native cross platform mobile applications using your JavaScript skill NativeScript 1st Edition Anderson pdf download

The document is a guide to building native cross-platform mobile applications using NativeScript with JavaScript. It covers the fundamentals of the framework, including project setup, UI components, and third-party integrations, aimed at helping developers create applications for iOS, Android, and Windows. The author, Nathanael J. Anderson, provides insights and practical steps to streamline the development process across multiple platforms.

Uploaded by

anaysverchj8
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)
10 views

Getting Started with NativeScript Explore the possibility of building truly native cross platform mobile applications using your JavaScript skill NativeScript 1st Edition Anderson pdf download

The document is a guide to building native cross-platform mobile applications using NativeScript with JavaScript. It covers the fundamentals of the framework, including project setup, UI components, and third-party integrations, aimed at helping developers create applications for iOS, Android, and Windows. The author, Nathanael J. Anderson, provides insights and practical steps to streamline the development process across multiple platforms.

Uploaded by

anaysverchj8
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/ 64

Getting Started with NativeScript Explore the

possibility of building truly native cross


platform mobile applications using your
JavaScript skill NativeScript 1st Edition
Anderson download
https://ebookname.com/product/getting-started-with-nativescript-
explore-the-possibility-of-building-truly-native-cross-platform-
mobile-applications-using-your-javascript-skill-nativescript-1st-
edition-anderson/

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


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

Learning React Native Building Native Mobile Apps with


JavaScript 1 (Early Release) Edition Bonnie Eisenman

https://ebookname.com/product/learning-react-native-building-
native-mobile-apps-with-javascript-1-early-release-edition-
bonnie-eisenman/

Enyo Up and Running Build Native Quality Cross Platform


JavaScript Apps 2nd Edition Roy Sutton

https://ebookname.com/product/enyo-up-and-running-build-native-
quality-cross-platform-javascript-apps-2nd-edition-roy-sutton/

JavaScript for Absolute Beginners Getting Started 1st


Edition Terry Mcnavage

https://ebookname.com/product/javascript-for-absolute-beginners-
getting-started-1st-edition-terry-mcnavage/

Brain Stimulation 1st Edition Andres M. Lozano And Mark


Hallett (Eds.)

https://ebookname.com/product/brain-stimulation-1st-edition-
andres-m-lozano-and-mark-hallett-eds/
Across This Land 2nd Edition John C. Hudson

https://ebookname.com/product/across-this-land-2nd-edition-john-
c-hudson/

Quantum Non Locality and Relativity Metaphysical


Intimations of Modern Physics 3rd Edition Tim Maudlin

https://ebookname.com/product/quantum-non-locality-and-
relativity-metaphysical-intimations-of-modern-physics-3rd-
edition-tim-maudlin/

Problems as Possibilities Problem Based Learning for K


16 Education 2nd Edition Linda Torp

https://ebookname.com/product/problems-as-possibilities-problem-
based-learning-for-k-16-education-2nd-edition-linda-torp/

The Pharmacology of Neurogenesis and Neuroenhancement


1st Edition Donard S. Dwyer (Eds.)

https://ebookname.com/product/the-pharmacology-of-neurogenesis-
and-neuroenhancement-1st-edition-donard-s-dwyer-eds/

A Guide to Sources of Texas Criminal Justice Statistics


R. Scott Harnsberger

https://ebookname.com/product/a-guide-to-sources-of-texas-
criminal-justice-statistics-r-scott-harnsberger/
Telling Lives in India Biography Autobiography and Life
History 1st Edition David Arnold

https://ebookname.com/product/telling-lives-in-india-biography-
autobiography-and-life-history-1st-edition-david-arnold/
[1]
Getting Started with
NativeScript

Explore the possibility of building truly native,


cross-platform mobile applications using your
JavaScript skill—NativeScript!

Nathanael J. Anderson

BIRMINGHAM - MUMBAI
Getting Started with NativeScript

Copyright © 2016 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: January 2016

Production reference: 1220116

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78588-865-6
www.packtpub.com
Credits

Author Project Coordinator


Nathanael J. Anderson Shipra Chawhan

Reviewer Proofreader
TJ VanToll Safis Editing

Commissioning Editor Indexer


Veena Pagare Monica Ajmera Mehta

Acquisition Editor Production Coordinator


Prachi Bisht Conidon Miranda

Content Development Editor Cover Work


Mehvash Fatima Conidon Miranda

Technical Editor
Abhishek R. Kotian

Copy Editor
Lauren Harkins
Foreword
Are you tired of writing the same mobile app from scratch for iOS, Android and
Windows? Yes? Then, you should be glad you found NativeScript!

Owing to the mobile platforms diversification, it is clear that to build a successful


mobile application, you should make it available on all of the major mobile
marketplaces, namely, Apple AppStore, Google PlayStore, and Microsoft Windows
Store. This created a need for companies and developers to publish native apps
that are available on all three major mobile stores without compromising on the
native user experience. The problem, however, is that these three operating systems
are very different and companies need to implement three different applications
for these stores. Essentially, your company has to write and maintain multiple
implementations for the same problem. Teams write (and have to support) the
same apps multiple times. There is a good chance that bugs reported on one
platform also exist on the others but remain unnoticed. Apps that are meant to
behave identically on all platforms may exhibit subtle differences due to their
differing implementations. Also, shipping new features at the same time on all
platforms is difficult. This is neither optimal, nor very productive and requires a
significant investment to gain the knowledge of three different operating systems,
languages, IDEs, APIs, and marketplaces. There has got to be a better way. Enter
NativeScript—a framework using the native platform APIs, rendering and layout
capabilities to deliver ultimate user experience and will allow developers to reuse
their coding skills, eliminating the need to learn new languages and IDEs.

The NativeScript framework enables developers to use the pure JavaScript language
to build native mobile applications running on all major mobile platforms—Apple
iOS, Google Android, and Windows Universal. The application's UI stack is built
on the native platform rendering and layout engine using native UI components,
and because of that, no compromises with the User Experience of the applications
are made. It is also worth mentioning that a full native API access is provided
using JavaScript.
This book has everything you need to get started with NativeScript. It starts with
the fundamentals, such as the project structure, the command-line interface, how
to use basic UI element, how to use third-party native components, and finally,
how to target different platforms with NativeScript.

The author, Nathanael Anderson, is one of the faces of NativeScript. He has a deep
understanding of how the framework operates from inside out and is the best person
who can teach you how to use it.

"I'm confident that by reading this book, you will be able to quickly get into
NativeScript and start building your next cross-platform native mobile
application."

Valio Stoychev
Product Manager NativeScript at Telerik
About the Author

Nathanael J. Anderson has been developing software for over 20 years in a wide
range of industries, including areas of games, time management, imaging, service,
printing, accounting, land management, security, web, and even (believe it or not)
some successful government projects. He is currently a contract developer for master
technology and can create a solution for several types of applications (native, web,
mobile, and hybrid) running on any operating system.

As a senior developer engineer, he can work, tune, and secure everything from
your backend servers to the final destination of the data on your desktop or
mobile devices. By understanding the entire infrastructure, including the real and
virtualized hardware, he can completely eliminate different types of issues in all
parts of a framework.

Currently, he has multiple highly rated cross-platform plugins for NativeScript,


and he works heavily in the NativeScript community by providing things such as
bleeding edge build servers to build knightly code. He has also provided multiple
patches and features to the main NativeScript project.
About the Reviewer

TJ VanToll is a senior developer advocate for Telerik, a jQuery team member,


and the author of jQuery UI in Action. He has over a decade of web development
experience—specializing in performance and the mobile Web. He speaks about
his research and experiences at conferences around the world and has written for
publications such as Smashing Magazine, HTML5 Rocks, and MSDN Magazine. You
can follow him on Twitter at @tjvantoll and on GitHub at tjvantoll.
www.PacktPub.com

Support files, eBooks, discount offers,


and more
For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and
as a print book customer, you are entitled to a discount on the eBook copy. Get in touch
with us at [email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up
for a range of free newsletters and receive exclusive discounts and offers on Packt books
and eBooks.
TM

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser

Free access for Packt account holders


If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.
Table of Contents
Preface vii
Chapter 1: Introduction to NativeScript 1
NativeScript 1
Telerik's NativeScript 2
Other competitors 2
NativeScript uniqueness 2
NativeScript is easy 3
NativeScript and TypeScript 4
What is TypeScript? 4
TypeScript's use in NativeScript 4
Choosing a development language 5
Common modules 5
Installing NativeScript 6
Prerequisites 6
node.js 6
iOS 6
Android 7
Installation 7
Installation help 8
The NativeScript command line 8
NativeScript commands 8
Creating your first application 10
Creating the application in easy steps 11
Running the app 12
Summary 13
Chapter 2: The Project Structure 15
Project directory overview 15
The root folder 17
The app folder 18
[i]
Table of Contents

The lib folder 18


The hooks folder 18
The node_modules folder 19
The tns-core-modules folder 19
The platforms folder 20
The platforms/android folder 20
The platforms/iOS folder 22
The app folder 24
The .gradle folder 24
The App_Resources folder 24
The fonts folder 25
The app folder files 25
The package.json file 25
License 25
App.js 26
App.css 27
Application page 27
The main-page.js file 27
The main-page.css file 28
The main-page.xml file 28
The main-view-model.js file 29
Foundational components 31
Application component 31
Frame component 32
Page component 32
Creating a second page 33
Creating additional files and pages 34
Creating settings.js 34
Navigating to another page 35
Running the application 36
Viewing our screen 36
Summary 37
Chapter 3: Declarative UI, Styling, and Events 39
Declarative UI 39
XML parser 40
Page, StackLayout, label, and more 41
<Page ...> node 41
<StackLayout ...> node 42
<Label ...> node 42
<Button ...> node 45
Second <Label...> node 46
Declarative UI and components 46
Visual components 47

[ ii ]
Table of Contents

Using the Declarative UI for our settings page 47


Our settings.xml file 47
Binding and event system 49
Event system 50
Binding 51
Styling the UI 52
What is CSS? 52
Why use CSS? 53
How to use CSS 53
Configuring your CSS Rules 54
Existing CSS properties 56
Exploring app.css 58
Trying CSS out and styling our application 60
Styling on your own 61
Summary 62
Chapter 4: Building a Featured Application 63
Layouts 63
StackLayout 64
WrapLayout 64
AbsoluteLayout 65
DockLayout 66
GridLayout 66
Building our featured application 68
Nonvisual components 69
Dialogs 72
Alert dialog 73
Confirm dialog 73
Prompt dialog 74
Login dialog 74
Action dialog 75
Promises 75
The settings screen Declarative UI 76
GridLayouts 76
Building the main screen 79
JavaScript code 79
Declarative UI 82
Main page Declarative UI 83
Main page body 83
ScrollViews 84
More about bindings 84
Repeaters 84
Main-body footer 85

[ iii ]
Table of Contents

The main-page.css file 87


Application CSS 89
Fonts 90
Icons 91
Communication with the server 91
Trying out our application 95
The server 95
Setting up your own server 96
Trying crossCommunicator out. 97
Summary 98
Chapter 5: Installing Third-Party Components 99
Places to find third-party components 99
The Telerik plugin site 100
npmjs.com 100
The NativeScript unofficial plugin list 100
How to install a third-party plugin component 100
Installing the vibration plugin 101
Installing the webSockets plugin 101
Installing the Telerik SideDrawer plugin 101
Using third-party components 102
Using the vibration plugin 102
Using Websockets 102
Using Telerik's side drawer 108
Easily using the components 110
Useful third-party components 110
Summary 110
Chapter 6: Platform Differences 111
Android and iOS differences 111
The soft keyboard 112
The Page.loaded event 112
Code differences 113
Platform classes 114
Declarative UI 115
Declarative UI properties 116
Declarative UI platform qualifiers 116
Platform- and device-specific files 117

[ iv ]
Table of Contents

Screen size differences 117


Fonts 118
Our own custom resource folders 118
Compiled application resources on iOS 119
Compiled application resources on Android 121
Device differences 123
Summary 124
Chapter 7: Testing and Deploying Your App 125
Testing your application 126
Test frameworks 126
Local testing of your code 128
Unit testing on the device 131
Installing the test framework 132
Writing tests 132
Running tests 133
Testing your app on a device or emulator 134
Understanding the call stack 136
Android call stack 136
iOS call stack 138
Debugging your application 139
Publishing your application 140
Publishing to iOS 141
Summary 141
Index 143

[v]
Preface
Welcome to Getting Started with NativeScript. In this book, we are going to go on
an awesome journey of building cross-platform applications in JavaScript. We will
cover everything from how NativeScript works, to how to test, debug, and finally
deploy your application. Over the course of this book, we are going to explore how
to build a full-featured, cross-platform messaging platform. The application will
work the same on all NativeScript-supported platforms. With your ability to develop
in JavaScript and the insights provided in this book, you will be releasing your own
cool applications in no time.

What this book covers


Chapter 1, Introduction to NativeScript, will teach you about NativeScript and how to
install and build your first NativeScript application.

Chapter 2, The Project Structure, provides an overview of what all the different files
and folders are used for, and we will build and switch to a second screen for our
application here.

Chapter 3, Declarative UI, Styling, and Events, works through how to create screens
using the Declarative UI, style them and then how to create and respond to events.

Chapter 4, Building a Featured Application, helps you to actually sit down and
build a full-featured, cross-device messaging application using just the standard
NativeScript components.

Chapter 5, Installing Third-Party Components, delves into how to install several


different types of third-party components to enhance our cool communication
application.

[ vii ]
Preface

Chapter 6, Platform Differences, looks at how to deal with the differences between iOS
and Android and the differences in the actual physical characteristics of the devices
even on the same platform.

Chapter 7, Testing and Deploying Your App, looks at how to use several different types
of testing frameworks, how to debug your application, and finally, how to actually
deploy your application.

What you need for this book


NativeScript is an open source project; as such, it uses technologies that can be freely
downloaded from the Internet. You need to download and install a recent version
of Node from http://nodejs.org. You also need a text editor so that you can edit
your source code. If you are developing for Android, you need to download and
install Java 7, Gradle 2.3, and the Android SDK. For iOS, you need to install Xcode
6.2 or a later version.

Who this book is for


If you are already a JavaScript developer and you want to finally build native
cross-platform applications for iOS and Android using your skills, then this book
is just for you!

Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and an
explanation of their meaning.

Code words in text are shown as follows: "which a require statement would load
into your code."

A block of code is set as follows:


{
"name": "tns-template-hello-world",
"main": "app.js",
"version": "1.5.0",
... more json documentation fields...
}

[ viii ]
Preface

When we wish to draw your attention to a particular part of a code block, the
relevant lines or items are set in bold:
{
"nativescript": {
"id": "org.nativescript.crossCommunicator",
"tns-android": {
"version": "1.5.0"
},

Any command-line input is written as follows:


nativescript run ios --emulator

New terms and important words are shown in bold or italics. Words that you see
on the screen, in menus or dialog boxes for example, appear in the text like this:
"You can probably guess that the Label will still say Tap the button."

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or may have disliked. Reader feedback is important for
us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to [email protected],


and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.

[ ix ]
Preface

Downloading the example code


You can download the example code files for all Packt books you have purchased
from your account at http://www.packtpub.com. If you purchased this book
elsewhere, you can visit http://www.packtpub.com/support and register to have
the files e-mailed directly to you.

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books—maybe a mistake in the text or the
code—we would be grateful if you would report this to us. By doing so, you can save
other readers from frustration and help us improve subsequent versions of this book.
If you find any errata, please report them by visiting http://www.packtpub.com/
submit-errata, selecting your book, clicking on the errata submission form link,
and entering the details of your errata. Once your errata are verified, your submission
will be accepted and the errata will be uploaded on our website, or added to any list
of existing errata, under the Errata section of that title. Any existing errata can be
viewed by selecting your title from http://www.packtpub.com/support.

Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media.
At Packt, we take the protection of our copyright and licenses very seriously. If you
come across any illegal copies of our works, in any form, on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated


material.

We appreciate your help in protecting our authors, and our ability to bring you
valuable content.

Questions
You can contact us at [email protected] if you are having a problem with
any aspect of the book, and we will do our best to address it.

[x]
Introduction to NativeScript
In this chapter, we are going to introduce you to Telerik's NativeScript, and discuss
how NativeScript is totally unique in the cross-platform mobile device market, and
how it is radically revolutionary for mobile JavaScript development. We will also
walk you through the prerequisites of how to install the NativeScript command-
line tool. Once the NativeScript tool is installed, we will walk you through the basic
usage of the tool and briefly describe the most common parameters. Finally, we wrap
up the chapter by creating and running our first NativeScript application.

In this chapter, we will be covering the following topics:

• What is NativeScript?
• NativeScript and TypeScript
• Common modules
• Installing NativeScript
• The NativeScript command line
• Creating your first application

NativeScript
If you are looking at this book, maybe you want to know why you should use
NativeScript and what sets it apart from the crowded competition. Why shouldn't
you use any of the other cross-platform tools? Let us dig in, and I'll explain why
NativeScript is the answer to the best way of executing cross-platform mobile
development.

[1]
Introduction to NativeScript

Telerik's NativeScript
Telerik's NativeScript is a fairly new open source development system for creating
cross-platform mobile applications almost entirely in JavaScript, with some optional
CSS and XML to simplify developing the display layout. You can find the main
location of each of the different projects that make up NativeScript at https://
github.com/NativeScript. Even though it is new to the market, it is already fully
compatible on Apple's iOS and Google's Android. In addition, Microsoft's Windows
10 Mobile is currently in development by Telerik, and others are working on Firefox
Mobile. NativeScript uses the V8 engine (as used by Google Chrome and node.js) on
Android and Apple's JavaScriptCore engine on iOS devices.

Other competitors
Now, there are several other competing JavaScript development systems for
mobile devices. Some of these competitors have been established for a while. Other
development systems may have large companies working on them. But neither of
those will make any of the other tools the best choice. What makes NativeScript
stand out from the crowd of other JavaScript environments is its unique design.
Every other JavaScript environment requires a special bridge, or a compiled
extension of some sort, which basically exposes some part of the native functionality
of the host operating system to your JavaScript code. A lot of them are actually just
web browsers wrapped in an application shell, so all the work you do is actually in
a browser. If you decide you want Bluetooth on your iOS phone in one of the other
products, you have to find someone who has made the iOS Bluetooth bridge or
extension module in some other non-JavaScript language. In a lot of cases, you will
even have to compile the module, and then you will still be hoping that the module
has all the functionality you need.

NativeScript uniqueness
NativeScript is unique because it allows you to access the native elements of the host
platform via JavaScript. In NativeScript, you can still see if someone has written a
convenient JavaScript library to access the Bluetooth API. If so, since you understand
JavaScript, you can easily make any changes you need. If not, then you can make
your own JavaScript module to access all the host platforms of Bluetooth API.
NativeScript is not a wrapper around a web view; it literally allows your JavaScript
to work directly with the host platform APIs.

[2]
Chapter 1

For example, to find out if a file exists, we can just call the native Android method in
JavaScript:
var javaFile = new java.io.File('/some/file/name.ext');
var exists = javaFile.exists();

Or the native iOS Objective C code in JavaScript:


var fileManager = NSFileManager.defaultManager();
var exists = fileManager.fileExistsAtPath('/some/file/name.ext');

Since NativeScript allows you access to the full operating system libraries and third-
party libraries from your JavaScript code, you do not need to wait for someone else
to create a wrapper or bridge to talk to any part of any iOS or Android API. You can
now fully use any of the APIs as a first-class citizen, which even includes using any
new APIs when they are first released.

NativeScript allows you to be a fully first-class citizen; you have FULL


access to the devices' entire released API from JavaScript. So anything
that you can do in Android Java or iOS Objective C, you can now do
directly in JavaScript.

NativeScript is easy
Now, before you get worried about having to know both iOS and Android to make
your application, NativeScript has that covered. To simplify things, NativeScript
already has a wide number of components, or modules, that wrap the most common
things a developer will need, which are called the NativeScript common core
modules. So, instead of having to write any Android or iOS specific code like I did
above to see if a file exists, you can just write the following code:
var fs = require('file-system');
var exists = fs.File.exists(path);

The NativeScript filesystem module has each of the native platforms' API wrapped
up so all you have to do is write to a common interface. But when you need to do
something outside of the built-in modules and components, NativeScript is the only
environment that allows you to easily have full access to everything the device offers
right from JavaScript.

[3]
Introduction to NativeScript

NativeScript and TypeScript


We are going to explain how parts of NativeScript are developed in TypeScript and
what that means for you in terms of developing your awesome application using
NativeScript.

What is TypeScript?
In 2012, Microsoft released an interesting language called TypeScript. This language
is fully open sourced because the company felt it was something the JavaScript
community needed. It is, in a nutshell, a superset of JavaScript with types and
several other additional language features. If you write any code in TypeScript,
you then have to use the TypeScript transpiler to convert the code from TypeScript
back into JavaScript. One of the primary reasons people use TypeScript over regular
JavaScript is that TypeScript offers the ability to do static type checking at the point it
converts the code to JavaScript. So, you don't have a runtime hit, and you don't have
to do a lot of runtime parameter checks if the code is all in TypeScript. This feature
alone eliminates a type of bug that is very easy to access in JavaScript. In addition to
static typing, it has several class/object type features that make inheritance and class
definition considerably simpler and safer.

Types possess the ability to add markup to code denoting the type
expected:
private validateMe(name: string, password: string):
boolean { };
The string and boolean are declarations telling what the exact
parameter types and expected return type are. This allows the transpiler
to verify that the code matches the static types during the building stage.
Transpiler is a shortened term from translation compiler used to mean the
code is converted from one language to another language. So, in this case,
we are translating the code from TypeScript into JavaScript.

TypeScript's use in NativeScript


The NativeScript command-line utility, common modules, and components are
all written in TypeScript. TypeScript is then transpiled to JavaScript before it is
distributed for all us developers to download, install, and use. So, unless you are
actually pulling the open source code from the NativeScript repositories, then all the
code you will see is in JavaScript.

[4]
Chapter 1

Fortunately for us, the majority of the differences between TypeScript and JavaScript
are fairly minor, so the code transpiled to JavaScript in almost all cases is very close
to the original TypeScript, which still makes it very readable.

Telerik just released a brand new module in v1.5.0 that will allow
TypeScript to now be a first-class citizen in the development of
your application. If you don't use this module, then you have to
manually transpile all your TypeScript code each time before you
build an application. After you execute a nativescript install
typescript command, when the NativeScript command does anything
with your code, it will automatically transpile all your TypeScript code
first. This makes your development a much more streamlined process.

Choosing a development language


Since the final output of all the code must be JavaScript, you are able to write any of
your applications or modules in TypeScript, CoffeeScript, or any other language that
can be transpiled into JavaScript. This book is going to focus on doing everything in
JavaScript as this is what the final code output must be for all the devices, and it is
the common language that binds everything together.

Common modules
Common modules were created to solve the issue of JavaScript files polluting the
global namespace with variables and functions that another JavaScript file could
easily overwrite accidently. JavaScript allows you to redeclare or monkey patch
your functions on a whim, which is part of what makes it so powerful. However,
with that much power comes the ability to very easily shoot yourself in both feet
simultaneously. Then, you are left scratching your head why you just lost both
feet. To attempt to solve the issue of one included file function or variable being
overwritten by another include file, developers came up with several techniques that
evolved into the common module formats we use today. There are three standards
available for you to use: the CommonJS module format, which is what node.js
popularized; the AMD module format, which was designed for the asynchronous
resolution of JavaScript files in a browser environment; and the brand new
ECMAscript 6 module format, which, when finally released, should become the de
facto module format. All three of them wrap the source code so that none of the code
in a module by default can interfere with the global namespace. NativeScript follows
the CommonJS module format where you use exports and module.exports to tell
what parts of the code in the module you want to expose to outside parties. When
you see var coolModule = require('cool-module');, this is the syntax that the
CommonJS module format uses to load a module.

[5]
Introduction to NativeScript

Installing NativeScript
We are going to cover what you'll need for installation and development. Then,
we will discuss how to install the NativeScript command, which you will use for
anything relating to your NativeScript project.

Prerequisites
To get started on our journey of using NativeScript, we first must have several tools
installed. The primary tool you will use for virtually everything is the nativescript
command, or you can alternatively use the shorter alias of tns (short for Telerik
NativeScript).

node.js
For the nativescript command to be installed and to make it work, you must first
install node.js, which can be downloaded and installed from https://nodejs.
org/. The nativescript command is also written in TypeScript and already pre-
converted to JavaScript before you even download it. It uses node.js and several
other common modules to perform all its work.

iOS
If you are planning on distributing your app on any iOS devices, you will need to
have access to an Apple Macintosh platform. This is a requirement by Apple as they
only allow you to compile and upload the app to the app store from a Macintosh.
The Macintosh must have the Xcode and Xcode command-line tools installed. It is
also highly recommended that you have an iPhone 4s or better to test at least the
final application before you distribute it. The iOS emulator is not very accurate
and because it gives you an idea of how your app will look, an actual device will
accurately show you what your customers will see. The specific install instructions
for iOS can be found at http://docs.nativescript.org/setup/ns-cli-setup/
ns-setup-os-x.html.

[6]
Discovering Diverse Content Through
Random Scribd Documents
Another faulty position is one which may be termed "the dead
weight seat," which is only possible when riding on an English
saddle. It consists in sitting or bearing chiefly upon the left side of
the saddle, the right leg firmly grasping the second pommel, and the
left leg squeezed tightly between the stirrup and the third pommel,
as if held in a vise. In this position the rider will be fastened to her
horse as closely as if she were a package of merchandise strapped
upon the back of a pack-horse. She will appear indolent and
inanimate, besides riding heavily, and thus distressing and
discouraging her horse; for a well-trained horse will always prefer to
keep in unison with the movements of his rider, but will find it
impossible to do so, when she adopts this constrained, unyielding
seat. The rider will also be made miserable, for the constant effort to
keep steady by a continuous pressure of the left knee against the
third pommel will not only prove wearisome, but will be apt to bruise
her knee, as well as strain the muscles of the upper part of the leg,
and the next day she will feel very stiff and lame. In addition to
which it will be impossible for her to rise in the English trot, or to
move her body to the right in the gallop or canter when the horse
leads with his left leg. Moreover, should the lady who thus hangs
upon the pommel be rather heavy, her horse's back will be sure to
receive more or less injury, no matter how well the saddle may be
made and padded.

Although the second pommel should be firmly grasped by the right


knee, and the left knee be strongly pressed up against the third one,
when the horse is unruly or trying to unseat his rider, these supports
should not be habitually employed, but kept for critical situations,
and even then the body must be kept erect, yet flexible. A rider who
depends entirely upon the pommels to enable her to keep her seat is
a bad rider, who will soon acquire all kinds of awkward and ridiculous
positions, and expose herself to much severe criticism.

The opposite of the "dead-weight seat" is what may be termed the


"wabbling seat." This is seen where the old-fashioned saddle is
used; the rider, instead of sitting firm and erect, bounds up and
down like a rubber ball tossed by an unseen hand. This can be
remedied by the substitution of the English saddle, whose third
pommel, when used judiciously and aided by a proper balance of the
body, will give the required firmness of seat, which should be neither
too rigid nor too yielding.

Fig. 19.—Correct Seat for a Lady.


Back View.
The correct seat, universally adopted by finished riders, is the
following: The lady should seat herself exactly on the centre of the
saddle, with her body erect, and her backbone in a direct line with
that of the horse, at a right angle with it. A spectator can readily tell
whether the rider is in the centre of the saddle by observing whether
the space between the buttons on the hind flaps of her riding-jacket
corresponds with the backbone of the horse, and also with the
chamber of the saddle. (Fig. 19.) Or the lady can herself decide the
question by placing her fingers between these two buttons, and then
carrying the former in a straight line directly down to the chamber of
the saddle; if these coincide, and if she has placed herself far
enough back on the saddle to be able to grasp the second pommel
comfortably with her right knee, while the left one is just spanned by
the third pommel, then she is in a position to ride with ease to
herself and horse, for she now sits upon that part of the animal
which is the centre of motion in his forward movement, and in this
position can keep in unison with the cadence of his various gaits.
Again, her weight being exactly upon the centre of motion, she can
with difficulty be unseated or shaken off by the most violent efforts
of the horse, for, whether he springs suddenly forward, or sideways,
or whirls around, the rider is in a position at once to anticipate his
movement, to keep a firm seat, and quickly to gain her balance.

When the horse advances straight forward, the rider—sitting with


head erect and her body so placed that its entire front is directed
toward the horse's head, or, in other words, that a straight line
drawn from one hip to the other would form a right angle with one
drawn along the centre of the horse's head and neck—must throw
her shoulders somewhat back, so as to expand her chest, taking
care, however, to keep the shoulders in line, and not to elevate one
more than the other. There should also be, at the back of the waist,
a slight inward bend which will throw the front of the waist a little
forward. The arms, from the shoulders to the elbows, must hang
perpendicularly, and the elbows be held loosely but steadily and in
an easy manner, near the rider's sides, and not be allowed to flap up
and down with every movement. The hands must be held low and
about three or four inches from the body. The bearing of the head,
the backward throw of the shoulders, and the curve at the waist, are
exactly like those assumed by a finished waltzer, and if the reader is
herself a dancer, or will notice the carriage of a good dancer gliding
around the ball-room, she can readily understand the attitude
required for a correct seat in the saddle.

The right knee should grasp the second pommel firmly, but not hang
upon it in order to help the rider keep her seat and balance. The
right leg, from the hip to the knee, must be kept as steady as
possible, because from a woman's position in the saddle, the
movements of her horse tend to throw her toward his left side, and
she must guard against this by bearing slightly toward his right.
From the knee to the foot, the right leg must be in contact with the
fore-flap of the saddle, the heel being inclined backward a little.

The left knee should be placed just below the third pommel, so that
this will span it lightly, close enough to assist in preserving a firm
seat, yet not so close as to interfere with the action of the leg in the
English trot. From the knee to the foot this left leg must be held in a
straight line perpendicular to the ground, and the knee be lightly
pressed against the side-flap of the saddle. The ball of the foot must
be placed evenly in the stirrup, the heel being a little lower than the
toes, which should be pointed toward the shoulder of the horse.
(Fig. 20.)
Fig. 20.—Correct seat for a lady. Side view.
1, third pommel; 2, second pommel.
View larger image.

If the rider will seat herself in the saddle in the manner just
described, she will find that she has a very firm seat, from which she
cannot easily be displaced; but in order to appear graceful she must
be flexible, and adapt herself readily to the motions of her horse.
The shoulders, for example, although thrown back, must not be
rigid, and the body, while erect, must be supple; the head be upright
and free, and, in the leap, or when circling in the gallop, the body
must be pliant, yielding and bending with the movements of the
horse, but always resuming afterward the easy erect position. But it
must be borne in mind that the above directions in regard to
carriage apply to the times when the horse is moving, and need not
be observed in full rigor at other times. When, for instance, the
horse is standing, the rider may assume a more easy posture,
collecting herself and steed simultaneously when she wishes him to
move.

The novice in riding should never be allowed to touch rein or whip


until she has acquired a good seat, and a correct balance. During
her first lessons, some one should ride by her side and lead her
horse, while she, folding her hands in front of her waist, should give
all her attention to gaining a correct seat; or, she may practice
circling to the right by means of the lunge line, which will prove
excellent training, and will teach her to bear toward the off or right
side, for it has already been stated that the motion in the side-
saddle has a tendency to impel the rider toward the left, and this
tendency must always be guarded against by bearing the body a
little to the right. Circling to the right, when riding in the track of the
riding-school, is also a useful exercise for this purpose, but as riding-
schools are not always to be had conveniently, the lunge line will be
found very useful, many riders, indeed, considering it even better
than riding in the ring, as it keeps the horse well up to his gait.

During a few of the first lessons, that the rider may not fall from the
saddle, the stirrup-leather may be somewhat shortened, but as soon
as an idea of the proper balance has been acquired and the reins
and whip are placed in her hands, the stirrup must be lengthened,
as this secures a firmer and more easy seat. This leather will be of
the correct length when, by a little pressure on it with her foot, and
a simultaneous straightening of her knee, the rider can spring
upward about four or five inches from the saddle; but it must never
be so long as to render the third pommel nearly, if not quite,
useless.

It is better to have the first lessons in riding rather short, so that the
pupil may become gradually accustomed to the exercise. As soon as
she begins to feel at all fatigued, she should at once dismount, and
not try to ride again until the tired feeling is wholly gone. These
intervals of fatigue will gradually become less and less frequent, until
at last the rider will find herself so strong and vigorous that riding
will no longer require any fatiguing effort. In the case of an active,
healthy woman, accustomed to exercise of various kinds, these short
preliminary lessons may not be necessary; her muscles will be
already so well developed that she will not be easily fatigued by
exercise of any kind. But for a lady who has always been physically
inactive, these short lessons at first are absolutely necessary. The
general system of such a person has become enfeebled, her muscles
are weak and flabby, and any sudden or long continued exercise
would tend to produce very injurious results, so that riding, unless
begun very gradually, would probably do her more harm than good.

But after reading all the directions just given about riding, the reader
may ask what need there is of so much study and circumspection to
enable a woman to mount a horse and ride him, when hundreds of
ladies ride every day, and enjoy doing so, without knowing anything
about the make of the saddle, or the position they ought to take
when seated in it.

Although it seems almost a pity to disturb the serenity and self-


complacency of ignorance, we shall be obliged, in justice to those
who really wish to understand the principles of good
horsewomanship, to point out some of the mistakes of those who
think that riding is an accomplishment which can be acquired
without instruction and study.

It is not too sweeping an assertion to state that, of one hundred


ladies who attempt a display of what they consider their excellent
horsewomanship in our streets and parks, ninety-five are very
imperfect riders; and the five who do ride well have only learned to
do so by means of careful study and competent instruction. They
have fully appreciated the fact that nature never ushered them into
the world finished riders, any more than accomplished grammarians
or Latin scholars, and that although one may possess a natural
aptitude for an accomplishment, application, study, and practice are
positively necessary to enable her to attain any degree of perfection
in it. Yet the idea unfortunately prevails very largely in this country
that women require very little instruction to become good riders, and
the results of this belief are apparent in the ninety-five faulty riders
already referred to.

Let us now watch some of the fair Americans whom the first balmy
day of spring has tempted out for a horseback ride, and notice the
faulty positions in which they have contrived to seat themselves in
their saddles. With regard to their beauty, elegance of form, and
style of dress, nothing more could be desired; but, alas! the same
cannot be said of their manner of riding.
Fig. 21.—Crooked Position in Saddle.
Miss X.

Take Miss X. and Mrs. Y., for examples. These ladies have the
reputation of being fine and fearless horsewomen, and certainly do
ride with that dash and confidence which long practice in the saddle
is sure to give, but we regret to say that we can bestow no further
praise upon them. Miss X. has taken a position that is almost
universal with American horsewomen, and is exactly the one which a
rider nearly always assumes when seated sideways on a horse
without a saddle. Instead of sitting squarely, with the entire front of
her body facing in the direction toward which the horse is going, she
sits crosswise. It will be seen by looking at Fig. 21, that the central
vertical line of her back, instead of being directly in the centre of the
saddle, is placed toward the right corner of it, and that her shoulders
are out of line, the left one being thrown back, and the right one
advanced forward. This position makes it impossible for her to keep
in unison with her horse when he is moving straight forward at an
easy pace. When he changes his gait to a canter the rider will, for a
short distance, appear to be more in harmony with him, because he
is now turning himself slightly to the left and leading with his right
fore-leg, a position which is more in unison with that of his rider.
But, after a short time, the horse gets tired of this canter, turns to
the right, and leads with his left fore-leg. This change entirely
destroys the apparent harmony which had before existed between
the two.

The lady, knowing nothing about the position of a horse when


galloping or cantering, is ignorant of the fact that he always turns a
little to the right or left according to the leg with which he leads, and
that she ought to place her body in a corresponding position. She
has but one position in the saddle,—the crooked one already
described,—and this she maintains immovably through all the
changes of her horse's gaits.
Fig. 22.—Crooked Position in Saddle.
Mrs. Y.

Let us now turn to Mrs. Y., who is even a more faulty rider than her
companion. She has likewise taken a crosswise position in the
saddle; but having given a peculiar twist to her body so that, by
turning her right shoulder backward, she can look to the right, she
seems to imagine that by these means she has placed herself
squarely upon the saddle. (Fig. 22.) As she is riding a racking horse
and seated on a two-pommeled saddle, she holds the reins firmly in
her left hand and by a steady pull on them she balances herself and
keeps her horse up to his gait. But this steady pull will soon ruin the
tenderness and sensitiveness of any horse's mouth, and this is the
reason why racking horses generally have very hard mouths, many
of them requiring to be well held up or supported in their rack by the
reins. As this pulling upon the reins also gives considerable support
to the rider, many ladies prefer a racking horse. Now notice Mrs. Y.,
who is attempting to turn her hard-mouthed racker. Instead of doing
this by an almost imperceptible movement of the hand, her left hand
and arm can be distinctly seen to move, and to fairly pull the animal
around. Her right hand—probably acting in sympathy with the left,
so tightly clasped over the reins—holds the whip as if it were in a
vise intended to crush it. In odd contrast with the rigidly held hands
is the body with its utter lack of firmness.

It can be seen at a glance why the lady will only ride an easy racker,
for it is well known that on a good racker or pacer the body of a
rider in a faulty position is not jolted so much as in other gaits. For
this reason also the rack and pace are the favorite gaits of most
American horsewomen.

Nearly every lady who rides has an ambition to be considered a


finished horsewoman, but this she can never be until she is able to
ride properly the trot and gallop, can keep herself in unison with her
horse, whether he leads with the left or right fore-leg, and has
hands that will "give and take" with the horse's movements and
bring him up to his best gait. From this point of view, Miss X. and
Mrs. Y., then, are by no means the "splendid riders" that their friends
suppose them, but having all the confidence of ignorance they ride
fast and boldly and with a certain abandon that is pleasing; but by
those who understand what good riding is, they must always be
regarded as very faulty riders.
Fig. 23.—Incorrect position of legs and feet.
Side view.

Another common fault, against which we have already warned the


reader, is that of riding with too short a stirrup-leather, thus pressing
the left knee up against the third pommel, carrying the left heel
backward and slightly upward, and dropping the toes of the left foot
more or less down toward the ground, while those of the right are
raised and pointed toward the horse's head. (Fig. 23.) Although the
lower limbs are concealed by the skirt, it can easily be told whether
they are in the position just described, from the effect produced
upon the upper part of the body, which then leans too far forward
and too much to the right (Fig. 24); while the rider, in her efforts to
balance herself, inclines her shoulders to the left. This is a very
awkward as well as a very dangerous attitude, because, by thrusting
her leg backwards, the action of spurring is imitated, and, if the
horse is very high-spirited, this may cause him to become restive, or
even to run away. Should the leg, moreover, as is very apt to be the
case, be firmly and steadily pressed against the animal's side, he
may suddenly pirouette or turn around to the right, especially if he
has been accustomed to carrying gentlemen as well as ladies. This
short stirrup-leather and improper use of the third pommel should
be carefully avoided.

Fig. 24.—Incorrect Position when Legs and Feet are wrongly placed.

The use of too long a stirrup-leather is apt to be the mistake of


those who ride upon the old-fashioned saddle, but is a fault which
has become much less common since the English saddle has been
more generally used. The objection to too long a stirrup-leather is
that, when the foot is pressed upon it, the leg at the same time is
straightened, and extends down so far as to cause the rider to sit
too much to the left of the saddle. As the pressure and weight are
thus thrown wholly upon the left side, the saddle is very likely to
turn, and if this faulty position be persisted in, it will be certain to
injure the horse's back and may give rise to fistulous withers.

Besides looking very awkward and inelegant, when stooping forward


in the saddle and rounding the back without the slightest curve
inwardly, the rider will also run great risk, if her horse stumbles or
makes any sudden movement, of being unseated, or at least thrown
violently against the front of the saddle, as it is almost impossible for
her, under such circumstances, to adapt herself to the change in his
motion quickly enough to preserve her equilibrium. In all violent
movements of the horse, except rearing, the body must be inclined
backward, so as to keep the balance. When he is moving briskly in
his ordinary gaits, the body must be kept erect; and when he is
turning a corner rapidly, it should be inclined backward somewhat,
and toward the inner bend of the horse's body; or, in other words,
toward the centre of the circle, of which the turn forms a segment.

Here come two ladies who have evidently received very limited
instructions in the art of riding. Notice how the head of one is thrust
forward, while the other, though holding her head erect allows it to
be jerked about with every motion of her horse. It shakes slowly
when the animal is walking, but as he quickens his pace to a canter,
it rocks with his motion, and, during his fast pace, the poor head
moves so rapidly as to make one fear that the neck may become
dislocated, while the arms dance about simultaneously with the
movements of the head in a way that reminds one of the toy
dancing-jacks, pulled by an unseen hand for the amusement of
children. The head should, in riding, be kept firm and erect, without
stiffness, the chin being drawn in slightly, and not protruding high in
the air, because the latter gives one a supercilious look. The head
and shoulders should adapt themselves, in their direction, to the
movements of the head and fore-legs of the horse, and the arms
should be held as steady as possible.

But here come several ladies who have taken lessons at the riding-
school and may, therefore, reasonably be expected to be finished
riders; but such, alas! is not the case. They have been trying "to
walk before they could creep," or, in other words, their lessons in
riding have been conducted too hastily. They have begun to try a
canter or a rapid gallop before they knew how to sit correctly upon
their horses, or even to manage them properly in a walk. This desire
to make too rapid progress is more frequently the fault of the pupil
than of the riding teacher. Most teachers have an ambition to make
finished riders of their pupils, and take much pride in doing so,
especially as such a result adds greatly to the prestige of their
school. This ambition is often defeated, however, by the impatience
of the pupils, who are not satisfied to learn slowly and well, but
overrule the teacher's objections and undertake to gallop before
they have acquired even the first principles of horsewomanship.
Moreover, many of these ladies never take any road lessons, so
highly important to all who would become thoroughly accomplished
in this art; nor do they remain long enough under instruction in the
school, but seem to think that a few short lessons are enough to
make them finished riders. They often refuse to learn the English
trot, although this is a very important accomplishment for the
beginner, as it enables her to gain a correct idea of the balance. Or,
if they do attempt to learn it, they insist upon circling only to the
right, as this is easier than going the other way.
Again, many pupils will insist upon riding the same favorite horse,
instead of leaving the selection to the judgment of the teacher, who
is well aware that it is much better for the lady's progress that she
should ride a variety of horses with different gaits. He is often driven
to his wit's end when two or three ladies who patronize his school,
and whom it is an honor to have as pupils, express a desire to ride
the same horse on the same occasion. Should he favor one more
than the others, the latter will become highly offended, and the poor
man in his perplexity is often obliged to resort to some subterfuge to
pacify them.

It is not difficult, then, to understand why some ladies, although


they have taken lessons at a riding-school, are, nevertheless, not
finished riders, their faults being due, not to the instruction but to
their own lack of judgment or inattention. It is true that occasionally
the teacher, although he may be an excellent instructor for
gentlemen, is not so good a one for ladies, or he may become
careless, believing that if he gives them well-trained horses to ride
very little else is required of him. Or, again, he may think, as many
foreigners do, that very few American ladies know how a woman
should ride, and are satisfied with being half taught.

It cannot be too strongly impressed upon riding teachers that in


every riding-school where ladies are to be taught there should be at
least one lady assistant. A gentleman can give all the necessary
instructions about the management of the horse and the handling of
the reins better than most ladies; but, in giving the idea of a correct
seat and the proper disposal of the limbs, the presence of a lady
assistant becomes necessary; in these matters she can instruct her
own sex much better than a man can.
CHAPTER VI.
TO HOLD THE REINS, AND MANAGE THE HORSE.

"What a wild thought of triumph, that this girlish hand


Such a steed in the might of his strength may command!
What a glorious creature! Ah! glance at him now,
As I check him awhile on this green hillock's brow;
How he tosses his mane, with a shrill, joyous neigh,
And paws the firm earth in his proud, stately play!"
Grace Greenwood.

The position of the rider in the saddle has a decided influence upon
the horse's mouth, rendering his movements regular or irregular,
according to the correctness and firmness of the seat; for, if the rider
be unsteady or vacillating in the saddle, this will exert an influence
upon the hand, rendering it correspondingly unstable, and will
thereby cause the horse's movements to be variable. And should she
endeavor to remedy this unsteadiness of hand and seat by
supporting herself upon the reins, the horse will defend himself
against such rigid traction by making counter-traction upon the
reins, thrusting his head forward, throwing himself heavily upon his
fore-legs, thus forcing the hands of the rider, and compelling her to
support the weight of his neck and shoulders. On the contrary, if she
be firm in her seat, and not in the least dependent upon the reins,
her hand will be light, and the animal will yield a ready obedience
and advance in his best pace. The preceding remarks explain why a
horse will go lightly with one rider and heavily with another.
A lady should have a thorough knowledge of the management of her
horse, and of the means by which she may command him in every
degree of speed, and under all circumstances; without this
knowledge she can never become a safe and accomplished
horsewoman. A gentleman may guide and control his horse, and
obtain obedience from a restive one, by a firm, strong hand, and by
his courage and determined will; but as a rule, a lady cannot depend
upon these methods; she will have to rely entirely upon the
thorough training of her horse, a properly arranged bit, her firm, yet
delicate touch, and her skill in handling the reins. The well-trained
hand of a woman is always energetic enough to obtain the mastery
of her horse, without having to resort to feats of strength and
acrobatic movements; and a lady should never seek to gain prestige
by riding restless or vicious horses, in order that she may display her
skill in conquering them; though every rider should be thoroughly
taught how to control her steed in cases of emergency.

When one sees how little skill most lady riders exhibit in managing
the reins, it seems almost miraculous that so few accidents occur to
them, and is indeed a positive proof of the excellent temper of their
horses. From some mysterious cause, most horses will bear more
awkwardness and absurdity in the handling of the reins by a woman
than by a man, and will good-naturedly submit to the indifferent
riding of the gentle being in the side-saddle, while the same
character of riding and treatment from a man would arouse every
feeling of defense and rebellion. The probable cause of this
difference of action on the part of the horse is, that a lady rider, with
all her ignorance of seat and rein, will talk kindly to and pet her
steed, and will rarely lose her temper, no matter in what
eccentricities he may indulge, and her gentleness causes the animal
to remain gentle.
On the contrary, when a man throws his weight upon the reins,
jerking and pulling upon them, his horse, seeking to defend himself
against such rough measures, arouses the temper of his rider, and
this anger is soon communicated to the animal, which then becomes
obstinate and rebellious; moreover, a man will often whip and spur
for some trivial offense in instances where a woman would simply
speak to her horse, or take no notice. Hence, the ignorant
horsewoman often rides in safety under circumstances in which the
ignorant horseman, who has resorted to violent measures, meets
with an accident.

Although a horse may submit to an awkward rider and carry her with
safety, still she will have no power to make him move in his best and
most regular manner, and there will exist no intelligence or harmony
between the two. Yet this same horse, when mounted by a lady who
understands the management of the reins, will be all animation
and happiness. There will soon be established a tacit understanding
between the two, and the graceful curvetings and prancings of the
steed will manifest his pride and joy in carrying and obeying a gentle
woman, who manages the reins with spirit and resolution, and yet
does not, with the cruelty of ignorance or indifference, convert them
into instruments of torture.

The reins should not be employed until a firm, steady position upon
the saddle has been acquired, and then, for first lessons, the snaffle
only should be used, a rein in each hand. It will be better to have
the reins marked at equal distances from the bit, either by sewing
colored thread across each, or otherwise; this will be useful because,
with the novice, the reins will imperceptibly slip through her hands,
or one rein will become longer than the other, and the markings will
enable her to notice these displacements, and promptly to remedy
them. By holding the snaffle-reins separately, in first lessons, the
pupil will be aided in assuming a square position upon the saddle,
and will likewise be prevented from throwing back her right shoulder,
out of line with the left, a common fault with beginners, especially
when the reins are held only in the left hand. This rein-hold is very
simple; the right rein of the snaffle must be held in the right hand,
and the left rein in the left.

Fig. 25.—Snaffle-reins; one in each hand.

The hands being closed, but not too tightly, must be held with their
backs toward the horse's head, and each rein, as it ascends from the
bit, must be passed between the third and fourth fingers of its
appropriate hand, carried across the inner surface of the third,
second, and first fingers, and then be drawn over the outside (or
side next to the thumb) of the first finger, against which it must be
held by firm pressure of the thumb. The thumbs must be held
opposite each other and uppermost, the finger-nails toward the
body, and the back of the wrists must be rounded a little outwardly,
so as to make a slight bend of the closed hand toward the body. The
little fingers must be held down and nearly in a horizontal line with
the tips of the elbows; and the hands be kept as low as possible,
without resting upon the knees, and be about four inches distant
from the body, and from four to six inches apart. (Fig. 25.)

This arrangement of hands and reins may be termed the "original


position" when a snaffle-rein is held in each hand, of which all the
others are variations. In this position,—the reins being held just
short enough to feel the horse's mouth,—if the hands be now
slightly relaxed by turning the nails and thumbs toward the body, the
latter being, at the same time, inclined a little forward, the horse will
be enabled to advance freely, and, as soon as he moves onward,
the original position of the hands must be gently resumed. It is
proper to remark here, that when using the snaffle-reins only, the
curb-bit should always be in the horse's mouth, its reins being tied
and allowed to rest upon his neck, although the pupil must not be
allowed to meddle with it. The presence of the curb in the horse's
mouth, although not used, has a restraining influence, especially
with an animal accustomed to it.

To turn the horse to the right, the right rein must be shortened
so as to be felt at the right side of his mouth; to effect this, the little
finger of the right hand must, by a turn of the wrist, be moved in
toward the body and sufficiently toward the left, with the nails up
and the knuckles down, while, in order to aid the horse, the rider will
simultaneously turn her face and shoulders slightly to the right. The
animal having made the turn, the hand must gently return to the
original position, and the body again face to the front.

To turn the horse to the left, the left rein must be shortened, by
a turn of the left wrist, carrying the little finger of the left hand
toward the body and to the right, nails upward, etc., while the pupil
will slightly turn her face and shoulders to the left. The turn having
been effected, the original position must be resumed, the pupil, in all
these cases, taking great care that the markings on her reins are
even and in the correct position.

To stop the horse, both reins must be shortened evenly; this must
be accomplished by a turn of both wrists that will bring the little
fingers toward the body with the finger-nails uppermost, the body of
the pupil being, at the same time, slightly inclined backward. Now,
by bending the wrists to a still greater degree, and bringing the
hands in closer to the body, which must be inclined a little forward,
and nearly in contact with each other, thus throwing more strength
upon the reins, the horse will be compelled to back. To make him
move on again, the hands and body must resume the original
position, and the hands must be relaxed, etc., as stated above.

When the pupil becomes more advanced, and can command her
horse, in all his gaits, with the reins separate, one in each hand, she
will then be prepared for lessons in handling both reins with the
left hand only, still employing the snaffle, as her touch may not be
delicate enough for the curb.

Fig. 26.—Snaffle-reins; both in the left hand.

For this purpose, the reins being held for the time being in the right
hand, the left, having its back toward the horse's head, will seize
them as follows: its little finger must be passed directly between the
two reins, the left rein being on the outer side of this finger and the
right one on its right side, between it and the third finger. This done,
the reins must be drawn up nearly even to the marks upon them,4
so as just to feel the animal's mouth, noticing that these marks are
nearly on a line with each other, while that portion of the reins lying
within the hand must be carried across its palm to the index finger,
to a point between its first and second joints, against which point,
being placed evenly with one overlying the other, they are to be
firmly held by pressure of the thumb; the right hand may now quit
its hold upon the reins. (Fig. 26.)

The reins having been properly placed in the left hand according to
the directions just given, this hand, being closed, but not too tightly,
must be held at a distance of about three inches from the front part
of the waist, with the wrist slightly rounded, the nails toward the
body, the back of the hand toward the horse's head, and the little
finger down and a little nearer the body than the others. The under
surface of the bridle arm and hand, from the tip of the elbow to the
first joint of the little finger, should be held nearly in a horizontal
line. The elbow must be held somewhat close to the side but not in
contact with it, and should be kept steady. Care must be taken,
when the reins are held in the left hand, that the right shoulder be
not thrown back, nor the left one elevated, faulty positions common
to beginners when not otherwise instructed. The right arm should be
allowed to hang easily and steadily at the side, the whip being lightly
held in it, with its point downward. When the snaffle-reins are held
in the left hand as described, we may term this the "original
position," of which all the others are variations.
In order that the horse may move onward, the left hand, holding
the reins as just described, should be relaxed by turning the thumb
downward and toward the body until the back of the hand is up and
the finger-nails down; at the same time, the pupil should slightly
incline her body forward, being careful not to round the shoulders,—
aiding the movement by the voice, or, if necessary, by a gentle tap
of the whip. The horse having started onward, the original position
must be gently resumed.

In order to turn the horse to the right, the left wrist must be
turned so as to bring the nails down and the knuckles up,—the
thumb being toward the body,—at the same time carrying the little
finger slightly to the left, and drawing the reins a little upward. This
movement will effect the necessary shortening of the right rein,
without allowing any looseness of the left one. The turn having been
accomplished, the hand must resume the original position. It must
not be forgotten, that while making this turn the face and shoulders
must be turned somewhat to the right, or in the direction in which
the horse is moving.

To turn to the left, the bridle-hand being in the original position,


its wrist must be turned so as to carry the finger-nails up, and the
knuckles down, simultaneously moving the little finger toward the
right and pressing it against the left rein, both reins being drawn
slightly upward. This manœuvre shortens the left rein, without
relaxing the right. In this turn the movements of the horse should be
aided by the rider's face and shoulders being turned a little to the
left. The turn having been made, the original position must be
resumed.

The horse may be stopped by simply turning the wrist so as to


carry the finger-nails up, the knuckles down, and the little finger
toward the body, which must be slightly inclined backward. Now, by
bracing the muscles of the hand, bending the wrist and carrying the
hand farther in toward the waist, at the same time advancing the
body, the animal will be made to back; though, in backing a horse,
it will be better to employ both hands. After having stopped, or
backed the horse, to make him move onward, a course should be
pursued, with both reins in the bridle-hand, similar to that described
for the same purpose when a rein is held in each hand.

To change the snaffle-reins from the left to the right hand,


as is sometimes necessary in order to adjust the skirt, to relieve the
left hand, etc., the following course must be pursued, whether the
horse be in rapid or slow motion: While the left hand must retain its
position and gentle pressure of the reins upon the horse's mouth,
the right must be carried to and over the left hand, its forefinger be
passed between the two reins, so that the left rein will be on the left
side of this finger, and the right on its right side, between the first
and second fingers; both reins must now be carried to the right,
across the palm, to the little finger; the hand must then be firmly
closed, and the thumb be pressed against the left rein, holding it in
contact with the index finger,—the left hand now gives up the reins.
In this change, while the right hand is being carried over to the left,
this latter must be held stationary, as any movement of it to meet
the right hand may cause the animal to turn or swerve from his
course, and will at the same time interfere with his gait.

To return the reins to the left hand, the following course must
be pursued: While the right hand must remain steady and sustain
the gait of the horse, the left must be carried to and over it, insert
its little finger between the two reins, so that the left one will be on
the left or outer side of this finger, and the right one on its right
side, between it and the third finger; then the reins must be drawn
through the left hand, and be arranged and held in this hand in the
same manner as explained when describing the original position of
both snaffle-reins in the bridle-hand.

These various changes must be made quickly and expertly, without


altering the degree of pressure or pull upon the horse's mouth. The
novice will find it greatly to her advantage to learn the management
of the reins before mounting the horse, and can do so by fastening
the bit-end of the reins to some stationary object, and then
practicing the different changes, until she can perform all these
manœuvres without looking at her hands or the reins.

When both the reins are held in the left hand, the rider has not so
much command over her horse as when they are held one in each
hand. For this reason, unless her steed be exceptionally well-trained
and obedient, it will be better, when in a crowded thoroughfare,
where quick turns have to be made, to hold a rein in each hand, and
this will become absolutely necessary if the animal be hard mouthed
or unruly.

When the horse is in motion and the reins are held in the left hand,
their separation may be quickly effected by carrying the right hand
to and over the left, the latter retaining its steadiness all the time,
and then passing the first three fingers of the right hand between
the two reins, so that they may readily close upon the right rein; the
thumb will then keep this rein firm by pressing it against the first
joint of the index finger. The position of the hands and reins will
then, after a movement of the left little finger to place the rein
between it and the third, be the same as described for the original
position where a snaffle-rein is held in each hand.
Should the reins become too long when held separately, they can
readily be shortened by returning the right rein to the bridle-hand,
placing it directly over the left rein between the third and little finger,
and then, by means of the right hand, drawing the loose rein or
reins through the bridle-hand to the proper length, after which the
right rein may again be taken in the right hand, as already
described.

When the reins are held in one hand, they can be shortened or
lengthened by simply seizing them at their free, disengaged ends
with the right hand, and while this holds them and sustains the
horse, the left hand must be slipped along the reins, up or down, as
may be required, but without changing their arrangement.

Another way of holding the reins in the bridle-hand is to pass the


right rein to the right of, and underneath, the index finger, and then
carry it across the palm, so as to escape beyond the little finger;
while the left rein must be passed to the left of the little finger (or
between it and the third finger), and then be carried across the palm
to escape beyond the index finger. The author cannot recommend
this manner of holding the reins to ladies who desire to become
accomplished and graceful riders, because the movements of the
hands and arms, when turning, or managing the horse, are much
more conspicuous; and there is not that delicate correspondence
with the animal's mouth that can be obtained by the other methods
described.

After the pupil has become expert in riding with the snaffle, she will
be ready for the double bridle, or the curb-bit and bridoon. The
double bridle must be held in the left hand in the following
manner: The bridoon or snaffle-reins are first to be taken up, evenly,
by the right hand and then the second finger of the left hand be
passed between these reins (the left rein being between the second
and third fingers, and the right rein between the first and second),
the back of the hand being directed somewhat upward, with the
knuckles toward the horse's head; the reins should then be pulled up
by the right hand just enough to feel the horse's mouth, and carried
across the palm to the index finger, where they should be held in
position by firm pressure with the thumb.

Fig. 27.—Double bridle: all reins in the bridle-hand.


1, upper reins, snaffle; 2, lower reins, curb.
View larger image.

The curb-reins are now to be taken evenly by the right hand, and
then the little finger of the left hand be passed between the two
reins, the left rein being upon the left or outer side of the little
finger, and the right rein between the little and third fingers; both
curb-reins should next be drawn upward by the right hand until they
are nearly the length of the snaffle, and carried across the palm, one
rein overlying the other, to the index finger, between its first and
second joints, and between the snaffle-reins and the thumb, at
which point all the reins must be firmly held by pressure of the
thumb against them; the right hand will now remove its hold. (Fig.
27.) The above manœuvring of the reins will give the "original
position" for the double bridle in the left hand. All these reins should
be of nearly equal length, the snaffle being slightly the shortest, so
that, while riding with the latter, the curb may be ready for instant
use; this may be brought into play by simply turning the wrist so as
to carry the little finger up and toward the waist. And the full power
of the curb may be brought into action by turning the wrist so as to
carry the knuckles down and the nails up, at the same time drawing
the little finger toward the waist.

To shorten or lengthen both the curb and snaffle reins


evenly without abandoning the horse to himself for a moment, or
without ceasing to keep up his action, the following method may be
pursued: The loose, disengaged ends of all the reins that extend
beyond the index finger of the left hand must be taken between the
thumb and forefinger of the right hand, care being taken during this
manœuvre to keep up the support to the horse with this hand; the
grasp of the left hand upon the reins must now be sufficiently
relaxed to allow this hand to slide along the reins downward to
shorten them, or upward to lengthen them; this must be effected
without deranging their adjustment; when the proper range has
been obtained, remove the right hand.

To shorten the curb and lengthen the snaffle-reins: The


loose, disengaged ends of all the reins must be held in the same
manner as stated in the preceding paragraph, between the thumb
and index finger of the right hand, not omitting to keep up a support
to the horse; the grasp of the left hand must now be slightly
relaxed, and this hand be slid up along all the reins, which
movement will lengthen them in the left hand. The grasp of the right
hand upon the snaffle-reins must now be relaxed, and the left hand
be slid down along the curb-reins, carrying the snaffle-reins with it,
until the proper range or distance has been attained, when the right
hand may be removed. While these changes are being made, the
right hand must sustain the horse by the curb-reins until the left has
obtained a firm hold upon all.

To shorten the snaffle and lengthen the curb reins, a course


similar to the one just preceding must be pursued, except that in
this case the right hand must retain the snaffle-reins, and support
the horse by them, while the left hand, in sliding down, will carry
those of the curb. In all these changes of the various reins, it must
be remembered that after each change has been effected the reins
must be held in place by firm pressure of the thumb, as already
described.

When either of the reins held in the left hand becomes loose, it
may be tightened, by carrying the right hand to and over the left
one, seizing the loose rein by its disengaged end that hangs loosely
from the left index finger, and drawing it up as far as is necessary.
While this is being done, the left hand must not be removed from its
position, and should continue to keep up a steady pressure upon the
horse's mouth.

In requiring the horse to stop, to back, to turn, or to advance,


the management of the double bridle-reins will be exactly the same
as stated in the directions given when holding the snaffle-reins in
the left hand.

When both the curb and the snaffle reins are held in the bridle-
hand, they may be changed to the right hand, when this is
desired, as follows: The right hand must be carried to the left; the
second finger of the right hand must be placed between the snaffle-
reins (already separated by the second finger of the left hand); and
the little finger of the right hand between the curb-reins (already
separated by the little finger of the left hand); this done, the thumb
and fingers of the right hand must be closed upon the reins, which
must, at the same time, be released by the left hand.

To restore these reins to the left hand, the pupil must proceed
as follows: Carrying the left hand to the right, the second finger of
the left hand must be placed between the snaffle-reins, and the little
finger of this hand between the curb-reins; this having been done,
the thumb and fingers must be closed upon all the reins, while the
right hand releases its hold. These several changes can be made
whether the horse be moving slowly or rapidly, care being taken to
effect them so quietly that the horse will not be abandoned to
himself from want of support, nor interrupted in the rhythm of his
gait.

If when riding with the double bridle in the bridle-hand, very quick
turns have to be made, or when the horse will not yield readily to
the movements of the bridle-hand, it will become necessary to
separate the reins by taking that of the right snaffle in the right
hand; this can be quickly effected by carrying the right hand to and
over the left, and seizing the right snaffle-rein with the first three
fingers of the right hand; this rein will pass between the third and
little fingers and across the palm, so that the loose, disengaged end
will escape from between the thumb and forefinger.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like