Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Getting Started with NativeScript
Getting Started with NativeScript

Getting Started with NativeScript: Explore the possibility of building truly native, cross-platform mobile applications using your JavaScript skill—NativeScript!

eBook
$9.99 $25.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Getting Started with NativeScript

Chapter 1. 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.

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.

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.

Note

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.

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.

Note

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.

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.

Note

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.

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.

Android

Android is a lot easier because you can execute development for Android on Linux, OSX, and Windows. For Android, you need to install Java JDK and then the Android SDK and tools. I also highly recommend that you install an optional third-party Android emulator rather than use the stock Android emulator. The third-party emulators are considerably faster than both the stock Android emulator and the add-on Intel HAXM emulator. The stock emulator and Intel HAXM can be downloaded via the Android SDK Manager. The instructions on the NativeScript site can walk you through installing all the tools that you will need for building and testing your application. The specific instructions for each of the platforms are located at http://docs.nativescript.org/setup/quick-setup#the-nativescript-cli.

Installation

Once you have node.js installed, you just need to do a simple npm install –g nativescript at a terminal shell (or known on Windows as a command prompt window). And then npm will download and install the required NativeScript code and command-line tool. It will install it globally so that it can be used from any project you are working on.

Tip

With the command path on Linux and Macintosh, the global commands are normally placed in /usr/local/bin, which is typically already in your path, so the nativescript command should work right away.

On Windows, unfortunately, you might have to add the path where npm installs the program globally. Type nativescript and see if it runs. If it fails to run, then you need to add npm's global directory to your path. Type npm config get prefix to get the current global directory.

Type systempropertiesadvanced , then click the Environment Variables button, then click on PATH, and finally, click the Edit button. Then, you can type a semicolon and add in the directory path to the all the npm global commands like the NativeScript command. So, your path might look something like this: C:\windows;c:\windows\system;c:\program files (x86)\nodejs.

Once the NativeScript command and required support tools are installed, you are all ready to begin developing NativeScript applications.

Installation help

Sometimes, getting NativeScript installed properly can be difficult because of all the differences between computers. Here are a couple places you can go to get help if you need it: https://groups.google.com/forum/#!forum/nativescript and https://plus.google.com/communities/117408587889337015711.

The NativeScript command line

Now, before we get to the creating a project part, let us have an overview of the commands available from the new nativescript command you just installed. If you forget any of these, you can easily type nativescript alone without any parameters to see a help screen at a console window, or type nativescript /? for a help screen in your browser.

NativeScript commands

These are just some of the most commonly used valid commands for the nativescript command. Several of these we will be covering as we progress in the book.

Command line

Description

nativescript --version

This returns the version of the nativescript command. If you are running an older version, then you can use npm to upgrade your nativescript command like this: npm install -g nativescript.

nativescript create <your project name>

This creates a brand new project.

nativescript platform add <platform>

This adds a target platform to your project.

nativescript platform list

This shows you what platforms you are currently targeting.

nativescript platform remove <platform>

This command is normally not needed, but if you are messing with the platform directory and totally mess up your platform, you can remove and then add it back. Please note this deletes the entire platform directory, so if you have any specific customizations to your Android manifest or iOS Xcode project file, you should back it up before running the remove command.

nativescript platform update <platform>

This is actually a pretty important command. NativeScript is still a very active project under a lot of development. This command upgrades your platform code to the latest version, which typically eliminates bugs and adds lots of new features. Please note this should also be done with an upgrade of the common JavaScript libraries as most of the time, they also are typically in sync with each other.

nativescript build <platform>

This builds the application for that platform.

nativescript deploy <platform>

This builds and deploys the application to a physical or virtual device for that platform.

nativescript emulate <platform>

This builds and deploys the application to an emulator.

nativescript run <platform>

This builds, deploys, and starts the application on a physical device or an emulator. This is the command you will use the majority of the time to run your application and check out the changes.

nativescript debug <platform>

This builds, deploys, and then starts the application on a physical device or an emulator in debug mode. This is probably the second most used command.

nativescript plugin add <plugin>

This allows you to add a third-party plugin or component. These plugins typically include JavaScript based code, but occasionally, they might also contain an actual compiled Java or ObjectiveC library.

nativescript livesync - -watch

This allows you to have the nativescript command watch for changes and automatically push them to the device. This is probably the third most used command if you are not using a better third-party LiveSync system. We call it LiveSync because it automatically syncs all your changes directly to the device in real time, without you having to rebuild the application. This speeds up your development of an application drastically.

nativescript doctor

This allows you to run some diagnostic checks on your environment if the nativescript command does not appear to be working.

nativescript install

This will (re)install any dependencies listed in your package.json file. The package.json file is typically modified by the plugin or library add function, so this is used typically to reinstall the plugins or libraries in the event you add a new platform or reinstall one.

nativescript test [ init | <platform> ]

This allows you to create or run any tests for your application. Using init will initialize the test framework for the application. Then, you just use the platform to run the tests on that platform.

Now that we have described some of the commands, let's use them to create your first mobile app via the nativescript command tool.

Creating your first application

I am going to walk you through how to create an application as it currently requires a couple steps that you need to do from a terminal shell. Then, we will show you how it looks.

Creating the application in easy steps

Creating a project is actually a fairly simple process; we are going to start by creating the application we will develop throughout this book.

  1. Make sure you are at a terminal shell and then type:
    nativescript create crossCommunicator
    
  2. This will create crossCommunicator as a subdirectory of the current directory you are running the nativescript command in. This new project directory will have all the required files for developing your project.
  3. Next, you will need to switch to that new crossCommunicator directory that it created for you by typing:
    cd crossCommunicator
    
  4. Then, type:
    nativescript platform add android
    

    And/or:

    nativescript platform add ios
    
  5. To add each of the target environment(s), you will be compiling your app from this machine:
    Creating the application in easy steps

If everything worked properly, you should see something like the preceding image results.

Now, I personally do all my development on the Windows platform using JetBrain's wonderful cross-platform PHPStorm development environment. You are free to use any JavaScript editor you are comfortable with. Since I am using the Windows platform, I do the majority of my testing and debugging on the Android platform and emulator. The Android emulator is basically a full Android in your computer, so it behaves like an actual device. However, since I am also targeting iOS, every so often I also copy or sync the code from my Windows app folder to a Macintosh and then verify that everything looks good and works as expected on the iOS emulator and eventually an iOS device. The very first time when I copy my code over to a Macintosh, I use the nativescript platform add ios command as I need to add the iOS target on the Macintosh.

Note

First time requirements

The very first time you create a project or add a platform, you do need an active Internet connection so the nativescript tool can download the current version of the runtime and platform libraries that it uses. In any future executions, it will first try to download the newest version, but if it fails, it will then use the currently cached version.

Running the app

With those simple steps, NativeScript creates a framework for an application that you can already run on your mobile device. Now, to run the project, we execute:

nativescript run android --emulator

Or:

nativescript run ios –-emulator

NativeScript will then copy your application to the emulator, automatically start it up, and then you should see your first application running on the emulator screen like this:

Running the app

Summary

We covered a lot in this chapter. You learned what NativeScript is and what makes NativeScript unique among all the different JavaScript mobile development systems. You also learned how to install NativeScript and explored a large number of different command-line parameters you will use. And finally, you actually created and ran a new project.

Now you have the tools you need installed, and most importantly, we now have a running application. Let's dive into what makes the whole project tick. We will explore all the different files and folders for your project and gain an understanding of how each file is used, and finally, we will enhance the default application in Chapter 2, The Project Structure.

Left arrow icon Right arrow icon

Key benefits

  • Save your marketing time by building for iOS, Android, and Windows Mobile platforms simultaneously
  • Be an ace at utilizing the features of NativeScript and its ability to communicate with each of the host device libraries natively
  • Proficiently, build your fully cross-platform communication application exhibiting the fundamentals of NativeScript

Description

NativeScript allows you to build a fast cross-platform application that has a native UI. NativeScript is a true cross-platform framework that generates native speed applications using the native components of the host platform, all using JavaScript. Although NativeScript allows you to build your application in JavaScript, you have full access to the host OS from your code, allowing you to easily tweak or use new platform features instantly at native code speeds. Whether you have already developed multiple applications or zero applications, this book will help you to develop your next application in a cross-platform framework quickly, saving you a massive amount of time and money. This book concisely shows you NativeScript’s built-in framework that allows you to rapidly develop a fully-working compiled cross-platform application in just a few chapters. It starts by laying the foundation of NativeScript and working through the fundamentals to create a basic shell of the application. Moving on, you’ll see how to build a full-fledged application step by step. We’ll show you how to use plugins, and how to communicate with the native OS libraries easily so that you can customize your application as if your app was created in Java or Objective C. We then deal with the issues that arise from being cross platform and compensate for the different screen sizes, screen resolutions, and device abilities. Finally, we progress to testing and deploying your app.

Who is this book for?

If you are a JavaScript developer and want to build cross-platform applications, then this book is just the right one for you!

What you will learn

  • Install and compile your application in NativeScript
  • Get important know-how on the NativeScript project structure
  • Develop and style your screens for multiple platforms
  • Create a full-featured cross-platform communication application
  • Import and use several third-party components
  • Simplify and deal with device resolution and cross-platform issues
  • Test and deploy your application
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 28, 2016
Length: 168 pages
Edition : 1st
Language : English
ISBN-13 : 9781785888656
Vendor :
Progress
Category :
Languages :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Jan 28, 2016
Length: 168 pages
Edition : 1st
Language : English
ISBN-13 : 9781785888656
Vendor :
Progress
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 81.98
NativeScript for Angular Mobile Development
$48.99
Getting Started with NativeScript
$32.99
Total $ 81.98 Stars icon
Banner background image

Table of Contents

8 Chapters
1. Introduction to NativeScript Chevron down icon Chevron up icon
2. The Project Structure Chevron down icon Chevron up icon
3. Declarative UI, Styling, and Events Chevron down icon Chevron up icon
4. Building a Featured Application Chevron down icon Chevron up icon
5. Installing Third-Party Components Chevron down icon Chevron up icon
6. Platform Differences Chevron down icon Chevron up icon
7. Testing and Deploying Your App Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.2
(9 Ratings)
5 star 33.3%
4 star 22.2%
3 star 11.1%
2 star 0%
1 star 33.3%
Filter icon Filter
Top Reviews

Filter reviews by




Alex Jun 17, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The author, being one of the leading community developers with NativeScript, clearly and logically take the reader on a real learning journey. What I love about this book is that it not only covers the essentials, but also goes deeper with some tried and tested real world knowledge, including tips and tricks, as well as different caveats that could potentially catch a freshman NativeScriptie off-guard. Looking forward to the next one!
Amazon Verified review Amazon
stevescotthome Jun 01, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great primer!l
Amazon Verified review Amazon
Ehrlichwährtamlängsten Mar 24, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Ich finde das Buch klasse. Es ist kompakt geschrieben, hat einen roten Faden und führt vollständig in NativeScript ein. Zudem schafft es der Autor immer wieder, zur rechten Zeit einen erfrischenden und gelungenen Joke einzuwerfen und den Leser bei Laune zu halten; eigentlich mag ich so was gar nicht, aber hier ist der Schreibstil definitiv gelungen und überaus informativ. Auch die Code-Beispiele sind exzellent; sie sind aufs wesentliche beschränkt und ohne Probleme nachfollziehbar.Sollte eine Neuauflage zur bevorstehenden Version 3 erscheinen, würde ich mir dies ebenfalls noch einmal und schnellstmöglichst bestellen. Ansonsten fühle ich mich mit diesem Buch bestens gerüstet und danke dem Autor für dieses liebevolle Werk.Ich wüsste nicht, warum ich stattdessen 400 oder 500 Seiten mit gleichem, dafür in die Länge gezogenen Inhalt lesen sollte. Sollte der Autor es jedoch schaffen, in einer Folgeauflage 400 oder 500 Seiten bei gleicher Qualität zu schreiben und diese eventuell sogar in ein farbig gedrucktes Buch zu stecken, dann würde ich auch ohne zögern den doppelten Preis zahlen (28 Euro aktuell / 50 dann o.ä.) ;-)Die 5 Sterne vergebe ich trotzdem schon, weil es sich eben um knapp 170 absolut informative und gut geschriebene Seiten zu einem noch akzeptablen Preis handelt und weil mir der Einstieg hiermit mehr als gut gelungen ist :-)
Amazon Verified review Amazon
Ahmed B. Feb 17, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Good book for a getting started book, but I was looking for a real-life examples such as Instagram/snap/YouTube.
Amazon Verified review Amazon
Joshie wah wah Sep 11, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I built a cross communicator and chatted between my mobile device and browser which is pretty cool! Certainly feel more comfortable building mobile chat apps. It is outdated now so took some work as some of the library's have changed etc. I love the way this guy has a laugh whilst teaching this stuff, after all web sockets and all that jazz can get a little tiresome.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela