Apache Cordova API Cookbook

Overview

Using Apache Cordova, mobile developers can write cross-platform mobile apps using standard HTML5, JavaScript, and CSS, and then deploy those apps to every leading mobile platform with little or no re-coding. Apache Cordova API Cookbook provides experienced mobile developers with details about how each Cordova API works and how to use the APIs in their own applications. Coverage is included for all Cordova/PhoneGap 3 APIs.

Instead of just showing short snippets of code to ...

See more details below
Paperback
$25.96
BN.com price
(Save 25%)$34.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (13) from $18.92   
  • New (11) from $18.92   
  • Used (2) from $20.80   
Apache Cordova API Cookbook

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac

Want a NOOK? Explore Now

NOOK Book (eBook)
$15.49
BN.com price
(Save 44%)$27.99 List Price

Overview

Using Apache Cordova, mobile developers can write cross-platform mobile apps using standard HTML5, JavaScript, and CSS, and then deploy those apps to every leading mobile platform with little or no re-coding. Apache Cordova API Cookbook provides experienced mobile developers with details about how each Cordova API works and how to use the APIs in their own applications. Coverage is included for all Cordova/PhoneGap 3 APIs.

Instead of just showing short snippets of code to explain a particular API, this guide is chock full of complete examples. You’ll find more than thirty complete Cordova applications that work on Android, iOS, Windows, and more. The sample applications demonstrate exactly what each API does and how it works, while the chapter content describes the limitations on the leading target platforms (and even offers possible workarounds).

Through realistic “cookbook” example code, mobile developer John Wargo helps you master the Cordova APIs and understand how to use them in your Cordova applications.

Topics include

  • Accelerometers, compass, and geolocation
  • Image, video, and audio–capture, playback, and management
  • Determining connection and device information
  • Interacting with the Contacts application
  • Responding to application events
  • Accessing the device file system
  • Globalizing apps
  • Using the InAppBrowser
  • Notifications
  • Custom splash screens

Special care has been taken to make the code easily readable and digestible by the reader. This guide provides the most accessible coverage, anywhere, of Apache Cordova APIs.

Read More Show Less

Product Details

  • ISBN-13: 9780321994806
  • Publisher: Addison-Wesley
  • Publication date: 8/29/2014
  • Series: Mobile Programming Series
  • Edition number: 1
  • Pages: 304
  • Sales rank: 1,436,317
  • Product dimensions: 7.00 (w) x 8.90 (h) x 0.70 (d)

Meet the Author

John M. Wargo has more than twenty years of experience designing and developing enterprise applications with a focus on collaboration and process automation. He has spent the last five years focusing on mobile development and is the author of BlackBerry Development Fundamentals, PhoneGap Essentials, and Apache Cordova 3 Programming (all from Addison-Wesley). He is currently a Product Manager at SAP, focusing on the SAP Mobile Platform. He is the Product Manager for the Kapsel SDK, SAP’s suite of enterprise plugins for Apache Cordova and the SAP Fiori Client, a Cordova application available today in the Android and iOS app stores. John's personal blog can be found at www.johnwargo.com.

Read More Show Less

Table of Contents

Foreword xiii

Preface xv

Acknowledgments xvii

About the Author xix

Chapter 1: Introduction to Apache Cordova 1

Introduction to Apache Cordova 1

Supported Platforms 5

Coding Cordova Applications 5

Configuring a Cordova Development Environment 6

Building Cordova Applications 6

Anatomy of a Cordova Application 9

Resources 15

Wrap Up 17

Chapter 2: Accelerometer 19

Measuring Device Orientation 20

Watching a Device’s Orientation 28

What Can Go Wrong 33

Chapter 3: Camera 35

Taking a Picture 36

Configuring Camera Options 44

iOS-Only Capabilities 58

What Can Go Wrong 58

Chapter 4: Capture 61

Using the Capture API 62

Configuring Capture Options 66

Capture in Action 66

What Can Go Wrong 77

Chapter 5: Compass 79

Getting the Device Heading 79

Watching the Device Heading 86

What Can Go Wrong 95

Chapter 6: Connection 97

Using the Connection API 97

An Example 99

What Can Go Wrong 103

Chapter 7: Contacts 105

Creating a Contact 106

Searching for Contacts 115

Cloning Contacts 124

Removing Contacts 124

What Can Go Wrong 124

Chapter 8: Device 127

Using the Device API 127

An Example 128

What Can Go Wrong 133

Chapter 9: Events 135

Managing Event Listeners 136

deviceready Event 137

Application Status Events 138

Battery Status Events 141

Button Events 144

Network Status Events 149

What Can Go Wrong 152

Chapter 10: File 153

Storage Locations 154

Accessing the Device’s File System 156

Reading Directory Entries 159

Accessing FileEntry and DirectoryEntry

Properties 163

Writing Files 167

Reading Files 170

Deleting Files or Directories 172

Copying Files or Directories 173

Moving Files or Directories 173

Transferring Files 174

What Can Go Wrong 179

Chapter 11: Geolocation 181

Getting a Device’s Current Location 182

Watching a Device’s Location 189

What Can Go Wrong 197

Chapter 12: Globalization 201

Example Applications 202

Using the Globalization API 204

Currency 206

Date 208

Language and Locale 217

Number 218

What Can Go Wrong 223

Chapter 13: InAppBrowser 225

Example Application 225

Managing an InAppBrowser Window 227

InAppBrowser Events 236

Executing Scripts in an InAppBrowser Window 237

Insert CSS 238

What Can Go Wrong 239

Chapter 14: Media 241

The Media Object 241

Playing Audio Files 247

Media Playback in Action 249

Recording Audio Files 259

Media Recording in Action 259

What Can Go Wrong 263

Chapter 15: Notification 265

Visual Alerts 266

Getting Input 269

Audible and Tactile Notifications 275

What Can Go Wrong 275

Chapter 16: Splashscreen 277

Using the Splashscreen API 277

Using Custom Splash Screen Images 281

What Can Go Wrong 284

Index 285

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)