Fixed hyperlinks on getting started and plugin dev guides for bb10
Conflicts:
docs/en/edge/guide/getting-started/blackberry10/index.md
docs/en/edge/guide/plugin-development/blackberry10/index.md
docs/en/edge/guide/plugin-development/index.md
Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/8dd23dbb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/8dd23dbb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/8dd23dbb
Branch: refs/heads/master
Commit: 8dd23dbbd4f02748ae6431f3d50ff4ca4b43af48
Parents: 5328766
Author: jkeshavarzi <[email protected]>
Authored: Mon May 13 13:25:20 2013 -0400
Committer: lorinbeer <[email protected]>
Committed: Mon May 13 21:52:07 2013 -0700
----------------------------------------------------------------------
.../guide/getting-started/blackberry10/index.md | 81 ++++++
.../getting-started/blackberry10/index.md.orig | 195 +++++++++++++++
docs/en/edge/guide/getting-started/index.md | 1 +
.../guide/plugin-development/blackberry10/index.md | 5 +
.../plugin-development/blackberry10/index.md.orig | 188 ++++++++++++++
docs/en/edge/guide/plugin-development/index.md | 4 +
6 files changed, 474 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8dd23dbb/docs/en/edge/guide/getting-started/blackberry10/index.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/getting-started/blackberry10/index.md
b/docs/en/edge/guide/getting-started/blackberry10/index.md
index d172b46..69482fc 100644
--- a/docs/en/edge/guide/getting-started/blackberry10/index.md
+++ b/docs/en/edge/guide/getting-started/blackberry10/index.md
@@ -20,7 +20,11 @@ license: Licensed to the Apache Software Foundation (ASF)
under one
Getting Started with BlackBerry 10
==================================
+<<<<<<< HEAD
Apache Cordova is an application development platform that allows you to use
common web technologies�primarily HTML5, JavaScript, and CSS�to create
applications for mobile devices. Cordova uses a standard set of APIs to access
common device features. Additional plugins allow you to access BlackBerry
specific APIs, so that you can extend your application to tightly integrate
with the BlackBerry 10 OS.
+=======
+Apache Cordova is an application development platform that allows you to use
common web technologies-�primarily HTML5, JavaScript, and CSS�-to create
applications for mobile devices. Cordova uses a standard set of APIs to access
common device features. Additional plugins allow you to access BlackBerry
specific APIs, so that you can extend your application to tightly integrate
with the BlackBerry 10 OS.
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
Requirements
------------
@@ -34,7 +38,11 @@ Cordova for BlackBerry has the following software
requirements:
Setting up your signing keys
----------------------------
+<<<<<<< HEAD
Before starting development, you�ll need to register for your code signing
key and debug token. The signing key allows you to sign your completed app so
that you can distribute it through BlackBerry World. The debug token allows you
to test an unsigned app on a BlackBerry 10 device. You do not need to create
and install the debug token yourself; if you supply the keystore password, the
build script will create and install the debug token for you.
+=======
+Before starting development, you�ll need to register for your code signing
key and debug token. The signing key allows you to sign your completed app so
that you can distribute it through BlackBerry World. The debug token allows
you to test an unsigned app on a BlackBerry 10 device. You do not need to
create and install the debug token yourself, however; if you supply the
keystore password, the build script will create and install the debug token for
you.
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
- [Register for your code signing key
now.](https://www.blackberry.com/SignedKeys/codesigning.html)
- [Set your computer up for code signing.
](http://developer.blackberry.com/html5/documentation/set_up_for_signing.html)
@@ -47,11 +55,56 @@ To create a new project, you use the `create` command to
set up the folder struc
1. On the command line, navigate to the folder where you extracted Cordova.
2. Run the `create` command using the following syntax:
+<<<<<<< HEAD
```
bin/create <path-to-project>
```
This command creates the folder structure for your project at the specified
location. All of your project resource files should be stored in the
*<path-to-project>*/www folder, or in a subfolder within it.
+=======
+ ```bin/create <path-to-project>```
+
+This command creates the folder structure for your project at the specified
location. All of your project resource files should be stored in the
*<path-to-project>*/www folder, or in a subfolder within it.
+
+Adding and managing plugins
+---------------------------
+
+To add additional functionality that is outside of the core features of
Cordova, you�ll need to add plugins. A plugin represents a set of APIs that
provide access to additional features of the platform. For example, the
`com.blackberry.bbm.platform` plugin allows you to integrate your app with
features of the BBM social platform.
+
+In order to use a plugin, you must first install it into your project. Once
installed into your project, the plugin will be bundled with your project
during the build process, to ensure that your app has access to all the APIs it
needs.
+
+Plugins hosted locally must be fetched before they can be installed. Plugins
hosted remotely can simply be installed.
+
+###Fetch a locally-hosted plugin
+
+To fetch a locally-hosted plugin, on the command line, type the following
command:
+
+```<path-to-project>/cordova/plugin fetch <path-to-plugin>
+```
+
+Once fetched, the plugin can be installed by name, just as a remotely hosted
plugin.
+
+###View a list of remote plugins
+
+To view a list of remotely hosted plugins, on the command line, type the
following command:
+
+```<path-to-project>/cordova/plugin ls
+```
+
+###Install a plugin
+
+To install a plugin, on the command line, type the following command:
+
+```<path-to-project>/cordova/plugin add <name>
+```
+
+###Remove a plugin
+
+To remove a plugin, on the command line, type the following command:
+
+```<path-to-project>/cordova/plugin rm <name>
+```
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
Adding and managing targets
---------------------------
@@ -68,10 +121,17 @@ To add a target, on the command line, type the following
command:
where
+<<<<<<< HEAD
- `<name>` specifies a unique name for the target.
- `<ip-address>` specifies the ip address of the BlackBerry device or
simulator.
- `-p|--password <password>` specifies the password for the device or
simulator. This is required only if the device or simulator is password
protected.
- `--pin <device-pin>` specifies the PIN of the BlackBerry device, which
identifies that device as a valid host for the debug token. This argument is
required only if you are creating a debug token.
+=======
+- `<name> `specifies a unique name for the target.
+- `<ip-address> `specifies the ip address of the BlackBerry device or
simulator.
+- `-p|--password <password> `specifies the password for the device or
simulator. This is required only if the device or simulator is password
protected.
+- `--pin <device-pin>` specifies the PIN of the BlackBerry device.
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
###Remove a target
@@ -85,8 +145,12 @@ To remove a target, on the command line, type the following
command:
To specify a specific target as the default, on the command line, type the
following command:
+<<<<<<< HEAD
```
<path-to-project>/cordova/target default <name>
+=======
+```<path-to-project>/cordova/target default <name>
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
```
Building your app
@@ -123,10 +187,17 @@ To build your app in release mode, on the command line,
type the following comma
where
+<<<<<<< HEAD
- `<target>` specifies the name of a previously added target. If `<target>`
is not specified, the default target is used, if one has been created. This
argument is only required if you want the script to deploy your app to a
BlackBerry device or simulator and you have not created a default target.
Additionally, if `<target>` is a device, then that device must be connected to
your computer by USB connection or be connected to the same Wi-Fi network as
your computer.
- `-k|--keystorepass <password>` specifies the password you defined when
you configured your computer to sign applications. This password is also used
to create your debug token. This argument is only required if you want the
script to create and install the debug token for you.
- `-p|--params <params-JSON-file>` specifies a JSON file containing
additional parameters to pass to downstream tools.
- `-ll|--loglevel <level>` specifies the log level. The log level may be
one of `error`, `warn`, or `verbose`.
+=======
+- `<target> `specifies the name of a previously added target. This argument
is only required if you want the script to deploy your app to a BlackBerry
device or simulator. If `<target> `is a device, then that device must be
connected to your computer by USB connection.
+- `-k|--keystorepass <password> `specifies the password you defined when you
configured your computer to sign applications. This password is also used to
create your debug token. This argument is only required if you want the script
to create and install the debug token for you.
+- `-p|--params <params-JSON-file> `specifies a JSON file containing
additional parameters to pass to downstream tools.
+- `-ll|--loglevel <level> `specifies the log level. The log level may be one
of `error`, `warn`, or `verbose`.
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
Note that all of these parameters are optional. If you have previously defined
a default target (and installed a debug token, if that target is a BlackBerry
device), you can run the script with no arguments, and the script will package
your app and deploy it to the default target. For example:
@@ -137,9 +208,15 @@ Note that all of these parameters are optional. If you
have previously defined a
Deploying an app
-------------------------
+<<<<<<< HEAD
You can test your app using either a BlackBerry device or a simulator. Before
deploying your app, you must first create a target for the device or simulator
you want to deploy your app to.
The run script will deploy the most recent build of your app, which may or may
not be signed. If you intend to deploy an app to a physical device for testing
and you most recently built your app in debug mode, you must first install a
debug token on that device. If you specify the `--keystorepass <password>`
argument when running the build script, the script will create and install the
debug token for you. You do not need a debug token to test your app on a
simulator, even if that app is unsigned.
+=======
+You can test an unsigned app using either a BlackBerry device or a simulator.
Before deploying your app, you must first create a target for the device or
simulator you want to deploy your app to.
+
+If you intend to deploy an unsigned app to a physical device for testing, you
must first install a debug token on that device. If you specify the
`--keystorepass <password>` argument when running the build script, the script
will create and install the debug token for you. You do not need a debug token
to test your app on a simulator.
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
To deploy your app to a device or simulator, on a command line type the
following command:
@@ -148,6 +225,7 @@ To deploy your app to a device or simulator, on a command
line type the followin
```
where
+<<<<<<< HEAD
- `<target>` specifies the name of a previously added target. If `<target>`
is a device, then that device must be connected to your computer by USB
connection or be connected to the same Wi-Fi network as your computer.
Adding and managing plugins
@@ -193,3 +271,6 @@ To remove a plugin, on the command line, type the following
command:
<path-to-project>/cordova/plugin rm <name>
```
+=======
+- `<target> `specifies the name of a previously added target. If `<target>
`is a device, than that device must be connected to your computer by USB
connection.
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8dd23dbb/docs/en/edge/guide/getting-started/blackberry10/index.md.orig
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/getting-started/blackberry10/index.md.orig
b/docs/en/edge/guide/getting-started/blackberry10/index.md.orig
new file mode 100644
index 0000000..d172b46
--- /dev/null
+++ b/docs/en/edge/guide/getting-started/blackberry10/index.md.orig
@@ -0,0 +1,195 @@
+---
+license: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+---
+
+Getting Started with BlackBerry 10
+==================================
+
+Apache Cordova is an application development platform that allows you to use
common web technologies�primarily HTML5, JavaScript, and CSS�to create
applications for mobile devices. Cordova uses a standard set of APIs to access
common device features. Additional plugins allow you to access BlackBerry
specific APIs, so that you can extend your application to tightly integrate
with the BlackBerry 10 OS.
+
+Requirements
+------------
+
+Cordova for BlackBerry has the following software requirements:
+
+- Windows XP (32-bit) or Windows 7 (32-bit and 64-bit) or Mac OSX 10.6.4+
+- node.js. [Download node.js now](http://nodejs.org/)
+- BlackBerry 10 Native SDK. [Download the BlackBerry 10 Native SDK
now.](http://developer.blackberry.com/native/download/)
+
+Setting up your signing keys
+----------------------------
+
+Before starting development, you�ll need to register for your code signing
key and debug token. The signing key allows you to sign your completed app so
that you can distribute it through BlackBerry World. The debug token allows you
to test an unsigned app on a BlackBerry 10 device. You do not need to create
and install the debug token yourself; if you supply the keystore password, the
build script will create and install the debug token for you.
+
+- [Register for your code signing key
now.](https://www.blackberry.com/SignedKeys/codesigning.html)
+- [Set your computer up for code signing.
](http://developer.blackberry.com/html5/documentation/set_up_for_signing.html)
+- [Learn more about debug
tokens.](http://developer.blackberry.com/html5/documentation/running_your_bb10_app_2008471_11.html)
+
+Creating your project
+-------------------------
+
+To create a new project, you use the `create` command to set up the folder
structure for your app.
+
+1. On the command line, navigate to the folder where you extracted Cordova.
+2. Run the `create` command using the following syntax:
+ ```
+ bin/create <path-to-project>
+ ```
+
+This command creates the folder structure for your project at the specified
location. All of your project resource files should be stored in the
*<path-to-project>*/www folder, or in a subfolder within it.
+
+Adding and managing targets
+---------------------------
+
+A target refers to a BlackBerry device or simulator that you will use to test
your app. Targets are added directly to your project; you can add multiple
targets to your project, each with a unique name. Then, when you want to deploy
your app to a particular target, you can simply refer to that target by name
when you run your script.
+
+###Add a target
+
+To add a target, on the command line, type the following command:
+
+```
+<path-to-project>/cordova/target add <name> <ip-address> <device |
simulator> [-p | --password <password>] [--pin <device-pin>]
+```
+
+where
+
+- `<name>` specifies a unique name for the target.
+- `<ip-address>` specifies the ip address of the BlackBerry device or
simulator.
+- `-p|--password <password>` specifies the password for the device or
simulator. This is required only if the device or simulator is password
protected.
+- `--pin <device-pin>` specifies the PIN of the BlackBerry device, which
identifies that device as a valid host for the debug token. This argument is
required only if you are creating a debug token.
+
+###Remove a target
+
+To remove a target, on the command line, type the following command:
+
+```
+<path-to-project>/cordova/target remove <name>
+```
+
+###Set a target as the default
+
+To specify a specific target as the default, on the command line, type the
following command:
+
+```
+<path-to-project>/cordova/target default <name>
+```
+
+Building your app
+-----------------
+
+To build your app, run the build script. You can build the app in either
release mode or in debug mode.
+
+- When you build the app in release mode, you are preparing it for
distribution through BlackBerry World. The script packages your app resources
and plugins together in a .bar file, then signs the app.
+- When you build the app in debug mode, you are preparing it to be tested.
The script packages your app resources and plugins together in a .bar file, but
does not sign it. The script can also deploy the app onto a previously defined
target. If you have not already created and installed a debug token, you can
supply the keystore password, and the build script will create and install the
debug token for you as well.
+
+ Debug mode also enables Web Inspector for the app, which allows you to
remotely inspect the source code. A prompt displays the URL that you can use to
connect to and inspect your app. For more information on using Web Inspector,
see [Debugging using Web
Inspector](http://developer.blackberry.com/html5/documentation/web_inspector_overview_1553586_11.html).
+
+###Build your app in release mode
+
+To build your app in release mode, on the command line, type the following
command:
+
+```
+<path-to-project>/cordova/build release -k|--keystorepass <password>
[-b|--buildId <number>] [-p|--params <params-JSON-file>]
+```
+
+where
+
+- `-k|--keystorepass <password>` specifies the password you defined when
you configured your computer to sign applications.
+- `-b|--buildId <number>` specifies the build version number of your
application. Typically, this number should be incremented from the previous
signed version. This argument is optional.
+- `-p|--params <params-JSON-file>` specifies a JSON file containing
additional parameters to pass to downstream tools. This argument is optional.
+
+###Build your app in debug mode
+
+To build your app in release mode, on the command line, type the following
command:
+
+```
+<path-to-project>/cordova/build debug [<target>] [-k|--keystorepass
<password>] [-p|--params <params-JSON-file>] [-ll|--loglevel
<error|warn|verbose>]
+```
+
+where
+
+- `<target>` specifies the name of a previously added target. If `<target>`
is not specified, the default target is used, if one has been created. This
argument is only required if you want the script to deploy your app to a
BlackBerry device or simulator and you have not created a default target.
Additionally, if `<target>` is a device, then that device must be connected to
your computer by USB connection or be connected to the same Wi-Fi network as
your computer.
+- `-k|--keystorepass <password>` specifies the password you defined when
you configured your computer to sign applications. This password is also used
to create your debug token. This argument is only required if you want the
script to create and install the debug token for you.
+- `-p|--params <params-JSON-file>` specifies a JSON file containing
additional parameters to pass to downstream tools.
+- `-ll|--loglevel <level>` specifies the log level. The log level may be
one of `error`, `warn`, or `verbose`.
+
+Note that all of these parameters are optional. If you have previously defined
a default target (and installed a debug token, if that target is a BlackBerry
device), you can run the script with no arguments, and the script will package
your app and deploy it to the default target. For example:
+
+```
+<path-to-project>/cordova/build debug
+```
+
+Deploying an app
+-------------------------
+
+You can test your app using either a BlackBerry device or a simulator. Before
deploying your app, you must first create a target for the device or simulator
you want to deploy your app to.
+
+The run script will deploy the most recent build of your app, which may or may
not be signed. If you intend to deploy an app to a physical device for testing
and you most recently built your app in debug mode, you must first install a
debug token on that device. If you specify the `--keystorepass <password>`
argument when running the build script, the script will create and install the
debug token for you. You do not need a debug token to test your app on a
simulator, even if that app is unsigned.
+
+To deploy your app to a device or simulator, on a command line type the
following command:
+
+```
+<path-to-project>/cordova/run <target>
+```
+
+where
+- `<target>` specifies the name of a previously added target. If `<target>`
is a device, then that device must be connected to your computer by USB
connection or be connected to the same Wi-Fi network as your computer.
+
+Adding and managing plugins
+---------------------------
+
+To add additional functionality that is outside of the core features of
Cordova, you�ll need to add plugins. A plugin represents a set of APIs that
provide access to additional features of the platform.
+
+In order to use a plugin, you must first add it into your project. Once added
into your project, the plugin will be bundled with your project during the
build process, to ensure that your app has access to all the APIs it needs.
+
+Plugins hosted locally must be fetched before they can be installed. Plugins
hosted remotely can simply be installed.
+
+###Fetch a locally-hosted plugin
+
+To fetch a locally-hosted plugin, on the command line, type the following
command:
+
+```
+<path-to-project>/cordova/plugin fetch <path-to-plugin>
+```
+
+Once fetched, the plugin can be added by name, just as a remotely hosted
plugin.
+
+###View a list of installed plugins
+
+To view a list of installed plugins, on the command line, type the following
command:
+
+```
+<path-to-project>/cordova/plugin ls
+```
+
+###Add a plugin
+
+To add a plugin, on the command line, type the following command:
+
+```
+<path-to-project>/cordova/plugin add <name>
+```
+
+###Remove a plugin
+
+To remove a plugin, on the command line, type the following command:
+
+```
+<path-to-project>/cordova/plugin rm <name>
+```
+
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8dd23dbb/docs/en/edge/guide/getting-started/index.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/getting-started/index.md
b/docs/en/edge/guide/getting-started/index.md
index d937608..766d64a 100644
--- a/docs/en/edge/guide/getting-started/index.md
+++ b/docs/en/edge/guide/getting-started/index.md
@@ -22,6 +22,7 @@ Getting Started Guides
- Getting Started with Android
- Getting Started with BlackBerry
+- Getting Started with BlackBerry 10
- Getting Started with iOS
- Getting Started with Symbian
- Getting Started with WebOS
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8dd23dbb/docs/en/edge/guide/plugin-development/blackberry10/index.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/plugin-development/blackberry10/index.md
b/docs/en/edge/guide/plugin-development/blackberry10/index.md
index 99f7066..b38d79b 100644
--- a/docs/en/edge/guide/plugin-development/blackberry10/index.md
+++ b/docs/en/edge/guide/plugin-development/blackberry10/index.md
@@ -17,7 +17,12 @@ license: Licensed to the Apache Software Foundation (ASF)
under one
under the License.
---
+<<<<<<< HEAD
# Developing a Plugin on BlackBerry 10
+=======
+Developing a Plugin on BlackBerry 10
+====================================
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
This is a continuation of the Plugin Development Guide for Cordova. Once you
have reviewed that content, now let's look at things we need to have the Echo
plugin for the BlackBerry 10 platform. Recall that the Echo plugin basically
returns whatever string a user provides to the `window.echo` function:
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8dd23dbb/docs/en/edge/guide/plugin-development/blackberry10/index.md.orig
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/plugin-development/blackberry10/index.md.orig
b/docs/en/edge/guide/plugin-development/blackberry10/index.md.orig
new file mode 100644
index 0000000..99f7066
--- /dev/null
+++ b/docs/en/edge/guide/plugin-development/blackberry10/index.md.orig
@@ -0,0 +1,188 @@
+---
+license: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+---
+
+# Developing a Plugin on BlackBerry 10
+
+This is a continuation of the Plugin Development Guide for Cordova. Once you
have reviewed that content, now let's look at things we need to have the Echo
plugin for the BlackBerry 10 platform. Recall that the Echo plugin basically
returns whatever string a user provides to the `window.echo` function:
+
+ window.echo = function(str, callback) {
+ cordova.exec(callback, function(err) {
+ callback('Nothing to echo.');
+ }, "Echo", "echo", [str]);
+ };
+
+A native BlackBerry WebWorks plugin for Cordova contains JavaScript code and
may also contain native code. The Echo plugin example demonstrates how to
invoke native functionality from JavaScript. The native and JavaScript code
communicate with each other through a framework provided by JNEXT. Every plugin
must also include a plugin.xml file.
+
+## Architecture of the plugin ##
+
+You can place the artifacts of the plugin, which includes the plugin.xml file,
the source files (JavaScript, C++), and the binary files within any directory
structure, as long as you correctly specify the file locations in the
plugin.xml file. Below we show a typical structure that you can follow:
+
+***your_project_folder*** (>plugin.xml)
+
+- **www** (>client.js)
+- **src**
+ - **BlackBerry10** (>index.js, **native** >*.cpp, *.hpp)
+ - **device** (>*biary file* *.so)
+ - **simulator** (>*binary file* *.so)
+
+(The list shows the hierarchical relationship among the top level folders. The
parenthesis shows the contents of a given folder. All folder names appear in
bold text. File names are preceded by the '>' sign.)
+
+## Contents of the plugin.xml file##
+The plugin.xml file contains the namespace of the extension and other
metadata. Define the namespace and specify other metadata for the Echo plugin
as follows:
+
+ <plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
+ id="org.apache.cordova.blackberry.echo"
+ version="1.0.0">
+ <js-module src="www/client.js">
+ <merges target="navigator" />
+ </js-module>
+ <platform name="blackberry10">
+ <source-file src="src/blackberry10/index.js" />
+ <lib-file src="src/blackberry10/native/device/libecho.so"
arch="device" />
+ <lib-file src="src/blackberry10/native/simulator/libecho.so"
arch="simulator" />
+ <config-file target="www/config.xml" parent="/widget">
+ <feature name="org.apache.cordova.blackberry.echo"
value="org.apache.cordova.blackberry.echo" />
+ </config-file>
+ </platform>
+ </plugin>
+
+## Creating the native part of your plugin ##
+The native portion of your plugin must contain the following C++ files:
+
+- ***name*_js.hpp** - C++ header for the JNEXT code.
+- ***name*_js.cpp** - C++ code for JNEXT.
+
+The native interface for the JNEXT extension can be viewed in the plugin
header file located in the public folder of your project. It also contains
constants and utility functions that can be used in your native code. Your
Cordova-BlackBerry plugin must be derived from JSExt which is defined in
plugin.h. That is, you must implement the following class:
+
+ class JSExt
+ {
+ public:
+ virtual ~JSExt() {};
+ virtual string InvokeMethod( const string& strCommand ) = 0;
+ virtual bool CanDelete( void ) = 0;
+ private:
+ std::string m_id;
+ };
+
+Therefore, your extension should include the plugin.h header file. In the Echo
example, you use JSExt as follows in the echo_js.hpp file:
+
+ #include "../public/plugin.h"
+ #include <string>
+
+ #ifndef ECHO_JS_H_
+ #define ECHO_JS_H_
+
+ class Echo : public JSExt
+ {
+ public:
+ explicit Echo(const std::string& id);
+ virtual ~Echo();
+ virtual std::string InvokeMethod(const std::string& command);
+ virtual bool CanDelete();
+ private:
+ std::string m_id;
+ };
+
+ #endif // ECHO_JS_H_
+
+The `m_id` is an attribute that contains the JNEXT id for this object. The id
is passed to the class as an argument to the constructor. It is needed to
trigger events on the JavaScript side from native.
+The CanDelete method is used by JNEXT to determine whether your native object
can be deleted.
+The InvokeMethod function is called as a result from a request from JavaScript
to invoke a method of this particular object. The only argument to this
function is a string passed from JavaScript that this method should parse in
order to determine which method of the native object should be executed.
+Now we implement these functions in echo_js.cpp. For the Echo example, we
implement InvokeMethod function as follows:
+
+ string Echo::InvokeMethod(const string& command) {
+
+ //parse command and args from string
+ int index = command.find_first_of(" ");
+ string strCommand = command.substr(0, index);
+ string strValue = command.substr(index + 1, command.length());
+
+ // Determine which function should be executed
+ if (strCommand == "echo") {
+ return strValue;
+ } else {
+ return "Unsupported Method";
+ }
+ }
+
+Your native plugin must also implement the following callback functions:
+
+- `extern char* onGetObjList( void );`
+- `extern JSExt* onCreateObject( const string& strClassName, const string&
strObjId );`
+
+The `onGetObjList` function returns a comma separated list of classes
supported by JNEXT. JNEXT uses this function to determine the set of classes
that JNEXT can instantiate. In our Echo plugin, we have the following in
`echo_js.cpp`:
+
+ char* onGetObjList() {
+ static char name[] = "Echo";
+ return name;
+ }
+
+The `onCreateObject ` function takes two parameters. The first parameter is
the name of the class requested to be created from the JavaScript side. Valid
names are those that are returned in `onGetObjList`. The second parameter is
the unique object id for the class. This method returns a pointer to the
created plugin object. In our Echo plugin, we have the following in
`echo_js.cpp`:
+
+ JSExt* onCreateObject(const string& className, const string& id) {
+ if (className == "Echo") {
+ return new Echo(id);
+ }
+ return NULL;
+ }
+
+##Creating the JavaScript part of your plugin##
+
+The JavaScript portion of your plugin must contain the following files:
+
+- **client.js** â This is considered the client side and contains the API
that a BlackBerry WebWorks application can call. The API in client.js calls
makes calls to index.js. The API in client.js also connects callback functions
to the events that fire the callbacks.
+
+- **index.js** â This is considered the server side. Cordova loads index.js
and makes it accessible through the cordova.exec bridge. The client.js file
makes calls to the API in the index.js file, which in turn makes call to JNEXT
to communicate with the native side.
+
+The client and server side (client.js and index.js) interacts through the
`Cordova.exec `function. So, in client.js you invoke the exec function and
provide the necessary arguments. In the Echo plugin, we have the following in
the client.js file:
+
+ var service = "org.apache.cordova.blackberry.echo",
+ exec = cordova.require("cordova/exec");
+
+ module.exports = {
+ echo: function (data, success, fail) {
+ exec(success, fail, service, "echo", { data: data });
+ }
+ };
+
+Now, index.js interacts with the native side using JNEXT. So you attach a
constructor function named Echo to JNEXT. Within the constructor you perform
the following key operations using the init function:
+
+- Specify the required module exported by the native side. The name of the
required module must match the name of a shared library file (.so file).
+
+`JNEXT.require("libecho")`
+
+- Create an object by using an acquired module and save the ID that's returned
by the call.
+self.m_id = JNEXT.createObject("libecho.Echo");
+When your application calls the echo function in client.js, that call in turn
calls the echo function in index.js, where the PluginResult object sends a
response (data) back to client.js. Since the args argument passed into the
functions was converted by JSON.stringfy() and encoded as a URIcomponent, you
must call the following:
+
+`data = JSON.parse(decodeURIComponent(args.data));`
+
+You can now send the data back. Letâs put it all together:
+
+ module.exports = {
+
+ echo: function (success, fail, args, env) {
+
+ var result = new PluginResult(args, env),
+ data = JSON.parse(decodeURIComponent(args.data)),
+ response = echo.getInstance().echo(data);
+ result.ok(response, false);
+ }
+ };
+
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8dd23dbb/docs/en/edge/guide/plugin-development/index.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/plugin-development/index.md
b/docs/en/edge/guide/plugin-development/index.md
index 2c6f0cf..2561c30 100644
--- a/docs/en/edge/guide/plugin-development/index.md
+++ b/docs/en/edge/guide/plugin-development/index.md
@@ -106,6 +106,10 @@ this guide.
- Developing a Plugin on Android
- Developing a Plugin on Bada
- Developing a Plugin on BlackBerry
+<<<<<<< HEAD
+=======
+- Developing a Plugin on BlackBerry 10
+>>>>>>> 31853da... Fixed hyperlinks on getting started and plugin dev guides
for bb10
- Developing a Plugin on iOS
- Developing a Plugin on webOS
- Developing a Plugin on Windows Phone