Book Image

CoffeeScript Application Development Cookbook

By : Mike Hatfield
Book Image

CoffeeScript Application Development Cookbook

By: Mike Hatfield

Overview of this book

Table of Contents (18 chapters)
CoffeeScript Application Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using the camera


Cordova provides access to the hardware camera via the org.apache.cordova.camera plugin.

Getting ready

Plugins are added to our application via the cordova plugin add command.

To add the camera plugin, enter the following command in a terminal window at the root directory of our application:

cordova plugin add org.apache.cordova.camera

Once installed, the camera methods are made available via the navigator.camera object.

Our example will use the Kendo UI mobile framework. To get set up, follow these steps:

  1. Copy the Kendo UI kendo directory into the www directory of our Cordova application.

  2. Replace the contents of index.html with the following code:

    <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8" />
      <meta name="format-detection" content="telephone=no" />
      <meta name="msapplication-tap-highlight" content="no" />
      <link rel="stylesheet"
        href="kendo/styles/kendo.mobile.all.min.css">
      <title>CoffeeScript - Cordova</title...