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.
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.
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.
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.
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!
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... }
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."
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.
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.
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.
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 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.
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.