Book Image

PhoneGap 3.x Mobile Application Development HOTSHOT

By : Kerri Shotts
Book Image

PhoneGap 3.x Mobile Application Development HOTSHOT

By: Kerri Shotts

Overview of this book

<p>PhoneGap allows you to use your existing knowledge of HTML, CSS, and JavaScript to create useful and exciting mobile applications.<br /><br />This book will present you with 12 exciting projects that will introduce you to the dynamic world of app development in PhoneGap. Starting with their design and following through to their completion, you will develop real-world mobile applications. Each app uses a combination of core PhoneGap technologies, plugins, and various frameworks covering the necessary concepts you can use to create many more great apps for mobile devices.</p>
Table of Contents (21 chapters)
PhoneGap 3.x Mobile Application Development HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing the data model


Now that we've covered the Capture API and alerts, we can build the video note data model. It's very similar to the image and audio note models:

Getting on with it

Let's get coding. Let's build the model's shell at www/js/app/models/videoNote.js using the following code:

define ( ["yasmf","app/models/baseNote", "app/models/videoManager"], function ( _y, BaseNote, VideoManager ) {
   var _className = "VideoNote";
   var VideoNote = function () {
      var self = new BaseNote();
      self.subclass ( _className );
      // the following code inserted here
      return self;
   }
   // add translations here
   return VideoNote;
});

First, we need to create a property that will hold our VideoManager class we created earlier:

      self._video = null;
      self.getVideo = function () {
         return self._video;
      }
      Object.defineProperty ( self, "video", {get: self.getVideo, configurable: true});

Since we're a video note, we need to override the representation...