Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 04A09100F1 for ; Tue, 9 Apr 2013 22:36:01 +0000 (UTC) Received: (qmail 52290 invoked by uid 500); 9 Apr 2013 22:36:00 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 52266 invoked by uid 500); 9 Apr 2013 22:36:00 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 52258 invoked by uid 99); 9 Apr 2013 22:36:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2013 22:36:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2013 22:35:36 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 443262388C22; Tue, 9 Apr 2013 22:34:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1466271 [14/41] - in /cordova/site: bin/ public/ public/docs/en/2.6.0/ public/docs/en/2.6.0/img/ public/docs/en/2.6.0/img/guide/ public/docs/en/2.6.0/img/guide/getting-started/ public/docs/en/2.6.0/img/guide/getting-started/android/ public... Date: Tue, 09 Apr 2013 22:34:33 -0000 To: commits@cordova.apache.org From: steven@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130409223443.443262388C22@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: cordova/site/public/docs/en/2.6.0/guide_getting-started_blackberry_index.md.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/2.6.0/guide_getting-started_blackberry_index.md.html?rev=1466271&view=auto ============================================================================== --- cordova/site/public/docs/en/2.6.0/guide_getting-started_blackberry_index.md.html (added) +++ cordova/site/public/docs/en/2.6.0/guide_getting-started_blackberry_index.md.html Tue Apr 9 22:34:28 2013 @@ -0,0 +1,313 @@ + + + + + + +Apache Cordova API Documentation + + + + + + +
+

Getting Started with BlackBerry

+ +
+ + + +
+
+

Getting Started with BlackBerry

+ +

Cordova for BlackBerry makes use of the BlackBerry WebWorks framework. BlackBerry WebWorks tooling is available for Windows or Mac environments.

+ +

WebWorks applications can ONLY be deployed to the following BlackBerry platforms:

+ +
    +
  • BlackBerry OS 5.0 and higher
  • +
  • BlackBerry PlayBook
  • +
  • BlackBerry 10 (QNX)
  • +
+

+1. Requirements +

+ +
    +
  • Windows XP (32-bit) or Windows 7 (32-bit and 64-bit) or Mac OSX 10.6.4+
  • +
  • Java Development Kit (JDK) +
      +
    • Windows: Oracle JDK (32-Bit Version)
    • +
    • Mac OS X: Versions prior to Mac OS X 10.7 provided Java by default. OS X 10.7+ requires installation of Java.
    • +
    +
  • +
  • Apache Ant +
      +
    • Windows: Apache Ant.
    • +
    • Mac OS X: Apache Ant is bundled with Java install.
    • +
    +
  • +
+

+2. Install the WebWorks SDK +

+ +

Download and install the appropriate WebWorks SDKs for your development. BlackBerry 10, BlackBerry PlayBook, and BlackBerry Smartphone WebWorks SDKs can all be downloaded from the following locations. Please note that BlackBerry PlayBook development requires the Adobe Air SDK as well.

+ +
    +
  • [BlackBerry 10 (QNX) SDK] (https://developer.blackberry.com/html5/download/#blackberry10)
  • +
  • [BlackBerry PlayBook SDK] (https://developer.blackberry.com/html5/download/#playbook) & Adobe Air SDK +
  • +
  • [BlackBerry Smartphones SDK] (https://developer.blackberry.com/html5/download/#smartphones)
  • +
+

+3. Register for Signing Keys +

+ +

If you wish to publish your application on BlackBerry App World, or deploy on an actual device you’ll need to register for a set of free Code Signing Keys.

+ +

To register for Signing Keys visit, and complete the BlackBerry Keys Order Form.

+ +

Once you receive your Signing Keys, they'll need to be setup. To learn how to setup your Signing Keys visit the BlackBerry HTML5/WebWorks website.

+ +

+4. Install Cordova +

+ +

Download the latest copy of Cordova and extract its contents to your local machine.

+ +

+5. Setup New Project +

+ +
    +
  • Open up a command prompt/terminal and navigate to where you extracted Cordova.
  • +
  • There is a directory for each platform that Cordova supports. CD into the blackberry directory.
  • +
  • The blackberry directory contains several directories. The example folder contains a complete Cordova project. Copy the example folder to another location on your computer.
  • +
  • Change to the newly created directory.
  • +
  • Open up the project.properties file with your favorite editor and edit the entries for the WebWorks SDKs you are using. For example...
  • +
+

BlackBerry 10 (QNX) +- qnx.bbwp.dir=C:\\Program Files (x86)\\Research In Motion\\BlackBerry 10 WebWorks SDK 1.0.2.9

+ +

BlackBerry PlayBook +- playbook.bbwp.dir=C:\\Program Files\\Research In Motion\\BlackBerry WebWorks SDK for TabletOS 2.1.0.6\\bbwp

+ +

BlackBerry Smartphone (OS5-7) +- blackberry.bbwp.dir=C:\\Program Files\\Research In Motion\\BlackBerry WebWorks Packager

+ +

+6. Hello World +

+ +

Build the Cordova sample project by typing ant target build in your command prompt/terminal while you are in your project's directory. Replace target with either qnx playbook or blackberry. For example...

+ +

BlackBerry 10 (QNX) +- ant qnx build

+ +

BlackBerry PlayBook +- ant playbook build

+ +

BlackBerry Smartphone (OS5-7) +- ant blackberry build

+ +

+7A. Deploy to Simulator +

+ +

BlackBerry smartphone simulators are only available on Windows. BlackBerry 10, and PlayBook simulators require VMWare Player (Windows) or VMWare Fusion (Mac OS X). The WebWorks SDK provides a default simulator. Additional simulators are available.

+ +

For instructions on installing simulators, please visit the following link(s): +- BlackBerry 10 +- BlackBerry PlayBook +- BlackBerry Smartphone

+ +
    +
  • Open the project.properties file with your favorite editor and customize the following properties.
  • +
+

BlackBerry 10 +- qnx.sim.ip +- qnx.sim.password +- Note: IP address of simulator obtained when placing the simulator in developer mode through simulator security settings. Simulator password can be set through simulator security settings.

+ +

Playbook +- playbook.sim.ip : +- playbook.sim.password +- Note: IP address of simulator obtained when placing the simulator in developer mode through simulator security settings. Simulator password can be set through simulator security settings.

+ +

Smartphone (Optional) +- blackberry.sim.dir +- blackberry.sim.bin +- Note: On windows file separator '\' must be escaped when specifying directories. For example C:\\Program Files\\BlackBerry\\Simulator.

+ +

While in your project directory, in command prompt/terminal type ant target load-simulator. Replace target with either qnx, playbook, or blackberry. Note, for BlackBerry 10 and PlayBook, the simulator virtual image must already be started. For example...

+ +

BlackBerry 10 (QNX) +- ant qnx load-simulator

+ +

BlackBerry PlayBook +- ant playbook load-simulator

+ +

BlackBerry Smartphone (OS5-7) +- ant blackberry load-simulator

+ +

The application will be installed to the home screen of the simulator. Note, on BlackBerry OS 5 the application is installed in the Downloads folder.

+ +

+7B. Deploy to Device (Windows and Mac) +

+ +

To deploy your app to a device you must have registered for, and setup BlackBerry Code Signing Keys. See section 3 for details. Also, to deploy apps on BlackBerry 10 or PlayBook, the device must be set to Development Mode which can be enabled from the Settings > Security menu.

+ +
    +
  • Open the project.properties file with your favorite editor and customize the following properties:
  • +
+

BlackBerry 10 (QNX) +- qnx.sigtool.password +- qnx.device.ip +- qnx.device.password

+ +

BlackBerry PlayBook +- playbook.sigtool.csk.password +- playbook.sigtool.p12.password +- playbook.device.ip +- playbook.device.password

+ +

BlackBerry Smartphone (OS5-7) +- Smartphone (Optional) +- blackberry.sigtool.password

+ +

While in your project directory, in command prompt/terminal type ant target load-device. Replace target with either qnx, playbook, or blackberry. For example...

+ +

BlackBerry 10 (QNX) +- ant qnx load-device

+ +

BlackBerry PlayBook +- ant playbook load-device

+ +

BlackBerry Smartphone (OS5-7) +- ant blackberry load-device

+ +

The application will be installed to the home screen of the device. Note, on BlackBerry OS 5 the application is installed in the Downloads folder.

+ +

+Additional Information +

+ +

The following articles provide help to issues you may encounter when developing a Cordova application which is based on the BlackBerry WebWorks framework

+ + +
+
+ + + + + Added: cordova/site/public/docs/en/2.6.0/guide_getting-started_index.md.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/2.6.0/guide_getting-started_index.md.html?rev=1466271&view=auto ============================================================================== --- cordova/site/public/docs/en/2.6.0/guide_getting-started_index.md.html (added) +++ cordova/site/public/docs/en/2.6.0/guide_getting-started_index.md.html Tue Apr 9 22:34:28 2013 @@ -0,0 +1,136 @@ + + + + + + +Apache Cordova API Documentation + + + + + + +
+

Getting Started Guides

+ +
+ + + + + + + + + Added: cordova/site/public/docs/en/2.6.0/guide_getting-started_ios_index.md.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/2.6.0/guide_getting-started_ios_index.md.html?rev=1466271&view=auto ============================================================================== --- cordova/site/public/docs/en/2.6.0/guide_getting-started_ios_index.md.html (added) +++ cordova/site/public/docs/en/2.6.0/guide_getting-started_ios_index.md.html Tue Apr 9 22:34:28 2013 @@ -0,0 +1,505 @@ + + + + + + +Apache Cordova API Documentation + + + + + + +
+

Getting Started with iOS

+ +
+ + + +
+
+

Getting Started with iOS

+ +

+Introduction +

+ +

Apache Cordova is a library used to create native mobile applications using Web technologies. The application is created using HTML, CSS and JavaScript and compiled for each specific platform using the platform native tools. Cordova provides a standard set of JavaScript APIs to access device features on all supported platforms. This document describes how to get started using Apache Cordova for the iOS platform.

+ +

Requirements

+ +
    +
  • +Intel-based Computer with Mac® OS X® Lion or greater (10.7.4+)
 +The Apple® tools required for building iOS applications run only on the OS X operating system. The version of the development environment required, Xcode® 4.5, runs only on Mac OS X version 10.7 (Lion) or greater. 

  • +
  • +

    Xcode 4.5 and iOS 6 SDK +
 To submit apps to the Apple App Store℠, you must be using the latest versions of the Apple tools. Currently the latest versions are Xcode 4.5.2 and the iOS 6 SDK (Software Development Kit). The download of Xcode 4.5.2 includes the iOS 6 SDK. 


    + +
      +
    • Download from the App Store (https://itunes.apple.com/us/app/xcode/id497799835?mt=12). 

    • +
    • Download from Apple Developer Downloads (https://developer.apple.com/downloads/index.action). Note: This link requires Apple Developer registration.
    • +
    +
  • +
  • +

    Xcode Command Line Tools

    + +

    Cordova uses the command line to create a new application project. To access the Xcode tools from the command line an additional download is required. The tools are downloaded from within Xcode.


    + +
      +
    1. Open Xcode
    2. +
    3. Select the following via the Xcode Menus: Xcode Preferences> Downloads>Command Line Tools. This will download and install copies of the core command line tools and system headers into system folders on your computer.
    4. +
    +
  • +
  • +

    iOS Device

    + +

    You can test many of the Cordova features using the iOS simulator that is installed with the iOS SDK and Xcode, but you will need an actual device to fully test all of the device features used in your applications before submitting to the App Store. The device must have at least iOS 5.x installed - this is the minimum iOS version supported as of Cordova 2.3. Devices that support at least iOS 5 include all iPad® models, iPhone® 3GS and above, and iPod® Touch 3rd Generation or later. 
 
 In addition, to install apps onto a device, you must be a member of the iOS Developer Program from Apple. The program costs $99 per year. This Getting Started guide documents deploying the application to the iOS simulator so registration with the developer program is not required.

    +
  • +
+

+Install Cordova +

+ +

Download Cordova

+ +

Download the latest version of Apache Cordova from http://www.apache.org/dist/cordova/. Click on the Download icon and select cordova-X.Y.Z-src.zip to download to your machine. The X, Y and Z represent the version number of Cordova, for example 2.6.0. The download includes the code for all of the Apache Cordova supported platforms. 


+ +

Extract Cordova

+ +

To access the code it will need to be extracted from the archive (.zip) file.

+ +
    +
  1. Navigate to the folder where you downloaded the code. Find the cordova-X.Y.Z-src.zip file. 
 +Note: The file names change with each new version of Cordova. The file name will be different if you are using an updated or newer version of Cordova.


  2. +
  3. Using the Finder® app, double click the file to extract. This will create a directory named, cordova-X.Y.Z. 


  4. +
  5. Expand this folder and locate the cordova-ios.zip file and double click to extract it. 


  6. +
  7. The code for iOS is within the cordova-ios directory structure.

  8. +
+

+Project Creation +

+ +

Xcode projects for Cordova are created by invoking a script file via the command line. The following steps explain how to create the necessary directory structure, open and use the Terminal application to create a new project, and execute the create script. 


+ +

Determine Project Location

+ +

Determine where on your system you will locate the Xcode project files for your application. For this tutorial I created a CordovaXY directory under my Documents folder: ~/Documents/CordovaXY where the X and Y refer the to Cordova version #.


+ +
    +
  1. In Finder navigate to the Documents Directory. 


  2. +
  3. Create a directory called CordovaXY within the Documents directory where the X and Y represent the Cordova version number (23, for example). You can use a different directory name or location if you wish but you will need to remember this directory location and name for subsequent steps.


  4. +
+

Open Terminal

+ +
    +
  1. In Finder, navigate to the Applications Folder. Find and expand the Utilities Folder.


  2. +
  3. Locate the Terminal app and double click to open it. 


  4. +
  5. +

    In Finder, navigate to the cordova-ios directory from the downloaded and extracted Cordova code and expand it if necessary. Highlight the bin directory as shown:

    + +

    + +

    Note: This screen capture was from the Cordova-2.3.0 download, your listing will vary based on the actual Cordova version installed.

    +
  6. +
  7. Drag this directory to the open Terminal icon in the dock. This will open up a default terminal window with the path set to the bin directory.

  8. +
+

Create New Project

+ +

Command Line Syntax

+ +
    +
  1. +

    Determine Required Parameters

    + +

    There are 3 ordered, required parameters for creating a Cordova project from the command line:


    + +
      +
    1. +

      project location

      + +

      This is the directory where the Xcode project and files for the application will be located. This tutorial is using ~/Documents/CordovaXY as the base location and the application name as the project directory. Thus the location for our project will be 
~/Documents/CordovaXY/HelloWorld, where HelloWorld is the project name (note that the X and Y represent the Cordova version, for example 22 for version 2.2). The final directory, HelloWorld in this example, must not already exist as it will be created during execution of the command.

      +
    2. +
    3. +

      package name

      + +

      When submitting apps to the App Store, this must be the reverse domain name App ID that is created via the Apple Provisioning Portal (described in the Deploy to Device section). The Provisioning Portal is accessible once you have paid for and signed into your iOS Developer Account. Since you will not be submitting this sample app, this tutorial uses org.apache.Cordova plus the app name, HelloWorld: 
org.apache.cordova.HelloWorld


      +
    4. +
    5. +

      project name

      + +

      This is the name of the actual project. Most developers make the project name and the application name the same. In this example the project name is HelloWorld.


      +
    6. +
    +
  2. +
  3. +

    Execute the Command

    + +

    In the terminal app with bin as the current directory, enter the 3 pieces of information via the following command: +
 ./create ~/Documents/CordovaXY/HelloWorld org.apache.cordova.HelloWorld HelloWorld

    + +

    +
  4. +
  5. +

    Fix Common Problems

    + +

    No Developer Directory Found

    + +

    The “Error: No developer directory found at /Developer” message is displayed if the create script can not find the location of the command line tools within Xcode. This can occur if more than one version of Xcode is installed on the system or when upgrading from older versions of Xcode. The solution is to run the xcode-select command to set the location. If you have installed Xcode in the default location the command to execute is:


    + +
        sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer

    +
    + +

    See http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html for more information on the xcode-select command if you have installed Xcode in a different location.

    +
  6. +
+

Optional Features

+ +
    +
  • +

    Additional Parameters

    + +

    The default create script copies the necessary common library files from the Cordova distribution directory into your Xcode project directory. These files will appear within the CordovaLib directory of your project structure. Some development organizations prefer to have developers reference the common Cordova library files from a fixed location. A common location helps to insure that all developers are using the exact same copy of the CordovaLib code. This is accomplished by adding the --shared parameter to the create command. The following command will create a project that references the CordovaLib directory from the iOS directory location where the create script is executed:


    + +
    ./create --shared ~/Documents/CordovaXY/HelloWorld org.apache.cordova.HelloWorld HelloWorld

    +
    + +

    
 The Xcode project is still created in the ~/Documents/CordovaXY/HelloWorld directory, but it references the CordovaLib files from the fixed location of the Cordova distribution rather than a copy of these files within the project directory. 


    +
  • +
  • +

    Additional Scripts

    + +

    Within the cordova-ios/bin directory there is an additional script that changes the location of the CordovaLib directory to refer to a shared location after the project has been created,


    + +
     ./update_cordova_subproject path/to/your/project

    +
    + +

    Most users will be satisfied with the default project creation procedure and do not need this additional script. This script uses the location of CordovaLib directory at the same directory level as the bin directory from which it is run as the shared location for CordovaLib. To modify the newly created HelloWorld project to use a shared location for CordovaLib, execute the following command from the bin directory:


    + +
    ./update_cordova_subproject ~/Documents/CordovaXY/HelloWorld

    +
    +
  • +
+

+Running the Application +

+ +

Open the Project

+ +

Using the Finder app, navigate to the location where you created the project. This guide uses ~/Documents/CordovaXY/HelloWorld. Double click the HelloWorld.xcodeproj file to open the project in Xcode.

+ +

Your screen should look similar to:

+ +

Note: this screen capture shows a project that was created with the name as HelloWorld23. 


+ +

Deploy to the Simulator

+ +
    +
  1. In the upper left hand corner of Xcode, click on the Scheme drop down and select the project name, HelloWorld, as the target. 

  2. +
  3. Click the device section and select an iOS Simulator such as iPhone 6.0 Simulator as shown: 
 +

  4. +
  5. Click the Run button in your project window's toolbar to build, deploy and run the application in the simulator. 


  6. +
+

Deploy to the Device +

+ +

Requirements

+ +

There are several requirements to deploy to a device. Since this information is not related directly to Cordova, please refer to the Apple Configuring Development and Distribution Assets section of the Tools Workflow Guide for iOS documentation for complete details.


+ +
    +
  • Join the Apple iOS Developer Program


  • +
  • Create a Provisioning Profile within the iOS Provisioning Portal. You can use the Development Provisioning Assistant within the Provisioning Portal to create and install the profile and certificate for use within Xcode.


  • +
  • Verify that the Code Signing Identity in the Code Signing sections of the Hello World Xcode project settings has been set with your provisioning profile name. 


  • +
+

Deployment Steps

+ +
    +
  1. Plug your device into your Mac via the USB Cable.

  2. +
  3. +

    Select the Target and device

    + +
      +
    1. In the upper left hand corner of Xcode, click the Scheme drop down and select the project name, HelloWorld, as the target.

    2. +
    3. Click the device section and select your device from the list. If your device is plugged in via the USB but not visible in the device list, click the Organizer button to determine any errors.

    4. +
    +
  4. +
  5. Click the run button to build, deploy and run the application on your device.

  6. +
+

+Results +

+ +

The running HelloWorld app is shown below. The Device is Ready line should be slowly pulsating.

+ +

+ +

+Common Problems +

+ +

Deprecation Warnings

+ +

When an application programming interface (API) has been changed or replaced by another API, it is marked as “deprecated.” The API will still work in the near term but will be removed in a future version of the code library. Apache Cordova contains some of these deprecated interfaces. When you build and deploy an application, Xcode will issue warnings about these deprecated APIs. The ‘invokeString’ method that Xcode is warning about represents functionality to invoke the app from a custom URL. The process for loading from a custom URL has changed but this code is included to provide backwards functionality for apps created with older versions of Cordova. The sample app does not use this functionality so the references to the items causing the warnings can be ignored.

+ +

If you wish to remove the warnings you can remove the code that is referencing the invokeString deprecated API. 


+ +
    +
  1. Navigate to the MainViewController.m file in the Classes folder.

  2. +
  3. +

    Find and comment out the following code by surrounding it with the begin, /*, and end, */, comment characters as highlighted in the code snippet below.

    + +
    (void)webViewDidFinishLoad:(UIWebView*)theWebView
    +{
    +// only valid if ___PROJECTNAME__-Info.plist specifies a protocol to handle
    +/*
    +if (self.invokeString) {
    +  // this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready
    +  NSLog(@"DEPRECATED: window.invokeString - use the window.handleOpenURL(url) function instead, which is always called when the app is launched through a custom scheme url.");
    +  NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString];
    +  [theWebView stringByEvaluatingJavaScriptFromString:jsString];
    +}
    +*/
    +// Black base color for background matches the native apps
    +theWebView.backgroundColor = [UIColor blackColor];
    +
    +
    +return [super webViewDidFinishLoad:theWebView];
    +}
    +
    +
  4. +
  5. Press Command s to save the file. 


  6. +
  7. Navigate to the AppViewDelegate.m file in the Classes Folder.

  8. +
  9. +

    Comment out the following line by placing a double slash at the beginning of line 73 as shown below:


    + +
    //self.viewController.invokeString = invokeString;

    +
    +
  10. +
  11. Press Command-s to save the file.

  12. +
  13. Press Command-b to rebuild the project and eliminate the warnings.


  14. +
+

Missing Headers

+ +

Some users have encountered compilation errors relating to missing headers. This refers to a problem in the build location and is fixed via Xcode preferences. 


+ +
    +
  1. Within the Xcode menus select Xcode>Preferences>Locations. 

  2. +
  3. +

    In the Derived Data section click the Advanced button and select Unique as the Build Location as shown: 
 +

    + +

    This is the default setting for a new Xcode install but it may have been set differently if you upgraded from an older version of Xcode.

    +
  4. +
+

+Next Steps +

+ +

Building Your Own Applications

+ +

Include Cordova

+ +

All of the code for the sample application is contained within the www directory in the Xcode project structure. The starting page is named index.html. Any page that uses Cordova must include the cordova-*.js file for the associated Cordova version and platform. The format of the JavaScript file name is cordova-x.y.z where x represents the major version number, y the minor version and z any point release. For example, the Cordova 2.2.0 file was named cordova-2.2.0.js. The sample HelloWorld application includes this file from index.html.

+ +
  <script type="text/javascript" src="cordova-2.2.0.js"></script>
+  <script type="text/javascript" src="js/index.js"></script>
+  <script type="text/javascript">
+          app.initialize();
+  </script>
+
+ +

Wait for deviceReady Event

+ +

When loading a page, Cordova’s deviceReady event must fire before you can access any of the platform features via the Cordova JavaScript APIs. Within the sample application this is set up within the app object found within the js/index.js file. The app.initialze() call at the bottom of the index.html file (visible in the previous code example) sets in motion the binding of events to receive and respond to the deviceReady event.

+ +

Another common method of initializing a page is to add an event listener for the deviceReady event within the handler for the body onload event as shown in the code snippet below:

+ +
  <head>
+    <script type="text/javascript" src="cordova-2.6.0.js"></script>
+    <script>
+      function onLoad() {
+    document.addEventListener(
+      ‘deviceready’, onDeviceReady, false);
+    }
+    function onDeviceReady() {
+      // do Something!
+      // example: display a Cordova Alert
+      // see docs.cordova.io for full details
+      navigator.notification.alert(
+        'Cordova is ready!',       // message
+        function() {//do something},  // callback
+        'Congratulations',            // title
+        'Done'                      // buttonName
+       );
+    }
+    </script>
+    </head>
+    <body onload=”onLoad();”>
+    .....
+
+ +

Code Your Application

+ +

Replace the sample code in the www directory of a new project with the HTML, JavaScript and CSS code for your application. The name of the initial file to load when the app is launched should be index.html (advanced users can change this if necessary). As demonstrated in the HelloWorld sample application, subdirectories within the www directory are permitted. Note that the www directory is readonly, you can not write information to this directory during app execution. If you need to store information use the Cordova File or Storage APIs.

+ +

You can use many mobile JavaScript frameworks with Cordova to create the UI and page navigation of your application. Popular ones include:

+ +
    +
  • JQuery Mobile
  • +
  • Dojo Mobile
  • +
  • Sencha Touch
  • +
+

Modify Project Settings +

+ +

There are many additional considerations to make your application unique. The sample HelloWorld application is set up to run in all iOS environments, iPhone, iPod, and iPad. You can design an app for a single device type by modifying the build settings within Xcode.

+ +

You should customize the application with your own icons and splash screens. The sample application includes Cordova specific images in the Apple required sizes and resolutions as examples. The Cordova Specific settings are located in the config.xml file and documented in the Cordova Project Settings Guide. Refer to the Resources section for more Apple specific information about building iOS Apps.

+ +

+Resources +

+ +

Apple

+ +

Some of these references are within the Apple iOS Developer Reference and require an iOS Developer License.


+ + +

Apache Cordova

+ +

The Apache Cordova home page contains all of the links below and more.

+ + +

Credits

+ +

Mac®, OS X®, Apple®, Xcode®, App Store℠, iPad®, iPhone®, iPod® and Finder® are Trademarks of Apple Inc.

+ +
+
+ + + + + Added: cordova/site/public/docs/en/2.6.0/guide_getting-started_symbian_index.md.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/2.6.0/guide_getting-started_symbian_index.md.html?rev=1466271&view=auto ============================================================================== --- cordova/site/public/docs/en/2.6.0/guide_getting-started_symbian_index.md.html (added) +++ cordova/site/public/docs/en/2.6.0/guide_getting-started_symbian_index.md.html Tue Apr 9 22:34:28 2013 @@ -0,0 +1,199 @@ + + + + + + +Apache Cordova API Documentation + + + + + + +
+

Getting Started with Symbian

+ +
+ + + +
+
+

Getting Started with Symbian

+ +

This guide describes how to set up your development environment for Cordova and run a sample application. Note that Cordova used to be called PhoneGap, so some of the sites still use the old PhoneGap name.

+ +

+Video Tutorials: +

+ + +

+1. Requirements +

+ +
    +
  • Windows, OS X, or Linux
  • +
+

There are also QT for Symbian and Symbian with Sony Ericsson) guides.

+ +

+2. Install SDK + Cordova +

+ +
    +
  • Download and install cygwin (Windows only). Make sure you select "make" as it is not included by default
  • +
  • Download the latest copy of Cordova and extract its contents. We will be working with the Android directory.
  • +
+

+3. Setup New Project +

+ +
    +
  • In cygwin, navigate to where you extracted Cordova and go into the Symbian directory
  • +
+

+4. Hello World +

+ +
    +
  • Open up index.html located in phonegap/symbian/framework/www with your favourite editor.
  • +
  • In the body tag, remove the line "Build your phonegap app here! Dude!" and add the line <h1>Hello World</h1> +
  • +
  • In cygwin/terminal, type make. This will produce phonegap-symbian.wrt/app.wgz.
  • +
+

+5A. Deploy to Simulator +

+ +
    +
  • For Mac or Linux you should install Aptana Studio and Nokia WRT Plug-in for Aptana Studio. This has a browser-based javascript emulator
  • +
  • For Windows you can download the S60 SDK which includes the S60 Emulator
  • +
  • Load the phonegap-symbian.wrt/app.wgz file into the emulator.
  • +
+

+5B. Deploy to Device + +

+ +
    +
  • Load the phonegap-symbian.wrt/app.wgz file into the device using bluetooth or email.
  • +
+

+Done! +

+ +

You can also checkout more detailed version of this guide here.

+ +
+
+ + + + + Added: cordova/site/public/docs/en/2.6.0/guide_getting-started_tizen_index.md.html URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/2.6.0/guide_getting-started_tizen_index.md.html?rev=1466271&view=auto ============================================================================== --- cordova/site/public/docs/en/2.6.0/guide_getting-started_tizen_index.md.html (added) +++ cordova/site/public/docs/en/2.6.0/guide_getting-started_tizen_index.md.html Tue Apr 9 22:34:28 2013 @@ -0,0 +1,263 @@ + + + + + + +Apache Cordova API Documentation + + + + + + +
+

Getting Started with Tizen

+ +
+ + + +
+
+

Getting Started with Tizen

+ +

This guide describes how to set up your development environment for Cordova and run a sample application. Note that Cordova used to be called PhoneGap, so some of the sites still use the old PhoneGap name.

+ +

+1. Requirements +

+ +
    +
  • Linux Ubuntu 10.04/10.10/11.04/11.10 32-bit, Windows XP SP3/7 32-bit.
  • +
+

+2. Install SDK + Cordova +

+ +
    +
  • Download and install the Tizen SDK.
  • +
  • Download the latest copy of Cordova and extract its contents. We will be working with the tizen directory.
  • +
  • (optional) Install Tizen Cordova template projects: copy the /templates directory content into you Tizen Eclipse IDE web templates directory (e.g: /home/my_username/tizen-sdk/IDE/Templates/web).
  • +
+

+3. Setup New Project +

+ +
    +
  • +

    Method #1: Import a Cordova Tizen project sample

    + +
      +
    • Launch Tizen Eclipse IDE
    • +
    • Select File -> Import -> Tizen Web Project +
    • +
    +

    + +
      +
    • Click Next +
    • +
    • Make sure that Select root directory is checked
    • +
    • Make sure Copy projects into workspace is checked
    • +
    • Click Browse +
    • +
    • Browse to one of the Cordova Tizen "samples" project directory (e.g: /cordova-basic) and select it
    • +
    +

    + +
      +
    • Click Finish +
    • +
    +

    + +
      +
    • Your project should now have been imported and appear Project Explorer view
    • +
    +
  • +
  • +

    Method #2: Use Tizen Eclipse IDE Cordova Tizen project templates

    + +
      +
    • Launch Tizen Eclipse IDE
    • +
    • Select File -> New -> Tizen Web Project +
    • +
    • Select User Template and User defined items
    • +
    • Select one of the Tizen Cordova template (e.g: CordovaBasicTemplate)
    • +
    • Fill-up the Project name and its target Location +
    • +
    +

    + +
      +
    • Click Finish +
    • +
    +

    + +
      +
    • Your project should now have been created and appear Project Explorer view
    • +
    +
  • +
+

+4. Hello World +

+ +
    +
  • +

    To build your project:

    + +
      +
    • +Right Click your project in the Project Explorer view and Select Build Project +
    • +
    +

    + +
      +
    • A widget package should have been generated in your project root directory (e.g: cordova-basic.wgt)

    • +
    • Note that the provided samples Tizen Cordova projects are not basic hello world applications. They contain a simple example usage of the Battery Cordova API.

    • +
    +
  • +
+

+5A. Deploy to Simulator +

+ +
    +
  • +

    Right Click your project in the Project Explorer view and Select Run As and Tizen Web Simulator Application

    + +

    +
  • +
+

+5B. Deploy to Device/Emulator +

+ +
    +
  • Make sure that your target device is properly launched/connected/configured ("Date and Time" settings must have been set correctly)
  • +
  • +

    Select your application deployment target with the Connection Explorer view (Select Window Menu -> Show View -> Connection Explorer )

    + +

    +
  • +
  • +

    Right Click your project in the Project Explorer view and Select Run As and Tizen Web Application

    + +

    +
  • +
+

+Done! +

+ +
+
+ + + + +