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
JavaScript Mobile Application Development
JavaScript Mobile Application Development

JavaScript Mobile Application Development: Create neat cross-platform mobile apps using Apache Cordova and jQuery Mobile

Arrow left icon
Profile Icon Saleh
Arrow right icon
NZ$16.99 NZ$57.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (4 Ratings)
eBook Oct 2014 332 pages 1st Edition
eBook
NZ$16.99 NZ$57.99
Paperback
NZ$71.99
Subscription
Free Trial
Arrow left icon
Profile Icon Saleh
Arrow right icon
NZ$16.99 NZ$57.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (4 Ratings)
eBook Oct 2014 332 pages 1st Edition
eBook
NZ$16.99 NZ$57.99
Paperback
NZ$71.99
Subscription
Free Trial
eBook
NZ$16.99 NZ$57.99
Paperback
NZ$71.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
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
Modal Close icon
Payment Processing...
tick Completed

Billing Address

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

JavaScript Mobile Application Development

Chapter 2. Developing Your First Cordova Application

In the previous chapter, you had a powerful introduction to Apache Cordova. In this chapter, you will develop, build, and deploy your first Apache Cordova application from scratch. The application you will develop is a Sound Recorder utility that you can use to record your voice or any sound and play it back. In this chapter, you will learn about the following topics:

  • Generating your initial Apache Cordova project artifacts by utilizing the Apache Cordova Command-line Interface (CLI)
  • Developing and building your mobile application from the initial Cordova generated code
  • Deploying your developed mobile application to a real Android mobile device to see your application in action

An introduction to Cordova CLI

In order to create, develop, build, and test a Cordova application, you first need to use the Cordova CLI. Using this, you can create new Apache Cordova project(s), build them on mobile platforms such as iOS, Android, Windows Phone, and so on, and run them on real devices or within emulators. Note that in this chapter, we will focus on deploying our Sound Recorder application in Android devices only.

Tip

In the next chapter, we will learn how to deploy our Sound Recorder application in iOS and Windows Phone devices.

Installing Apache Cordova

Before installing Apache Cordova CLI, you need to make sure that you install the following software:

Developing Sound Recorder application

After generating the initial application code, it's time to understand what to do next.

Sound Recorder functionality

The following screenshot shows our Sound Recorder page:

Sound Recorder functionality

When the user clicks on the Record Sound button, they will be able to record their voices; they can stop recording their voices by clicking on the Stop Recording button. You can see this in the following screenshot:

Sound Recorder functionality

As shown in the following screenshot, when the user clicks on the Playback button, the recorded voice will be played back:

Sound Recorder functionality

Sound Recorder preparation

In order to implement this functionality using Apache Cordova, we need to add the following plugins using the indicated commands, which should be executed from the application directory:

  • media: This plugin is used to record and play back sound files:
       > cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git
    
  • device: This plugin is required to access the device information:
       > cordova plugin...

Building and running Sound Recorder application

Now, after developing our application code, we can start building our application using the following cordova build command:

> cordova build

In order to run the application in your Android mobile or tablet, just make sure you enable USB debugging in your Android device. Then, plug your Android device into your development machine and execute the following command from the application directory:

> cordova run android

Tip

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.

Congratulations! After running this command, you will see the Sound Recorder application deployed in your Android device; you can now start testing it on your real device.

Tip

In order to learn how to enable USB debugging in your Android...

Summary

In this chapter, you developed your first Apache Cordova application. You now know how to use the Apache Cordova Device API at a basic level. You also know how to use the Media and File APIs along with jQuery Mobile to develop the Sound Recorder application. You now understand how to use Apache Cordova CLI in order to manage your Cordova mobile application. In addition, you know how to create a Cordova project, add a new platform (in our case, Android), build your own Cordova mobile application, and deploy your Cordova mobile application to the emulator, and most importantly, to a real device!

In the next chapter, we will show you how to prepare your Android, iOS, and Windows Phone development environments. Along with this, you will see how to make our Sound Recorder application works on Windows Phone 8 and iOS.

Left arrow icon Right arrow icon

Description

If you are a native mobile developer, with some familiarity with the common web technologies of JavaScript, CSS, and HTML, or if you are a web developer, then this learning guide will add great value and impact to your work. Learning how to develop mobile applications using Apache Cordova is of particular importance if you are looking to develop applications on a variety of different platforms efficiently.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 21, 2014
Length: 332 pages
Edition : 1st
Language : English
ISBN-13 : 9781783554188
Vendor :
Adobe
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
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
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Oct 21, 2014
Length: 332 pages
Edition : 1st
Language : English
ISBN-13 : 9781783554188
Vendor :
Adobe
Category :
Languages :
Tools :

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 NZ$7 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 NZ$7 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total NZ$ 224.97
Mastering JavaScript Design Patterns
NZ$71.99
JavaScript Mobile Application Development
NZ$71.99
Object-Oriented JavaScript - Second Edition
NZ$80.99
Total NZ$ 224.97 Stars icon

Table of Contents

9 Chapters
1. An Introduction to Apache Cordova Chevron down icon Chevron up icon
2. Developing Your First Cordova Application Chevron down icon Chevron up icon
3. Apache Cordova Development Tools Chevron down icon Chevron up icon
4. Cordova API in Action Chevron down icon Chevron up icon
5. Diving Deeper into the Cordova API Chevron down icon Chevron up icon
6. Developing Custom Cordova Plugins Chevron down icon Chevron up icon
7. Unit Testing the Cordova App's Logic Chevron down icon Chevron up icon
8. Applying it All – the Mega App Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(4 Ratings)
5 star 75%
4 star 25%
3 star 0%
2 star 0%
1 star 0%
werpu Mar 01, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a very good introduction into Apache Cordova. It basically guides you from the basics to the API integration, then to the most common APIs. After that you get an overview on how to unit test the application and how to write your own plugins and in the end you will get a guide to the implementation of a complex Cordova app.The only thing I personally found missing was in the IDE section a description on how to integrated Cordova in the Android Studio instead of Eclipse, since Eclipse is on its way out in the Android area of programming.
Amazon Verified review Amazon
Zubin Wadia Nov 11, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Fabulous coverage of a powerful and mature cross-platform library. The book goes through the basics over the first five chapters, making sure native app developers aren't alienated by the diaspora of HTML5/CSS3 web standards out there. A web developer will find that the book truly gets into its stride via the 5th, 6th, 7th and 8th chapters - which cover advanced Cordova API calls, platform specific code for iOS/Android/WinPhone, unit testing (critical) and finally a "Mega App" that puts your knowledge through some practical pacing.
Amazon Verified review Amazon
Safwat Oct 24, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book is an easy and comprehensive guide to whoever is interested in multi platform mobile development with examples it shows the full life cycle of developing mobile cordova apps.
Amazon Verified review Amazon
Joan Aug 23, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Se ven la mayoría de APIs disponibles, pero no se aprofundiza en ellas. Simplemente va mostrando ejemplos de cada una y te explica que hace cada cosa.Muy bueno como introducción para hacerse con el workflow de trabajo en Cordova y sus APIs más típicas.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Modal Close icon
Modal Close icon