Apache Cordova Api Cookbook

Paperback | July 9, 2014

byJohn M. Wargo

not yet rated|write a review

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.

 

 

Pricing and Purchase Info

$30.80 online
$36.99 list price (save 16%)
In stock online
Ships free on orders over $25
HURRY, ONLY 1 LEFT!
Prices may vary. why?
Please call ahead to confirm inventory.

From the Publisher

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

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 (a...

other books by John M. Wargo

BlackBerry Development Fundamentals
BlackBerry Development Fundamentals

Kobo ebook|Nov 5 2009

$32.39 online$41.98list price(save 22%)
Apache Cordova 3 Programming
Apache Cordova 3 Programming

Kobo ebook|Dec 2 2013

$25.29 online$32.80list price(save 22%)
PhoneGap Essentials: Building Cross-Platform Mobile Apps
PhoneGap Essentials: Building Cross-Platform Mobile App...

Kobo ebook|Jun 21 2012

$36.39 online$47.23list price(save 22%)
see all books by John M. Wargo
Format:PaperbackDimensions:320 pages, 8.99 × 7.18 × 0.65 inPublished:July 9, 2014Publisher:Pearson EducationLanguage:English

The following ISBNs are associated with this title:

ISBN - 10:0321994809

ISBN - 13:9780321994806

Customer Reviews of Apache Cordova Api Cookbook

Reviews

Extra Content

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