Book Image

JavaScript Mobile Application Development

Book Image

JavaScript Mobile Application Development

Overview of this book

Table of Contents (15 chapters)
JavaScript Mobile Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The Mega App model and API


The Mega App model contains only one JavaScript object that represents the voice and photo memo data, as shown in the following code snippet:

var MemoItem = function(memoItem) {
    this.id = memoItem.id || "Memo_" + (new Date()).getTime();
    this.title = memoItem.title || "";
    this.desc = memoItem.desc || "";
    this.type = memoItem.type || "voice";
    this.location = memoItem.location || "";
    this.mtime = memoItem.mtime || "";
};

The MemoItem object contains the following attributes:

  • id: This represents the memo ID (its default value is unique as it includes a numeric value of the current time in milliseconds)

  • title: This represents the memo title

  • desc: This represents the memo description

  • type: This represents the memo type, and it can be "voice" or "photo" (its default value is "voice")

  • location: This represents the location of the media (audio or photo) file in the device's filesystem

  • mtime: This represents the time when the memo was created

We mainly...