incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [27/28] git commit: Initial playbook support for phonegap
Date Tue, 03 Jan 2012 20:22:59 GMT
Initial playbook support for phonegap


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/commit/ef539d3e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/tree/ef539d3e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/diff/ef539d3e

Branch: refs/heads/master
Commit: ef539d3e51d6a3b92034a763cd76adbf1a036d12
Parents: f42a61c
Author: Jeffrey Heifetz <jheifetz@rim.com>
Authored: Tue Aug 23 12:26:13 2011 -0400
Committer: Jeffrey Heifetz <jheifetz@rim.com>
Committed: Tue Aug 23 12:26:13 2011 -0400

----------------------------------------------------------------------
 .gitignore                                         |    3 +
 README.md                                          |    6 +-
 build.xml                                          |  679 ++++++++-------
 framework/ext-air/PhoneGap_Network/library.xml     |   22 +
 .../src/com/phonegap/network/Network.as            |   67 ++
 .../ext/src/com/phonegap/PhoneGapExtension.java    |   16 +-
 framework/ext/src/com/phonegap/device/Device.java  |   95 ++-
 framework/ext/src/library.xml                      |   18 +-
 javascript/_phonegap.js                            |   54 +-
 javascript/blackberry/blackberryPluginManager.js   |  112 +++
 javascript/capture.js                              |  380 ++++++++
 javascript/console.js                              |   47 +-
 javascript/device.js                               |   37 +-
 javascript/playbook/playBookPluginManager.js       |  239 +++++
 javascript/webWorksPluginManager.js                |   91 ++
 template/project/blackberry.xml                    |  301 +++++++
 template/project/build.xml                         |  407 +++------
 template/project/playbook.xml                      |  238 +++++
 template/project/project.properties                |   57 ++-
 template/project/www/config.xml                    |   13 +-
 template/project/www/plugins.xml                   |    1 +
 21 files changed, 2143 insertions(+), 740 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 7cb8a35..6162d9a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,6 @@ dist/
 # OS X
 
 .DS_Store
+
+tags
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 881dfe9..9a55bac 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 PhoneGap BlackBerry WebWorks
 ============================
 
-[PhoneGap framework](http://www.phonegap.com/) for __BlackBerry OS 5.0 and 6.0__. The framework is implemented using the [BlackBerry WebWorks SDK](http://us.blackberry.com/developers/browserdev/widgetsdk.jsp).
+[PhoneGap framework](http://www.phonegap.com/) for __BlackBerry Tablet OS__. The framework is implemented using the [BlackBerry WebWorks SDK](http://us.blackberry.com/developers/tablet/webworks.jsp).
 
 Directory Structure
 -------------------
@@ -14,9 +14,9 @@ Directory Structure
 Introduction
 ------------
 
-BlackBerry WebWorks is a framework for developing hybrid applications for BlackBerry devices that support __Blackberry OS 5.0 and higher__.  BlackBerry WebWorks is not supported on BlackBerry OS 4.x.  
+BlackBerry WebWorks is a framework for developing web-based applications for BlackBerry SmartPhones (BlackBerry OS 5.0 and higher) and the TabletOS.  Creating a web application is one of the easiest ways to have an application that runs on both platforms.    
 
-The WebWorks framework allows developers to create applications using web content and resources (HTML/CSS/JavaScript) that are able to access device features through the [Blackberry WebWorks API](http://www.blackberry.com/developers/docs/widgetapi/).  In addition, the framework allows developers to create their own WebWorks JavaScript Extensions to expose additional device capabilities through JavaScript APIs.  These extensions are written using the native BlackBerry Java API.
+The WebWorks framework allows developers to create applications using web content and resources (HTML/CSS/JavaScript) that are able to access device features through the [Blackberry WebWorks API](http://www.blackberry.com/developers/docs/widgetapi/).  In addition, the framework allows developers to create their own WebWorks JavaScript Extensions to expose additional device capabilities through JavaScript APIs.  These extensions are written using either the BlackBerry Java API for SmartPhones, or Adobe AIR for the Tablet OS.
 
 The phonegap-blackberry-webworks platform allows web developers to develop applications targeting BlackBerry 5.0 and higher devices using the common [PhoneGap API](http://docs.phonegap.com).  When possible, PhoneGap makes use of the WebWorks JavaScript API; however, most PhoneGap features are implemented in the native Java environment as a WebWorks JavaScript Extension.
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 19913de..00a460c 100644
--- a/build.xml
+++ b/build.xml
@@ -1,322 +1,357 @@
-<project name="Create &amp; Update a PhoneGap BlackBerry WebWorks Project or Plugin" default="help">
-    
-    <!-- LOAD VERSION -->
-    
-    <loadfile property="version" srcFile="VERSION">
-        <filterchain>
-            <striplinebreaks/>
-        </filterchain>
-    </loadfile>
-    
-    <!-- LOAD PROPERTIES -->
-    
-    <property name="template.project.dir" location="template/project" />
-    <property name="template.plugin.dir"  location="template/plugin" />
-    <property name="template.dist.dir"    location="template/dist" />
-    
-    <property name="build.dir"            location="build" />
-    <property name="update.dir"           value="lib/phonegap.${version}" />
-    
-    <property name="dist.path"         location="dist" />
-    <property name="dist.www.path"     location="${dist.path}/www" />
-    <property name="dist.project.path" location="${dist.path}/sample" />
-    
-    <property name="jar.src"      location="framework/ext/src" />
-    <property name="jar.path"     value="ext" />
-    <property name="jar.basename" value="phonegap.${version}.jar" />
-    <property name="jar.file"     value="${jar.path}/${jar.basename}" />
-    
-    <property name="js.src"          location="javascript" />
-    <property name="js.path"         value="javascript" />
-    <property name="js.basename"     value="phonegap.${version}.js" />
-    <property name="js.file"         value="${js.path}/${js.basename}" />
-    
-    <!-- BUILD JAVASCRIPT -->
-    
-    <target name="build-javascript">
-        <mkdir dir="${build.dir}/${js.path}" />
-        
-        <concat destfile="${build.dir}/${js.file}" append="false">
-            <fileset dir="${js.src}">
-                <include name="*.js" />
-            </fileset>
-        </concat>
-    </target>
-    
-    <!-- BUILD WIDGET EXTENSION -->
-    
-    <target name="build-extension">
-        <mkdir dir="${build.dir}/${jar.path}" />
-        
-        <zip destfile="${build.dir}/${jar.file}">
-            <fileset dir="${jar.src}" includes="library.xml" />
-            <fileset dir="${jar.src}" includes="**/*.java" />
-        </zip>
-    </target>
-    
-    <!-- CREATE A PROJECT -->
-    <target name="create" depends="clean, build-javascript, build-extension">
-        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
-        
-        <available file="${project.path}" property="project.exists" />
-        <fail if="project.exists" message="The project path must be an empty directory." />
-        
-        <!-- create project using template directory -->
-        <mkdir dir="${project.path}" />
-        <copy todir="${project.path}">
-            <fileset dir="${template.project.dir}" />
-        </copy>
-        
-        <!-- update project files to reference phonegap.x.x.x.js -->
-        <replaceregexp match="phonegap\.js" replace="${js.basename}" byline="true">
-            <fileset file="${project.path}/www/index.html" />
-            <fileset file="${project.path}/build.xml" />
-        </replaceregexp>
-        
-        <!-- copy phonegap.js -->
-        <copy todir="${project.path}/www">
-            <fileset dir="${build.dir}/${js.path}" />
-        </copy>
-        
-        <!-- copy ext/ -->
-        <copy todir="${project.path}/www/ext">
-            <fileset dir="${build.dir}/${jar.path}" />
-        </copy>
-        
-        <!-- save release -->
-        <mkdir dir="${project.path}/${update.dir}" />
-        <copy todir="${project.path}/${update.dir}">
-            <fileset dir="${build.dir}" />
-        </copy>
-        
-        <echo>
-Project Creation Complete!
-==========================
-
-Getting Started:
-----------------
-
-  cd ${project.path}
-
-  ant help
-        </echo>
-    </target>
-    
-    <!-- DISTRIBUTION -->
-    <target name="dist" depends="">
-        <!-- create a sample project -->
-        <antcall target="create">
-            <param name="project.path" value="${dist.project.path}" />
-        </antcall>
-        
-        <!-- copy dist template (README.md) -->
-        <copy todir="${dist.path}">
-            <fileset dir="${template.dist.dir}" />
-        </copy>
-        
-        <!-- copy phonegap.jar -->
-        <copy todir="${dist.www.path}/ext">
-            <fileset dir="${build.dir}/${jar.path}" />
-        </copy>
-        
-        <!-- copy phonegap.js -->
-        <copy todir="${dist.www.path}">
-            <fileset dir="${build.dir}/${js.path}" />
-        </copy>
-        
-        <!-- copy config.xml -->
-        <copy todir="${dist.www.path}">
-            <fileset file="${template.project.dir}/www/config.xml" />
-        </copy>
-        
-        <!-- copy plugins.xml -->
-        <copy todir="${dist.www.path}">
-            <fileset file="${template.project.dir}/www/plugins.xml" />
-        </copy>
-        
-        <echo>
-Distribution Complete!
-======================
-
-Version:
---------
-
-  ${version}
-
-Path:
------
-
-  ${dist.path}
-        </echo>
-    </target>
-    
-    <target name="version">
-        <replace dir="." token="${version}" value="${value}" />
-        
-        <echo>
-Version Update Complete!
-========================
-
-Version:
---------
-
-  Previous: ${version}
-  Current:  ${value}
-
-Remember to:
-------------
-
-  Review and commit the version update.
-  
-  $ git diff
-  $ git commit -am "Update to version ${value}"
-  $ git tag ${value}
-        </echo>
-    </target>
-    
-    <!-- UPDATE A PROJECT -->
-    
-    <target name="update" depends="clean, build-javascript, build-extension">
-        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
-        
-        <available file="${project.path}" property="project.exists" />
-        <fail unless="project.exists" message="The project path cannot be empty." />
-        
-        <!-- save release -->
-        <mkdir dir="${project.path}/${update.dir}" />
-        <copy todir="${project.path}/${update.dir}">
-            <fileset dir="${build.dir}" />
-        </copy>
-        
-        <echo>
-Update complete!
-================
-
-  PhoneGap ${version} has been created.
-  
-  Update does not alter your project files.
-  
-  See below for instructions to install PhoneGap ${version}.
-
-Where:
-------
-
-  ${project.path}/${update.dir}
-
-Install:
---------
-
-  1. Install the Java Extension:
-
-    - delete /www/${jar.path}/phonegap.jar
-    
-    - copy /${update.dir}/${jar.file}
-        to /www/${jar.file}
-
-  2. Install the JavaScript library:
-
-    - delete /www/phonegap.js
-    
-    - copy /${update.dir}/${js.file}
-        to /www/${js.basename}
-
-  3. Update JavaScript references:
-
-    - &#60;script type=&#34;text/javascript&#34; src=&#34;${js.basename}&#34;&#62;&#60;/script&#62;
-        </echo>
-    </target>
-    
-    <!-- CREATE A PLUGIN -->
-
-    <target name="create-plugin" depends="">
-        <!-- validate arguments -->
-        <fail unless="plugin.path" message="You must give a plugin PATH. Use the argument -Dplugin.path=&#34;C:\dev\my_plugin&#34;" />
-
-        <!-- destination must be empty -->
-        <available file="${plugin.path}" property="plugin.exists" />
-        <fail if="plugin.exists" message="The plugin path must be an empty directory." />
-
-        <!-- copy plugin directory -->
-        <mkdir dir="${plugin.path}" />
-        <copy todir="${plugin.path}">
-            <fileset dir="${template.plugin.dir}" />
-        </copy>
-
-        <echo>
-Plugin Creation Complete!
-=========================
-
-Getting Started:
-----------------
-
-  cd ${plugin.path}
-
-  ant help
-        </echo>
-    </target>
-
-    <!-- UPDATE A PLUGIN -->
-
-    <target name="update-plugin" depends="">
-        <fail unless="plugin.path" message="You must give a plugin PATH. Use the argument -Dplugin.path=&#34;C:\dev\my_plugin&#34;" />
-
-        <available file="${plugin.path}" property="plugin.exists" />
-        <fail unless="plugin.exists" message="The plugin path cannot be empty." />
-
-        <!-- build.xml -->
-        <copy todir="${plugin.path}" file="${template.plugin.dir}/build.xml" />
-        <echo message="Updated build.xml" />
-    </target>
-
-    <!-- CLEAN -->
-    
-    <target name="clean">
-        <delete dir="${build.dir}" />
-        <delete dir="${dist.path}" />
-    </target>
-    
-    <!-- HELP -->
-    
-    <target name="help">
-        <echo>
-NAME
-  ${ant.project.name}
-
-SYNOPSIS
-  ant COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
-
-DESCRIPTION
-  This tool allows you to create and update PhoneGap-BlackBerry-WebWorks projects.
-  You will want to run update after you have updated the framework source.
-  In other words, when you &lt;git pull origin master&gt;.
-
-COMMANDS
-  help ............ Show this help menu.
-                      ant, ant help
-
-  create .......... Create a new project
-                      ant create PATH
-                      ant create -Dproject.path="C:\dev\my_project"
-
-  update .......... Update an existing project
-                      ant update PATH
-                      ant update -Dproject.path="C:\dev\my_project"
-
-  dist ............ Create a PhoneGap distribution build
-                      ant dist
-
-  version ......... Update PhoneGap version
-                      ant version VERSION
-                      ant version -Dvalue="1.0.0"
-
-  create-plugin ... Create a new plugin
-                      ant create-plugin PATH
-                      ant create-plugin -Dplugin.path="C:\dev\my_plugin"
-
-  update-plugin ... Update a plugin's ANT script
-                      ant update-plugin PATH
-                      ant update-plugin -Dplugin.path="C:\dev\my_plugin"
-        </echo>
-    </target>
-
-</project>
+<project name="Create &amp; Update a PhoneGap BlackBerry WebWorks Project or Plugin" default="help">
+    
+    <!-- LOAD VERSION -->
+    
+    <loadfile property="version" srcFile="VERSION">
+        <filterchain>
+            <striplinebreaks/>
+        </filterchain>
+    </loadfile>
+    
+    <!-- LOAD PROPERTIES -->
+    
+    <property name="template.project.dir" location="template/project" />
+    <property name="template.plugin.dir"  location="template/plugin" />
+    <property name="template.dist.dir"    location="template/dist" />
+    
+    <property name="build.dir"            location="build" />
+    <property name="update.dir"           value="lib/phonegap.${version}" />
+    
+    <property name="dist.path"         location="dist" />
+    <property name="dist.www.path"     location="${dist.path}/www" />
+    <property name="dist.project.path" location="${dist.path}/sample" />
+    
+    <property name="jar.src"      location="framework/ext/src" />
+    <property name="jar.path"     value="ext" />
+    <property name="jar.basename" value="phonegap.${version}.jar" />
+    <property name="jar.file"     value="${jar.path}/${jar.basename}" />
+    
+    <property name="playbook.js.src"    location="javascript/playbook" />
+    <property name="playbook.js.path"   value="javascript/playbook" />
+    <property name="playbook.js.file"   value="${playbook.js.path}/playbook.js" />
+    <property name="playbook.ext.src"   location="framework/ext-air" />
+    <property name="playbook.ext.path"  value="ext-air" />
+    
+    <property name="js.src"          location="javascript" />
+    <property name="js.path"         value="javascript" />
+    <property name="js.basename"     value="phonegap.${version}.js" />
+    <property name="js.file"         value="${js.path}/${js.basename}" />
+    
+    <!-- BUILD JAVASCRIPT -->
+    
+    <target name="build-javascript">
+        <mkdir dir="${build.dir}/${js.path}" />
+        
+        <!-- BB Javascript -->
+        <concat destfile="${build.dir}/${js.file}" append="false">
+            <fileset dir="${js.src}">
+                <include name="*.js" />
+            </fileset>
+        </concat>
+		<concat destfile="${build.dir}/${js.file}" append="true">
+            <fileset dir="${js.src}/blackberry" includes="*.js"/>
+        </concat>					 
+					 
+		<!-- PB Javascript -->
+        <mkdir dir="${build.dir}/${playbook.js.path}" />
+        <concat destfile="${build.dir}/${playbook.js.path}/${js.basename}" append="false">
+            <fileset dir="${js.src}" includes="*.js" />
+        </concat>
+        <concat destfile="${build.dir}/${playbook.js.path}/${js.basename}" append="true">
+            <fileset dir="${js.src}/playbook" includes="*.js"/>
+        </concat>
+    </target>
+    
+    <!-- BUILD BLACKBERRY EXTENSION -->
+    
+    <target name="build-bb-extension">
+        <mkdir dir="${build.dir}/${jar.path}" />
+        
+        <zip destfile="${build.dir}/${jar.file}">
+            <fileset dir="${jar.src}" includes="library.xml" />
+            <fileset dir="${jar.src}" includes="**/*.java" />
+        </zip>
+    </target>
+    
+    <!-- BUILD PLAYBOOK EXTENSION -->
+    
+    <target name="build-pb-extension">               
+
+        <!-- Copy Ext -->
+        <mkdir dir="${build.dir}/${playbook.ext.path}" />
+        <copy todir="${build.dir}/${playbook.ext.path}">
+            <fileset dir="${playbook.ext.src}" />
+        </copy>
+    </target>
+    
+    <!-- CREATE A PROJECT -->
+    <target name="create" depends="clean, build-javascript, build-bb-extension, build-pb-extension">
+        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
+        
+        <available file="${project.path}" property="project.exists" />
+        <fail if="project.exists" message="The project path must be an empty directory." />
+        
+        <!-- create project using template directory -->
+        <mkdir dir="${project.path}" />
+        <copy todir="${project.path}">
+            <fileset dir="${template.project.dir}" />
+        </copy>
+        
+        <!-- update project files to reference phonegap.x.x.x.js -->
+        <replaceregexp match="phonegap\.js" replace="${js.basename}" byline="true">
+            <fileset file="${project.path}/www/index.html" />
+            <fileset file="${project.path}/build.xml" />
+        </replaceregexp>
+        
+        <!-- copy phonegap.js -->
+        <copy todir="${project.path}/www">
+            <fileset dir="${build.dir}/${js.path}" />
+        </copy>
+        
+        <!-- copy ext/ -->
+        <copy todir="${project.path}/www/ext">
+            <fileset dir="${build.dir}/${jar.path}" />
+        </copy>
+        
+        <!-- copy ext-air/ -->
+        <copy todir="${project.path}/www/ext-air">
+            <fileset dir="${build.dir}/${playbook.ext.path}" />
+        </copy>
+        
+        <!-- save release -->
+        <mkdir dir="${project.path}/${update.dir}" />
+        <copy todir="${project.path}/${update.dir}">
+            <fileset dir="${build.dir}" />
+        </copy>
+        
+        <echo>
+Project Creation Complete!
+==========================
+
+Getting Started:
+----------------
+
+  cd ${project.path}
+
+  ant help
+        </echo>
+    </target>
+    
+    <!-- DISTRIBUTION -->
+    <target name="dist" depends="">
+        <!-- create a sample project -->
+        <antcall target="create">
+            <param name="project.path" value="${dist.project.path}" />
+        </antcall>
+        
+        <!-- copy dist template (README.md) -->
+        <copy todir="${dist.path}">
+            <fileset dir="${template.dist.dir}" />
+        </copy>
+        
+        <!-- copy phonegap.jar -->
+        <copy todir="${dist.www.path}/ext">
+            <fileset dir="${build.dir}/${jar.path}" />
+        </copy>
+        
+        <!-- copy phonegap.js -->
+        <copy todir="${dist.www.path}">
+            <fileset dir="${build.dir}/${js.path}" />
+        </copy>
+        
+        <!-- copy config.xml -->
+        <copy todir="${dist.www.path}">
+            <fileset file="${template.project.dir}/www/config.xml" />
+        </copy>
+        
+        <!-- copy plugins.xml -->
+        <copy todir="${dist.www.path}">
+            <fileset file="${template.project.dir}/www/plugins.xml" />
+        </copy>
+        
+        <echo>
+Distribution Complete!
+======================
+
+Version:
+--------
+
+  ${version}
+
+Path:
+-----
+
+  ${dist.path}
+        </echo>
+    </target>
+    
+    <target name="version">
+        <replace dir="." token="${version}" value="${value}" />
+        
+        <echo>
+Version Update Complete!
+========================
+
+Version:
+--------
+
+  Previous: ${version}
+  Current:  ${value}
+
+Remember to:
+------------
+
+  Review and commit the version update.
+  
+  $ git diff
+  $ git commit -am "Update to version ${value}"
+  $ git tag ${value}
+        </echo>
+    </target>
+    
+    <!-- UPDATE A PROJECT -->
+    
+    <target name="update" depends="clean, build-javascript, build-bb-extension, build-pb-extension">
+        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
+        
+        <available file="${project.path}" property="project.exists" />
+        <fail unless="project.exists" message="The project path cannot be empty." />
+        
+        <!-- save release -->
+        <mkdir dir="${project.path}/${update.dir}" />
+        <copy todir="${project.path}/${update.dir}">
+            <fileset dir="${build.dir}" />
+        </copy>
+        
+        <echo>
+Update complete!
+================
+
+  PhoneGap ${version} has been created.
+  
+  Update does not alter your project files.
+  
+  See below for instructions to install PhoneGap ${version}.
+
+Where:
+------
+
+  ${project.path}/${update.dir}
+
+Install:
+--------
+
+  1. Install the Java Extension:
+
+    - delete /www/${jar.path}/phonegap.jar
+    
+    - copy /${update.dir}/${jar.file}
+        to /www/${jar.file}
+
+  2. Install the JavaScript library:
+
+    - delete /www/phonegap.js
+    
+    - copy /${update.dir}/${js.file}
+        to /www/${js.basename}
+
+  3. Update JavaScript references:
+
+    - &#60;script type=&#34;text/javascript&#34; src=&#34;${js.basename}&#34;&#62;&#60;/script&#62;
+        </echo>
+    </target>
+    
+    <!-- CREATE A PLUGIN -->
+
+    <target name="create-plugin" depends="">
+        <!-- validate arguments -->
+        <fail unless="plugin.path" message="You must give a plugin PATH. Use the argument -Dplugin.path=&#34;C:\dev\my_plugin&#34;" />
+
+        <!-- destination must be empty -->
+        <available file="${plugin.path}" property="plugin.exists" />
+        <fail if="plugin.exists" message="The plugin path must be an empty directory." />
+
+        <!-- copy plugin directory -->
+        <mkdir dir="${plugin.path}" />
+        <copy todir="${plugin.path}">
+            <fileset dir="${template.plugin.dir}" />
+        </copy>
+
+        <echo>
+Plugin Creation Complete!
+=========================
+
+Getting Started:
+----------------
+
+  cd ${plugin.path}
+
+  ant help
+        </echo>
+    </target>
+
+    <!-- UPDATE A PLUGIN -->
+
+    <target name="update-plugin" depends="">
+        <fail unless="plugin.path" message="You must give a plugin PATH. Use the argument -Dplugin.path=&#34;C:\dev\my_plugin&#34;" />
+
+        <available file="${plugin.path}" property="plugin.exists" />
+        <fail unless="plugin.exists" message="The plugin path cannot be empty." />
+
+        <!-- build.xml -->
+        <copy todir="${plugin.path}" file="${template.plugin.dir}/build.xml" />
+        <echo message="Updated build.xml" />
+    </target>
+
+    <!-- CLEAN -->
+    
+    <target name="clean">
+        <delete dir="${build.dir}" />
+        <delete dir="${dist.path}" />
+    </target>
+    
+    <!-- HELP -->
+    
+    <target name="help">
+        <echo>
+NAME
+  ${ant.project.name}
+
+SYNOPSIS
+  ant COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
+
+DESCRIPTION
+  This tool allows you to create and update PhoneGap-BlackBerry-WebWorks projects.
+  You will want to run update after you have updated the framework source.
+  In other words, when you &lt;git pull origin master&gt;.
+
+COMMANDS
+  help ............ Show this help menu.
+                      ant, ant help
+
+  create .......... Create a new project
+                      ant create PATH
+                      ant create -Dproject.path="C:\dev\my_project"
+
+  update .......... Update an existing project
+                      ant update PATH
+                      ant update -Dproject.path="C:\dev\my_project"
+
+  dist ............ Create a PhoneGap distribution build
+                      ant dist
+
+  version ......... Update PhoneGap version
+                      ant version VERSION
+                      ant version -Dvalue="1.0.0"
+
+  create-plugin ... Create a new plugin
+                      ant create-plugin PATH
+                      ant create-plugin -Dplugin.path="C:\dev\my_plugin"
+
+  update-plugin ... Update a plugin's ANT script
+                      ant update-plugin PATH
+                      ant update-plugin -Dplugin.path="C:\dev\my_plugin"
+        </echo>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/framework/ext-air/PhoneGap_Network/library.xml
----------------------------------------------------------------------
diff --git a/framework/ext-air/PhoneGap_Network/library.xml b/framework/ext-air/PhoneGap_Network/library.xml
new file mode 100644
index 0000000..9c507bc
--- /dev/null
+++ b/framework/ext-air/PhoneGap_Network/library.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<library isWhitelist="true">
+	<extension>
+		<entryClass>com.phonegap.network.Network</entryClass>
+	</extension>
+
+	<platforms>
+		<platform value="AIR">
+			<target version="default" config="AIR_XHR" />
+		</platform>
+	</platforms>
+
+	<configurations>
+		<configuration name="AIR_XHR" version="1.0" comment="For XHR architecture for Java implementation">
+			<src type="text/actionscript" path="src" comment="ActionScript implementation" />
+		</configuration>
+	</configurations>
+	
+	<features>
+		<feature id="com.phonegap" version="1.0.0rc1" />
+	</features>
+</library>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/framework/ext-air/PhoneGap_Network/src/com/phonegap/network/Network.as
----------------------------------------------------------------------
diff --git a/framework/ext-air/PhoneGap_Network/src/com/phonegap/network/Network.as b/framework/ext-air/PhoneGap_Network/src/com/phonegap/network/Network.as
new file mode 100644
index 0000000..3f2bf2d
--- /dev/null
+++ b/framework/ext-air/PhoneGap_Network/src/com/phonegap/network/Network.as
@@ -0,0 +1,67 @@
+/*
+ * PhoneGap is available under *either* the terms of the modified BSD license *or* the
+ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
+ * 
+ * Copyright (c) 2011, Research In Motion Limited.
+ */
+
+
+package com.phonegap.network {
+    import flash.net.NetworkInfo;
+    import flash.net.NetworkInterface;
+	import flash.events.Event;
+    
+    import webworks.extension.DefaultExtension;
+    
+    public class Network extends DefaultExtension{
+        
+        private var _jsFunctionCallbackIDs:Array = [];
+		private const FEATURE_ID:Array = [ "com.phonegap" ];
+		
+		public function Network() {
+			//Attach event listener once only
+			NetworkInfo.networkInfo.addEventListener(flash.events.Event.NETWORK_CHANGE, networkChange);    
+		}
+		
+		override public function getFeatureList():Array {
+			return FEATURE_ID;
+		}
+        
+        public function getConnectionInfo(param:String):void{ 
+			if(_jsFunctionCallbackIDs.indexOf(param) < 0){
+				_jsFunctionCallbackIDs.push(param);
+			}
+        }
+        
+        private function networkChange( event: Event ) : void {
+            
+            /**
+             * Right now, we only care if there is a connection or not, since PlayBook only has WiFi
+             * At the JS layer, we will map this from offline/online.
+             * At some point in the future where there are more connection types on PlayBook,
+             * we will want to attempt to map this to the real PhoneGap connection types...
+             */
+            
+            var haveCoverage : Boolean = false;
+            var networkStatus : String = "offline";
+			var connectionType = "none";
+
+			NetworkInfo.networkInfo.findInterfaces().some(
+				function callback(item:NetworkInterface, index:int, vector:Vector.<NetworkInterface>):Boolean {
+					this.webView.executeJavaScript("alert('Network Interface ' + item.name)");
+					haveCoverage = item.active || haveCoverage;
+					return haveCoverage;
+				}, this);
+
+			if (haveCoverage) {
+				networkStatus = "online";
+				connectionType = "wifi";
+			}
+            
+            for (var i:Number=0; i<_jsFunctionCallbackIDs.length ; i++){
+                evalJavaScriptEvent(_jsFunctionCallbackIDs[i], [{"type" : connectionType, "event" : networkStatus }] );
+            }
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/framework/ext/src/com/phonegap/PhoneGapExtension.java
----------------------------------------------------------------------
diff --git a/framework/ext/src/com/phonegap/PhoneGapExtension.java b/framework/ext/src/com/phonegap/PhoneGapExtension.java
index 03a994f..a47102d 100644
--- a/framework/ext/src/com/phonegap/PhoneGapExtension.java
+++ b/framework/ext/src/com/phonegap/PhoneGapExtension.java
@@ -4,6 +4,7 @@
  * 
  * Copyright (c) 2005-2010, Nitobi Software Inc.
  * Copyright (c) 2010, IBM Corporation
+ * Copyright (c) 2011, Research In Motion Limited.
  */
 package com.phonegap;
 
@@ -50,14 +51,16 @@ public final class PhoneGapExtension implements WidgetExtension {
     // Plugin Manager
     //
     protected PluginManager pluginManager;
+    
+    // Feature ID
+    //
+    private static final String FEATURE_ID ="com.phonegap";
 
 	// Called when the BlackBerry Widget references this extension for the first time.
 	// It provides a list of feature IDs exposed by this extension.
 	//
 	public String[] getFeatureList() {
-		String[] result = new String[1];
-		result[0] = "phonegap";
-		return result;
+		return new String[] {FEATURE_ID};
 	}
 
     // Called whenever a widget loads a resource that requires a feature ID that is supplied
@@ -68,7 +71,7 @@ public final class PhoneGapExtension implements WidgetExtension {
         script = scriptEngine;
         // Not sure why logger is not already enabled?
         Logger.enableLogging();
-        if (feature.equals("phonegap")) {
+        if (feature.equals(FEATURE_ID)) {
             pluginManager = new PluginManager(this);
 
             // create and parse the plugins.xml
@@ -88,9 +91,8 @@ public final class PhoneGapExtension implements WidgetExtension {
                         plugin.getAttributes().getNamedItem("value").getNodeValue());
             }
 
-            scriptEngine.addExtension("phonegap.device",         new Device());
-            scriptEngine.addExtension("phonegap.PluginManager",  pluginManager);
-            scriptEngine.addExtension("phonegap.Logger",         new Log());
+            scriptEngine.addExtension("com.phonegap.JavaPluginManager",  pluginManager);
+            scriptEngine.addExtension("com.phonegap.Logger",         new Log());
 
             // let PhoneGap JavaScript know that extensions have been loaded
             // if this is premature, we at least set the _nativeReady flag to true

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/framework/ext/src/com/phonegap/device/Device.java
----------------------------------------------------------------------
diff --git a/framework/ext/src/com/phonegap/device/Device.java b/framework/ext/src/com/phonegap/device/Device.java
index 6a9c09c..63820b4 100644
--- a/framework/ext/src/com/phonegap/device/Device.java
+++ b/framework/ext/src/com/phonegap/device/Device.java
@@ -1,39 +1,56 @@
-/*
- * PhoneGap is available under *either* the terms of the modified BSD license *or* the
- * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
- * 
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-package com.phonegap.device;
-
-import net.rim.device.api.script.Scriptable;
-import net.rim.device.api.system.DeviceInfo;
-
-/**
- * Provides device information, including:
- * 
- * - Device platform version (e.g. 2.13.0.95). Not to be confused with BlackBerry OS version.
- * - Unique device identifier (UUID).
- * - PhoneGap software version.
- */
-public final class Device extends Scriptable {
-	public static final String FIELD_PLATFORM = "platform";
-	public static final String FIELD_UUID     = "uuid";
-	public static final String FIELD_PHONEGAP = "phonegap";
-	
-	public Object getField(String name) throws Exception {
-		
-		if (name.equals(FIELD_PLATFORM)) {
-			return new String(DeviceInfo.getPlatformVersion());
-		}
-		else if (name.equals(FIELD_UUID)) {
-			return new Integer(DeviceInfo.getDeviceId());
-		}
-		else if (name.equals(FIELD_PHONEGAP)) {
-			return "1.0.0";
-		}
-		
-		return super.getField(name);
-	}
-}
+/*
+ * PhoneGap is available under *either* the terms of the modified BSD license *or* the
+ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
+ * 
+ * Copyright (c) 2005-2010, Nitobi Software Inc.
+ * Copyright (c) 2010, IBM Corporation
+ * Copyright (c) 2011, Research In Motion Limited.
+ */
+package com.phonegap.device;
+
+import net.rim.device.api.system.DeviceInfo;
+
+import com.phonegap.api.Plugin;
+import com.phonegap.api.PluginResult;
+import com.phonegap.json4j.JSONArray;
+import com.phonegap.json4j.JSONException;
+import com.phonegap.json4j.JSONObject;
+
+/**
+ * Provides device information, including:
+ * 
+ * - Device platform version (e.g. 2.13.0.95). Not to be confused with BlackBerry OS version.
+ * - Unique device identifier (UUID).
+ * - PhoneGap software version.
+ */
+public final class Device extends Plugin {
+
+	public static final String FIELD_PLATFORM 	= "platform";
+	public static final String FIELD_UUID     	= "uuid";
+	public static final String FIELD_PHONEGAP 	= "phonegap";
+	public static final String FIELD_NAME 		= "name";
+	public static final String FIELD_VERSION 	= "version";	
+	
+	public static final String ACTION_GET_DEVICE_INFO = "getDeviceInfo";
+		
+	public PluginResult execute(String action, JSONArray args, String callbackId) {
+		PluginResult result = new PluginResult(PluginResult.Status.INVALIDACTION, "Device: Invalid action:" + action);
+		
+		if(action.equals(ACTION_GET_DEVICE_INFO)){
+			try {
+				JSONObject device = new JSONObject();
+				device.put( FIELD_PLATFORM, new String(DeviceInfo.getPlatformVersion() ) );
+				device.put( FIELD_UUID, new Integer( DeviceInfo.getDeviceId()) );
+				device.put( FIELD_PHONEGAP, "1.0.0" );
+				device.put( FIELD_NAME, new String(DeviceInfo.getDeviceName()) );
+				device.put( FIELD_VERSION, new String(DeviceInfo.getSoftwareVersion()) );
+				result = new PluginResult(PluginResult.Status.OK, device);
+			} catch (JSONException e) {
+				result = new PluginResult(PluginResult.Status.JSONEXCEPTION, e.getMessage());
+			}					
+		}
+		
+		return result;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/framework/ext/src/library.xml
----------------------------------------------------------------------
diff --git a/framework/ext/src/library.xml b/framework/ext/src/library.xml
index 97fee84..244a5dc 100644
--- a/framework/ext/src/library.xml
+++ b/framework/ext/src/library.xml
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<library>
-	<extension>
-		<entryClass>com.phonegap.PhoneGapExtension</entryClass>
-	</extension>
-	<features>
-		<feature id="phonegap" version="1.0.0">PhoneGap JavaScript Extension</feature>
-	</features>
-</library>
+<?xml version="1.0" encoding="UTF-8"?>
+<library>
+	<extension>
+		<entryClass>com.phonegap.PhoneGapExtension</entryClass>
+	</extension>
+	<features>
+		<feature id="com.phonegap" version="1.0.0">PhoneGap JavaScript Extension</feature>
+	</features>
+</library>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/javascript/_phonegap.js
----------------------------------------------------------------------
diff --git a/javascript/_phonegap.js b/javascript/_phonegap.js
index eda4407..85b42dd 100644
--- a/javascript/_phonegap.js
+++ b/javascript/_phonegap.js
@@ -5,6 +5,7 @@
  * 
  * Copyright (c) 2005-2010, Nitobi Software Inc.
  * Copyright (c) 2010-2011, IBM Corporation
+ * Copyright (c) 2011, Research In Motion Limited.
  */
 
 /**
@@ -326,15 +327,17 @@ var PhoneGap = PhoneGap || (function() {
      * Trap BlackBerry WebWorks exit. Fire onPause event, and give PhoneGap
      * extension chance to clean up before exiting.
      */
-    blackberry.app.event.onExit(function() {
-        PhoneGap.onPause.fire();
+     if(blackberry.app.event.onExit) {
+         blackberry.app.event.onExit(function() {
+             PhoneGap.onPause.fire();
 
-        // allow PhoneGap JavaScript Extension opportunity to cleanup
-        phonegap.PluginManager.destroy();
+             // allow PhoneGap JavaScript Extension opportunity to cleanup
+             phonegap.PluginManager.destroy();
         
-        // exit the app
-        blackberry.app.exit();
-    });
+             // exit the app
+             blackberry.app.exit();
+         });
+     }
     
     //--------
     // Plugins
@@ -351,7 +354,7 @@ var PhoneGap = PhoneGap || (function() {
             try {
                 func();
             } catch(e) {
-                if (typeof(debug['log']) == 'function') {
+                if (typeof(debug) != 'undefined' && typeof(debug['log']) == 'function') {
                     debug.log("Failed to run constructor: " + debug.processMessage(e));
                 } else {
                     alert("Failed to run constructor: " + e.message);
@@ -469,17 +472,7 @@ var PhoneGap = PhoneGap || (function() {
      */
     PhoneGap.exec = function(success, fail, service, action, args) {
         try {
-            var callbackId = service + PhoneGap.callbackId++;
-            if (success || fail) {
-                PhoneGap.callbacks[callbackId] = {success:success, fail:fail};
-            }
-            
-            // Note: Device returns string, but for some reason emulator returns object - so convert to string.
-            var r = ""+phonegap.PluginManager.exec(service, action, callbackId, JSON.stringify(args), true);
-            
-            // If a result was returned
-            if (r.length > 0) {
-                eval("var v="+r+";");
+            var v = phonegap.PluginManager.exec(success, fail, service, action, args);
             
                 // If status is OK, then return value back to caller
                 if (v.status == PhoneGap.callbackStatus.OK) {
@@ -493,24 +486,13 @@ var PhoneGap = PhoneGap || (function() {
                             console.log("Error in success callback: "+callbackId+" = "+e);
                         }
 
-                        // Clear callback if not expecting any more results
-                        if (!v.keepCallback) {
-                            delete PhoneGap.callbacks[callbackId];
                         }
-                    }
                     return v.message;
-                }
-                // If no result
-                else if (v.status == PhoneGap.callbackStatus.NO_RESULT) {
+            }else if (v.status == PhoneGap.callbackStatus.NO_RESULT){
                         
-                    // Clear callback if not expecting any more results
-                    if (!v.keepCallback) {
-                        delete PhoneGap.callbacks[callbackId];
-                    }
-                }
+            }else {
                 // If error, then display error
-                else {
-                    console.log("Error: Status="+r.status+" Message="+v.message);
+                console.log("Error: Status="+v.status+" Message="+v.message);
 
                     // If there is a fail callback, then call it now with returned value
                     if (fail) {
@@ -520,15 +502,9 @@ var PhoneGap = PhoneGap || (function() {
                         catch (e) {
                             console.log("Error in error callback: "+callbackId+" = "+e);
                         }
-
-                        // Clear callback if not expecting any more results
-                        if (!v.keepCallback) {
-                            delete PhoneGap.callbacks[callbackId];
-                        }
                     }
                     return null;
                 }
-            }
         } catch (e) {
             console.log("Error: "+e);
         }

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/javascript/blackberry/blackberryPluginManager.js
----------------------------------------------------------------------
diff --git a/javascript/blackberry/blackberryPluginManager.js b/javascript/blackberry/blackberryPluginManager.js
new file mode 100644
index 0000000..66ef215
--- /dev/null
+++ b/javascript/blackberry/blackberryPluginManager.js
@@ -0,0 +1,112 @@
+
+/*
+ * PhoneGap is available under *either* the terms of the modified BSD license *or* the
+ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
+ *
+ * Copyright (c) 2011, Research In Motion Limited.
+ */
+
+window.phonegap.PluginManager = (function (webworksPluginManager) {
+    "use strict";
+
+    var retInvalidAction = { "status" : PhoneGap.callbackStatus.INVALID_ACTION, "message" : "Action not found" },
+
+        loggerAPI = {
+            execute: function (webWorksResult, action, args, win, fail) {
+                switch (action) {
+                case 'log':
+                    com.phonegap.Logger.log(args);
+                    return {"status" : PhoneGap.callbackStatus.OK,
+                            "message" : 'Message logged to console: ' + args};
+                }
+                return retInvalidAction;
+            }
+        },
+        plugins = {'Logger': loggerAPI};
+
+    phonegap.BlackBerryPluginManager = function () {
+    };
+
+    phonegap.BlackBerryPluginManager.prototype.exec = function (win, fail, clazz, action, args) {
+        var result = webworksPluginManager.exec(win, fail, clazz, action, args);
+
+        //We got a sync result or a not found from WW that we can pass on to get a native mixin
+        //For async calls there's nothing to do
+        if (result.status === PhoneGap.callbackStatus.CLASS_NOT_FOUND_EXCEPTION  ||
+                result.status === PhoneGap.callbackStatus.INVALID_ACTION ||
+                result.status === PhoneGap.callbackStatus.OK) {
+            if (plugins[clazz]) {
+                return plugins[clazz].execute(result.message, action, args, win, fail);
+            } else {
+                result = this.subExec(win, fail, clazz, action, args);
+            }
+        }
+
+        return result;
+    };
+
+    phonegap.BlackBerryPluginManager.prototype.subExec = function (win, fail, clazz, action, args) {
+        var callbackId = clazz + PhoneGap.callbackId++,
+            origResult,
+            evalResult,
+            execResult;
+
+        try {
+
+            if (win || fail) {
+                PhoneGap.callbacks[callbackId] = {success: win, fail: fail};
+            }
+
+            // Note: Device returns string, but for some reason emulator returns object - so convert to string.
+            origResult = "" + com.phonegap.JavaPluginManager.exec(clazz, action, callbackId, JSON.stringify(args), true);
+
+            // If a result was returned
+            if (origResult.length > 0) {
+                eval("evalResult = " + origResult + ";");
+
+                // If status is OK, then return evalResultalue back to caller
+                if (evalResult.status === PhoneGap.callbackStatus.OK) {
+
+                    // If there is a success callback, then call it now with returned evalResultalue
+                    if (win) {
+                        // Clear callback if not expecting any more results
+                        if (!evalResult.keepCallback) {
+                            delete PhoneGap.callbacks[callbackId];
+                        }
+                    }
+                } else if (evalResult.status === PhoneGap.callbackStatus.NO_RESULT) {
+
+                    // Clear callback if not expecting any more results
+                    if (!evalResult.keepCallback) {
+                        delete PhoneGap.callbacks[callbackId];
+                    }
+                } else {
+                    console.log("Error: Status=" + evalResult.status + " Message=" + evalResult.message);
+
+                    // If there is a fail callback, then call it now with returned evalResultalue
+                    if (fail) {
+
+                        // Clear callback if not expecting any more results
+                        if (!evalResult.keepCallback) {
+                            delete PhoneGap.callbacks[callbackId];
+                        }
+                    }
+                }
+                execResult = evalResult;
+            }
+        } catch (e) {
+            console.log("BlackBerryPluginManager Error: " + e);
+            execResult = {"status" : PhoneGap.callbackStatus.ERROR,
+                          "message" : e.message};
+        }
+
+        return execResult;
+    };
+
+    phonegap.BlackBerryPluginManager.prototype.resume = com.phonegap.JavaPluginManager.resume;
+    phonegap.BlackBerryPluginManager.prototype.pause = com.phonegap.JavaPluginManager.pause;
+    phonegap.BlackBerryPluginManager.prototype.destroy = com.phonegap.JavaPluginManager.destroy;
+
+    //Instantiate it
+    return new phonegap.BlackBerryPluginManager();
+}(new phonegap.WebWorksPluginManager()));
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/javascript/capture.js
----------------------------------------------------------------------
diff --git a/javascript/capture.js b/javascript/capture.js
new file mode 100644
index 0000000..2bfe1a2
--- /dev/null
+++ b/javascript/capture.js
@@ -0,0 +1,380 @@
+
+/*
+ * PhoneGap is available under *either* the terms of the modified BSD license *or* the
+ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
+ * 
+ * Copyright (c) 2005-2011, Nitobi Software Inc.
+ * Copyright (c) 2011, IBM Corporation
+ * Copyright (c) 2011, Research In Motion Limited 
+ */
+
+/**
+ * MediaFileData error.
+ */
+function MediaFileDataError() {
+    this.code = 0;
+};
+
+MediaFileDataError.UNKNOWN_ERROR = 0;
+MediaFileDataError.TIMEOUT_ERROR = 1;
+
+/**
+ * Represents media file properties.
+ */
+var MediaFile = MediaFile || (function() {
+    /**
+     * Constructor.
+     */
+    function MediaFile() {
+        MediaFile.__super__.constructor.apply(this, arguments);
+    };
+ 
+    // extend File
+    PhoneGap.extend(MediaFile, File);
+    
+    /**
+     * Media file data.
+     * codecs {DOMString} The actual format of the audio and video content.
+     * bitrate {Number} The average bitrate of the content. In the case of an image, this attribute has value 0.
+     * height {Number} The height of the image or video in pixels. In the case of a sound clip, this attribute has value 0.
+     * width {Number The width of the image or video in pixels. In the case of a sound clip, this attribute has value 0.
+     * duration {Number} The length of the video or sound clip in seconds. In the case of an image, this attribute has value 0.
+     */
+    function MediaFileData() {
+        this.codecs = null;
+        this.bitrate = 0;
+        this.height = 0;
+        this.width = 0;
+        this.duration = 0;
+    };
+    
+    /**
+     * Obtains the format data of the media file.
+     */
+    MediaFile.prototype.getFormatData = function(successCallback, errorCallback) {
+        // there is no API (WebWorks or native) that provides this info
+        try {
+            successCallback(new MediaFileData());
+        } 
+        catch (e) {
+            console.log('Unable to invoke success callback: ' + e);
+        }
+    };
+    
+    return MediaFile;
+}());
+
+/**
+ * Media capture error.
+ */
+function CaptureError() {
+    this.code = 0;
+};
+
+// Camera or microphone failed to capture image or sound. 
+CaptureError.CAPTURE_INTERNAL_ERR = 0;
+// Camera application or audio capture application is currently serving other capture request.
+CaptureError.CAPTURE_APPLICATION_BUSY = 1;
+// Invalid use of the API (e.g. limit parameter has value less than one).
+CaptureError.CAPTURE_INVALID_ARGUMENT = 2;
+// User exited camera application or audio capture application before capturing anything.
+CaptureError.CAPTURE_NO_MEDIA_FILES = 3;
+// The requested capture operation is not supported.
+CaptureError.CAPTURE_NOT_SUPPORTED = 20;
+
+/**
+ * Encapsulates a set of parameters that the capture device supports.
+ */
+function ConfigurationData() {
+    // The ASCII-encoded string in lower case representing the media type. 
+    this.type; 
+    // The height attribute represents height of the image or video in pixels. 
+    // In the case of a sound clip this attribute has value 0. 
+    this.height = 0;
+    // The width attribute represents width of the image or video in pixels. 
+    // In the case of a sound clip this attribute has value 0
+    this.width = 0;
+};
+
+/**
+ * Encapsulates all image capture operation configuration options.
+ */
+function CaptureImageOptions() {
+    // Upper limit of images user can take. Value must be equal or greater than 1.
+    this.limit = 1; 
+    // The selected image mode. Must match with one of the elements in supportedImageModes array.
+    this.mode; 
+};
+
+/**
+ * Encapsulates all video capture operation configuration options.
+ */
+function CaptureVideoOptions() {
+    // Upper limit of videos user can record. Value must be equal or greater than 1.
+    this.limit = 1;
+    // Maximum duration of a single video clip in seconds.
+    this.duration;
+    // The selected video mode. Must match with one of the elements in supportedVideoModes array.
+    this.mode;
+};
+
+/**
+ * Encapsulates all audio capture operation configuration options.
+ */
+function CaptureAudioOptions() {
+    // Upper limit of sound clips user can record. Value must be equal or greater than 1.
+    this.limit = 1;
+    // Maximum duration of a single sound clip in seconds.
+    this.duration;
+    // The selected audio mode. Must match with one of the elements in supportedAudioModes array.
+    this.mode;
+};
+
+/**
+ * navigator.device.capture 
+ */
+(function() {
+    /**
+     * Check that navigator.device.capture has not been initialized.
+     */
+    if (navigator.device && typeof navigator.device.capture !== 'undefined') {
+        return;
+    }
+    
+    /**
+     * Identification string for the capture plugin.
+     */
+    var captureId = 'navigator.device.capture';
+    
+    /**
+     * Media capture object.
+     */
+    function Capture() {
+        var self = this, 
+            // let PhoneGap know we're ready after retrieving all of the 
+            // supported capture modes         
+            addCaptureModes = function(type, modes) {
+                self[type] = modes;
+                if (typeof self.supportedAudioModes !== 'undefined' 
+                    && typeof self.supportedImageModes !== 'undefined'
+                    && typeof self.supportedVideoModes !== 'undefined') {
+                    PhoneGap.initializationComplete(captureId);                    
+                }
+            };
+        
+        // populate supported capture modes
+        PhoneGap.exec(function(modes) {
+            addCaptureModes('supportedAudioModes', parseArray(modes));
+        }, function(error) {
+            console.log('Unable to retrieve supported audio modes: ' + error);
+            addCaptureModes('supportedAudioModes', []);
+        }, 'MediaCapture', 'getSupportedAudioModes', []); 
+        
+        PhoneGap.exec(function(modes) {
+            addCaptureModes('supportedImageModes', parseArray(modes));
+        }, function(error) {
+            console.log('Unable to retrieve supported image modes: ' + error);
+            addCaptureModes('supportedImageModes', []);
+        }, 'MediaCapture', 'getSupportedImageModes', []); 
+        
+        PhoneGap.exec(function(modes) {
+            addCaptureModes('supportedVideoModes', parseArray(modes));
+        }, function(error) {
+            console.log('Unable to retrieve supported video modes: ' + error);
+            addCaptureModes('supportedVideoModes', []);
+        }, 'MediaCapture', 'getSupportedVideoModes', []); 
+    };
+    
+    /**
+     * Utility function to parse JSON array.
+     */
+    var parseArray = function(array) {
+        var result = [];
+
+        // get objects from JSONArray
+        try {
+            result = JSON.parse(array);
+        }
+        catch (e) {
+            console.log('unable to parse JSON: ' + e);
+            return result;
+        }
+        
+        return result;
+    };
+    
+    /**
+     * Utility function to create MediaFile objects from JSON.
+     */
+    var getMediaFiles = function(array) {
+        var mediaFiles = [], file, objs, obj, len, i, j;
+        
+        objs = parseArray(array);
+        for (i = 0; len = objs.length, i < len; i += 1) {
+            obj = objs[i];
+            file = new MediaFile();
+            for (j in obj) {
+                file[j] = obj[j];
+            }
+            mediaFiles.push(file);
+        }
+        
+        return mediaFiles;
+    };
+    
+    /**
+     * Static method for invoking error callbacks.
+     * 
+     * @param error         CaptureError code
+     * @param errorCallback error callback to invoke
+     */
+    Capture.onError = function(error, errorCallback) {
+        var err = new CaptureError();
+        err.code = error;
+        try {
+            errorCallback(err);
+        } catch (e) {
+            console.log('Error invoking callback: ' + e);
+        }
+    };
+
+    /**
+     * Launch camera application and start an operation to record images.
+     * 
+     * @param successCallback
+     *            invoked with a list of MediaFile objects containing captured
+     *            image file properties
+     * @param errorCallback
+     *            invoked with a CaptureError if capture is unsuccessful
+     * @param options
+     *            {CaptureVideoOptions} options for capturing video
+     */
+    Capture.prototype.captureImage = function(successCallback, errorCallback, options) {
+        var limit = 1,
+            mode = null;
+
+        if (options) {
+            if (typeof options.limit === 'number' && options.limit > limit) {
+                limit = options.limit;
+            }
+            if (options.mode) { 
+                mode = options.mode;
+            }
+        }
+        
+        PhoneGap.exec(
+            function(mediaFiles) {
+                successCallback(getMediaFiles(mediaFiles));
+            }, 
+            function(error) {
+                Capture.onError(error, errorCallback);
+            }, 
+            'MediaCapture', 
+            'captureImage', 
+            [limit, mode]
+        );         
+    };
+    
+    /**
+     * Launch video recorder application and start an operation to record video
+     * clips.
+     * 
+     * @param successCallback
+     *            invoked with a list of MediaFile objects containing captured
+     *            video file properties
+     * @param errorCallback
+     *            invoked with a CaptureError if capture is unsuccessful
+     * @param options
+     *            {CaptureVideoOptions} options for capturing video
+     */
+    Capture.prototype.captureVideo = function(successCallback, errorCallback, options) { 
+        var limit = 1,
+            duration = 0,
+            mode = null;
+
+        if (options) {
+            if (typeof options.limit === 'number' && options.limit > limit) {
+                limit = options.limit;
+            }
+            if (typeof options.duration === 'number' && options.duration > 0) {
+                duration = options.duration;
+            }   
+            if (options.mode) { 
+                mode = options.mode;
+            }
+        }
+        
+        PhoneGap.exec(
+            function(mediaFiles) {
+                successCallback(getMediaFiles(mediaFiles));
+            }, 
+            function(error) {
+                Capture.onError(error, errorCallback);
+            },
+            'MediaCapture',
+            'captureVideo',
+            [limit, duration, mode]);         
+    };
+
+    /**
+     * Launch audio recorder application and start an operation to record audio
+     * clip(s).
+     * param
+     * @param successCallback
+     *            invoked with a list of MediaFile objects containing captured
+     *            audio file properties
+     * @param errorCallback
+     *            invoked with a CaptureError if capture is unsuccessful
+     * @param options
+     *            {CaptureAudioOptions} options for capturing audio
+     */
+    Capture.prototype.captureAudio = function(successCallback, errorCallback, options) { 
+        var limit = 1, 
+            duration = 0,
+            mode = null;
+        
+        if (options) {
+            if (typeof options.limit === 'number' && options.limit > limit) {
+                limit = options.limit;
+            }
+            if (typeof options.duration === 'number' && options.duration > 0) {
+                duration = options.duration;
+            }   
+            if (options.mode) { 
+                mode = options.mode;
+            }
+        }   
+        
+        PhoneGap.exec(
+           function(mediaFiles) {
+                successCallback(getMediaFiles(mediaFiles));
+            }, 
+            function(error) {
+                Capture.onError(error, errorCallback);
+            },
+            'MediaCapture',
+            'captureAudio',
+            [limit, duration, mode]);         
+    };
+    
+    /**
+     * Cancels all pending capture operations.
+     */
+    Capture.prototype.cancelCaptures = function() { 
+        PhoneGap.exec(null, null, 'MediaCapture', 'stopCaptures', []);
+    }
+    
+    /**
+     * Define navigator.device.capture object.
+     */
+    PhoneGap.addConstructor(function() {
+        PhoneGap.waitForInitialization(captureId);
+		
+        //No way to guarantee order of constructors so just incase this goes first
+		if (typeof navigator.device === 'undefined') {
+            navigator.device = {};
+        }
+		
+        navigator.device.capture = new Capture();
+    });
+}());

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/javascript/console.js
----------------------------------------------------------------------
diff --git a/javascript/console.js b/javascript/console.js
index 197d184..c4b5fdf 100644
--- a/javascript/console.js
+++ b/javascript/console.js
@@ -5,21 +5,38 @@
  * 
  * Copyright (c) 2005-2010, Nitobi Software Inc.
  * Copyright (c) 2010-2011, IBM Corporation
+ * Copyright (c) 2011, Research In Motion Limited
  */
 
-/**
- * phonegap.Logger is a Blackberry WebWorks extension that will log to the 
- * BB Event Log and System.out.  Comment this line to disable.
- */ 
-phonegap.Logger.enable();
+(function () {
+    "use strict";
 
-/**
- * If Blackberry doesn't define a console object, we create our own.
- * console.log will use phonegap.Logger to log to BB Event Log and System.out.
- */
-if (typeof console == "undefined") {    
-    console = {};
-}
-console.log = function(msg) {
-    phonegap.Logger.log(''+msg);
-};
+    function Logger() {
+        if (typeof (phonegap.Logger) !== 'undefined') {
+            return;
+        }
+
+        /**
+         * If Blackberry doesn't define a console object, we create our own.
+         * console.log will use phonegap.Logger to log to BB Event Log and System.out.
+         */
+        if (typeof console === "undefined") {
+            console = { log :
+                function (msg) {
+                    PhoneGap.exec(null, null, 'Logger', 'log', msg);
+                }
+                };
+        }
+    }
+
+    Logger.prototype.log = function (msg) {
+        PhoneGap.exec(null, null, 'Logger', 'log', msg);
+    };
+
+    /**
+     * Define phonegap.Logger object where the BB API expects to see it
+     */
+    PhoneGap.addConstructor(function () {
+        phonegap.Logger = new Logger();
+    });
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/javascript/device.js
----------------------------------------------------------------------
diff --git a/javascript/device.js b/javascript/device.js
index 6d03cae..17575c4 100644
--- a/javascript/device.js
+++ b/javascript/device.js
@@ -1,10 +1,12 @@
 
+
 /*
  * PhoneGap is available under *either* the terms of the modified BSD license *or* the
  * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
  * 
  * Copyright (c) 2005-2010, Nitobi Software Inc.
  * Copyright (c) 2010-2011, IBM Corporation
+ * Copyright (c) 2011, Research In Motion Limited.
  */
 
 /**
@@ -13,22 +15,39 @@
  * Represents the mobile device, and provides properties for inspecting the
  * model, version, UUID of the phone, etc.
  */
-(function() {
+(function () {
+    "use strict";
+
     /**
      * @constructor
      */
     function Device() {
-        this.platform = phonegap.device.platform;
-        this.version  = blackberry.system.softwareVersion;
-        this.name     = blackberry.system.model;
-        this.uuid     = phonegap.device.uuid;
-        this.phonegap = phonegap.device.phonegap;
-    };
+        var me = this;
+
+        PhoneGap.exec(
+            function (device) {
+                me.platform = device.platform;
+                me.version  = device.version;
+                me.name     = device.name;
+                me.uuid     = device.uuid;
+                me.phonegap = device.phonegap;
+            },
+            function (e) {
+                console.log("Error initializing PhoneGap: " + e);
+            }, 
+            "Device", 
+            "getDeviceInfo", 
+            []
+        );
+
+    }
 
     /**
      * Define navigator.device.
      */
-    PhoneGap.addConstructor(function() {
+    PhoneGap.addConstructor(function () {
+        var key;
+
         window.device = new Device();
 
         /* Newer BlackBerry 6 devices now define `navigator.device` */
@@ -37,7 +56,7 @@
         }
 
         /* Add PhoneGap device properties */
-        for (var key in window.device) {
+        for (key in window.device) {
             navigator.device[key] = window.device[key];
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/javascript/playbook/playBookPluginManager.js
----------------------------------------------------------------------
diff --git a/javascript/playbook/playBookPluginManager.js b/javascript/playbook/playBookPluginManager.js
new file mode 100644
index 0000000..55449a6
--- /dev/null
+++ b/javascript/playbook/playBookPluginManager.js
@@ -0,0 +1,239 @@
+
+
+/*
+ * PhoneGap is available under *either* the terms of the modified BSD license *or* the
+ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
+ *
+ * Copyright (c) 2011, Research In Motion Limited.
+ */
+
+phonegap.PluginManager = (function (webworksPluginManager) {
+    "use strict";
+
+    /**
+     * Private list of HTML 5 audio objects, indexed by the PhoneGap media object ids
+     */
+    var audioObjects = {},
+        retInvalidAction = { "status" : PhoneGap.callbackStatus.INVALID_ACTION, "message" : "Action not found" },
+        retAsyncCall = { "status" : PhoneGap.callbackStatus.NO_RESULT, "message" : "WebWorks Is On It" },
+        deviceAPI = {
+            execute: function (webWorksResult, action, args, win, fail) {
+                if (action === 'getDeviceInfo') {
+                    return {"status" : PhoneGap.callbackStatus.OK,
+                            "message" : {"version" : blackberry.system.softwareVersion,
+                            "name" : blackberry.system.model,
+                            "uuid" : blackberry.identity.PIN,
+                            "platform" : "PlayBook",
+                            "phonegap" : "1.0.0rc1"}};
+                }
+                return retInvalidAction;
+            }
+        },
+        loggerAPI = {
+            execute: function (webWorksResult, action, args, win, fail) {
+                switch (action) {
+                case 'log':
+                    console.log(args);
+                    return {"status" : PhoneGap.callbackStatus.OK,
+                            "message" : 'Message logged to console: ' + args};
+                }
+                return retInvalidAction;
+            }
+        },
+        mediaAPI = {
+            execute: function (action, args, win, fail) {
+                if (!args.length) {
+                    return {"status" : 9, "message" : "Media Object id was not sent in arguments"};
+                }
+
+                var id = args[0],
+                    audio = audioObjects[id],
+                    result;
+
+                switch (action) {
+                case 'startPlayingAudio':
+                    if (args.length === 1) {
+                        result = {"status" : 9, "message" : "Media source argument not found"};
+
+                    }
+
+                    if (audio) {
+                        audio.pause();
+                        audioObjects[id] = undefined;
+                    }
+
+                    audio = audioObjects[id] = new Audio(args[1]);
+                    audio.play();
+
+                    result = {"status" : 1, "message" : "Audio play started" };
+                    break;
+                case 'stopPlayingAudio':
+                    if (!audio) {
+                        return {"status" : 2, "message" : "Audio Object has not been initialized"};
+                    }
+
+                    audio.pause();
+                    audioObjects[id] = undefined;
+
+                    result = {"status" : 1, "message" : "Audio play stopped" };
+                    break;
+                case 'seekToAudio':
+                    if (!audio) {
+                        result = {"status" : 2, "message" : "Audio Object has not been initialized"};
+                    } else if (args.length === 1) {
+                        result = {"status" : 9, "message" : "Media seek time argument not found"};
+                    } else {
+                        try {
+                            audio.currentTime = args[1];
+                        } catch (e) {
+                            console.log('Error seeking audio: ' + e);
+                            return {"status" : 3, "message" : "Error seeking audio: " + e};
+                        }
+
+                        result = {"status" : 1, "message" : "Seek to audio succeeded" };
+                    }
+                    break;
+                case 'pausePlayingAudio':
+                    if (!audio) {
+                        return {"status" : 2, "message" : "Audio Object has not been initialized"};
+                    }
+
+                    audio.pause();
+
+                    result = {"status" : 1, "message" : "Audio paused" };
+                    break;
+                case 'getCurrentPositionAudio':
+                    if (!audio) {
+                        return {"status" : 2, "message" : "Audio Object has not been initialized"};
+                    }
+
+                    result = {"status" : 1, "message" : audio.currentTime };
+                    break;
+                case 'getDuration':
+                    if (!audio) {
+                        return {"status" : 2, "message" : "Audio Object has not been initialized"};
+                    }
+
+                    result = {"status" : 1, "message" : audio.duration };
+                    break;
+                case 'startRecordingAudio':
+                    if (args.length <= 1) {
+                        result = {"status" : 9, "message" : "Media start recording, insufficient arguments"};
+                    }
+
+                    blackberry.media.microphone.record(args[1], win, fail);
+                    result = retAsyncCall;
+                    break;
+                case 'stopRecordingAudio':
+                    break;
+                case 'release':
+                    if (audio) {
+                        audioObjects[id] = undefined;
+						audio.src = undefined;
+                        //delete audio;
+                    }
+
+                    result = {"status" : 1, "message" : "Media resources released"};
+                    break;
+                default:
+                    result = retInvalidAction;
+                }
+
+                return result;
+            }
+        },
+
+        networkAPI = {
+            execute: function (webWorksResult, action, args, win, fail) {
+                var connectionType = Connection.NONE,
+                    eventType = "offline",
+                    callbackID,
+                    request;
+
+                /**
+                 * For PlayBooks, we currently only have WiFi connections, so return WiFi if there is
+                 * any access at all.
+                 * TODO: update if/when PlayBook gets other connection types...
+                 */
+                switch (action) {
+                case 'getConnectionInfo':
+                    if (blackberry.system.hasDataCoverage()) {
+                        connectionType = Connection.WIFI;
+                        eventType = "online";
+                    }
+
+                    //Register an event handler for the networkChange event
+                    callbackID = blackberry.events.registerEventHandler("networkChange", win);
+
+                    //pass our callback id down to our network extension
+                    request = new blackberry.transport.RemoteFunctionCall("com/phonegap/getConnectionInfo");
+                    request.addParam("networkStatusChangedID", callbackID);
+                    request.makeSyncCall();
+
+                    return { "status": PhoneGap.callbackStatus.OK, "message": {"type": connectionType, "event": eventType } };
+                }
+                return retInvalidAction;
+            }
+        },
+
+        notificationAPI = {
+            execute: function (webWorksResult, action, args, win, fail) {
+				if (args.length !== 3) {
+					return {"status" : 9, "message" : "Notification action - " + action + " arguments not found"};
+
+				}
+				
+				//Unpack and map the args
+                var msg = args[0],
+                    title = args[1],
+					btnLabel = args[2],
+					btnLabels;
+
+                switch (action) {
+                case 'alert':
+                    blackberry.ui.dialog.customAskAsync.apply(this, [ msg, [ btnLabel ], win, { "title" : title } ]);
+                    return retAsyncCall;
+                case 'confirm':
+                    btnLabels = btnLabel.split(",");
+                    blackberry.ui.dialog.customAskAsync.apply(this, [msg, btnLabels, win, {"title" : title} ]);
+                    return retAsyncCall;
+                }
+                return retInvalidAction;
+
+            }
+        },
+
+
+        plugins = {
+            'Device' : deviceAPI,
+            'Logger' : loggerAPI,
+            'Media' : mediaAPI,
+            'Network Status' : networkAPI,
+            'Notification' : notificationAPI
+        };
+
+    phonegap.PlayBookPluginManager = function () {
+        PhoneGap.onNativeReady.fire();
+    };
+
+    phonegap.PlayBookPluginManager.prototype.exec = function (win, fail, clazz, action, args) {
+        var wwResult = webworksPluginManager.exec(win, fail, clazz, action, args);
+
+        //We got a sync result or a not found from WW that we can pass on to get a native mixin
+        //For async calls there's nothing to do
+        if ((wwResult.status === PhoneGap.callbackStatus.OK || 
+		        wwResult.status === PhoneGap.callbackStatus.CLASS_NOT_FOUND_EXCEPTION) &&
+			    plugins[clazz]) {
+            return plugins[clazz].execute(wwResult.message, action, args, win, fail);
+        }
+
+        return wwResult;
+    };
+
+    phonegap.PlayBookPluginManager.prototype.resume = function () {};
+    phonegap.PlayBookPluginManager.prototype.pause = function () {};
+    phonegap.PlayBookPluginManager.prototype.destroy = function () {};
+
+    //Instantiate it
+    return new phonegap.PlayBookPluginManager();
+}(new phonegap.WebWorksPluginManager()));

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ef539d3e/javascript/webWorksPluginManager.js
----------------------------------------------------------------------
diff --git a/javascript/webWorksPluginManager.js b/javascript/webWorksPluginManager.js
new file mode 100644
index 0000000..469cd30
--- /dev/null
+++ b/javascript/webWorksPluginManager.js
@@ -0,0 +1,91 @@
+
+/*
+ * PhoneGap is available under *either* the terms of the modified BSD license *or* the
+ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
+ *
+ * Copyright (c) 2011, Research In Motion Limited.
+ */
+ 
+ //BlackBerry attaches the Java plugin manager at phonegap.PluginManager, we go to the same
+//spot for compatibility
+if (!window.phonegap) { window.phonegap = {}; }
+
+(function () {
+    "use strict";
+    var retAsyncCall = { "status" : PhoneGap.callbackStatus.NO_RESULT, "message" : "WebWorks Is On It" },
+        retInvalidAction = { "status" : PhoneGap.callbackStatus.INVALID_ACTION, "message" : "Action not found" },
+
+        cameraAPI = {
+            execute: function (action, args, win, fail) {
+                switch (action) {
+                case 'takePicture':
+                    blackberry.media.camera.takePicture(win, fail, fail);
+                    return retAsyncCall;
+                }
+                return retInvalidAction;
+            }
+        },
+
+        mediaCaptureAPI = {
+            execute: function (action, args, win, fail) {
+                var limit = args[0],
+                    pictureFiles = [],
+                    captureMethod;
+
+                function captureCB(filePath) {
+                    var mediaFile;
+
+                    if (filePath) {
+                        mediaFile = new MediaFile();
+                        mediaFile.fullPath = filePath;
+                        pictureFiles.push(mediaFile);
+                    }
+
+                    if (limit > 0) {
+                        limit--;
+                        blackberry.media.camera[captureMethod](win, fail, fail);
+                        return;
+                    }
+
+                    win(pictureFiles);
+
+                    return retAsyncCall;
+                }
+
+                switch (action) {
+                case 'getSupportedAudioModes':
+                case 'getSupportedImageModes':
+                case 'getSupportedVideoModes':
+                    return {"status": PhoneGap.callbackStatus.OK, "message": []};
+                case 'captureImage':
+                    captureMethod = "takePicture";
+                    captureCB();
+                    break;
+                case 'captureVideo':
+                    captureMethod = "takeVideo";
+                    captureCB();
+                    break;
+                case 'captureAudio':
+                    return {"status": PhoneGap.callbackStatus.INVALID_ACTION, "message": "captureAudio is not currently supported"};
+                }
+
+                return retAsyncCall;
+            }
+        },
+
+        plugins = {
+            'Camera' : cameraAPI,
+            'MediaCapture' : mediaCaptureAPI
+        };
+
+	phonegap.WebWorksPluginManager = function () {
+	};
+
+    phonegap.WebWorksPluginManager.prototype.exec = function (win, fail, clazz, action, args) {
+        if (plugins[clazz]) {
+            return plugins[clazz].execute(action, args, win, fail);
+        }
+
+        return {"status" : PhoneGap.callbackStatus.CLASS_NOT_FOUND_EXCEPTION, "message" : "Class " + clazz + " cannot be found"};
+    };
+}());


Mime
View raw message