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 38C80C192 for ; Wed, 19 Jun 2013 20:56:12 +0000 (UTC) Received: (qmail 64972 invoked by uid 500); 19 Jun 2013 20:56:11 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 64930 invoked by uid 500); 19 Jun 2013 20:56:11 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 64732 invoked by uid 99); 19 Jun 2013 20:56:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 20:56:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 575D625B88; Wed, 19 Jun 2013 20:56:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: shazron@apache.org To: commits@cordova.apache.org Date: Wed, 19 Jun 2013 20:56:14 -0000 Message-Id: <0b2a99bdb23e4fc591817158ef1b7ce2@git.apache.org> In-Reply-To: <641c73e97d944d059b234c4cdc573e94@git.apache.org> References: <641c73e97d944d059b234c4cdc573e94@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/22] removed 2.8.0rc1 code due to issue http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/command-line/index.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/command-line/index.md b/docs/en/2.8.0rc1/guide/command-line/index.md deleted file mode 100644 index 463ea71..0000000 --- a/docs/en/2.8.0rc1/guide/command-line/index.md +++ /dev/null @@ -1,387 +0,0 @@ ---- -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. ---- - -# Command-Line Usage - -Cordova now ships with a set of command-line tools that make it easier -for you to develop cross-platform applications. You can build, clean, -and launch an emulator with a single command. You can consider these -instructions as an alternative to the Getting Started guides. Whereas -the Getting Started guides help you get setup with the default IDEs and -tooling surrounding the platforms you are working with, the command-line -tools aim to provide a shell-based approach to creating and working with -Cordova projects. - -## Supported Platforms - -* [iOS](#Command-Line%20Usage_ios) -* [Android](#Command-Line%20Usage_android) -* [BlackBerry](#Command-Line%20Usage_blackberry) -* [BlackBerry 10](#Command-Line%20Usage_blackberry_10) -* [Windows Phone 8](#Command-Line%20Usage_wp8) - -## Windows Phone - -The Windows Phone command line tools support creating, building and -running new projects. - -### Create a project - -Run the `create` command with the following parameters: - -* Path to your new Cordova Windows Phone project -* Package Name, following reverse-domain style convention ( this becomes the default Namespace ) -* Project name - - - - $ C:\path\to\cordova-wp8\bin\create C:\path\to\my_new_cordova_project com.example.cordova_project_name CordovaProjectName - -### Building your project (cleans then builds) - -* Debug - - - - $ C:\path\to\my_new_cordova_project\cordova\build --debug - -* Release - - - - $ C:\path\to\my_new_cordova_project\cordova\build --release - -### Running your application - -Run the 'run' command with the following *optional* parameters - -* Target specification. This includes `--emulator`, `--device`, or `--target=`. -* Build specification. This includes `--debug`, `--release`, or `--nobuild`. - - - - $ C:\path\to\my_new_cordova_project\cordova\run [Target] [Build] - -By default the `run` command will look for a connected device, if no device is found it will look for any started emulators. If you have multiple emulators, you can specify a target ID. - -### Cleaning - - $ C:\path\to\my_new_cordova_project\cordova\clean - - -## iOS - -The iOS command-line tools are built upon shell scripts and rely on -Xcode command-line tools such as `xcode-select` and `xcodebuild`. - -### Create a project - -Run the `create` command with the following parameters: - -* Path to your new Cordova iOS project -* Package name, following reverse-domain style convention -* Project name - - - - $ ./path/to/cordova-ios/bin/create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName - -### Build a project - - $ /path/to/my_new_cordova_project/cordova/build - -### Run app on emulator - - $ /path/to/my_new_cordova_project/cordova/run - -### Releasing - - $ /path/to/my_new_cordova_project/cordova/release - -### Logging - - $ /path/to/my_new_cordova_project/cordova/log - - -## Android - -The Android command-line tools are built upon shell scripts. You _must_ -have the Android SDK's `tools` and `platform-tools` folders in your -PATH! - -### Create a project - -Run the `create` command with the following parameters: - -* Path to your new Cordova Android project -* Package name, following reverse-domain style convention -* Main Activity name - - - - $ /path/to/cordova-android/bin/create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName - -or, on *Windows* - - $ C:\path\to\cordova-android\bin\create.bat C:\path\to\my_new_cordova_project com.example.cordova_project_name CordovaProjectName - -### Building your project (cleans then builds) - -* **Debug** - - - - $ /path/to/my_new_cordova_project/cordova/build --debug - - or, on *Windows* - - $ C:\path\to\my_new_cordova_project\cordova\build.bat --debug - -* **Release** - - - - $ /path/to/my_new_cordova_project/cordova/build --release - - or, on *Windows* - - $ C:\path\to\my_new_cordova_project\cordova\build.bat --release - - -### Running your application - -Run the 'run' command with the following *optional* parameters - -* Target specification. This includes `--emulator`, `--device`, or `--target=`. -* Build specification. This includes `--debug`, `--release`, or `--nobuild`. - - - $ /path/to/my_new_cordova_project/cordova/run [Target] [Build] - - or, on *Windows* - - $ C:\path\to\my_new_cordova_project\cordova\run.bat [Target] [Build] - - -Make sure you have created at least one Android Virtual Device. If you did not it will ask you to create one with the `android` command. -By default the `run` command will look for a connected device, if no device is found it will look for any started emulators. If you have multiple AVDs, you can specify a target ID. - -### Logging - - $ /path/to/my_new_cordova_project/cordova/log - -or, on *Windows* - - $ C:\path\to\my_new_cordova_project\cordova\log.bat - -### Cleaning - - $ /path/to/my_new_cordova_project/cordova/clean - -or, on *Windows* - - $ C:\path\to\my_new_cordova_project\cordova\clean.bat - - -## BlackBerry - -The BlackBerry command-line tools are built upon shell scripts. - -### Create a project - -Run the `create` command with the following parameters: - -* Path to your new Cordova BlackBerry project -* Placeholder package name -* Application name - - - - $ /path/to/cordova-blackberry-webworks/bin/create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName - -or, on **Windows** - - $ /path/to/cordova-blackberry-webworks/bin/create.bat /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName - -Note: the package name placeholder (com.example.cordova_project_name) is ignored on the Blackberry platform, but is required for use of the crossplatform tools - -### Build a project - -For BlackBerry projects, please make sure you customize the -`project.properties` file in the root of your Cordova project folder. -This is necessary for things like supplying your BlackBerry signing key -password, location of the BlackBerry WebWorks SDK, and location of -BlackBerry simulator executables. - - $ /path/to/my_new_cordova_project/cordova/build - -or, on **Windows** - - $ /path/to/my_new_cordova_project/cordova/build.bat - -### Launch simulator - -For BlackBerry projects, please make sure you customize the -`project.properties` file in the root of your Cordova project folder. -This is necessary for things like supplying your BlackBerry signing key -password, location of the BlackBerry WebWorks SDK, and location of -BlackBerry simulator executables. - - $ /path/to/my_new_cordova_project/cordova/run - -and then choose 'no' when prompted with: - - Do you have a BlackBerry device connected to your computer? (y/n) - -or, on **Windows** - - $ /path/to/my_new_cordova_project/cordova/run - -and then choose 'no' when prompted with: - - Do you have a BlackBerry device connected to your computer? (y/n) - -### Logging - -Unfortunately streaming logs directly from the device is not -supported at this time. However, BlackBerry offers built-in Web -Inspector support for Playbook and BlackBerry smartphone devices running -BlackBerry OS 7.0 and above. Additionally, you can access your -application's logs (including any calls to `console.log`) on your device -by holding down the ALT key from the home screen and hitting "lglg" -keys. - - -##BlackBerry 10 - -Command-line tools are based on shell scripts. If you need help with a command, type the command with the `-h` or `-help` arguments, which are supported by all commands and which will provide descriptions for each of the available arguments. - -The following commands are available: - -##create - -The 'create' command creates a new project: - -``` -bin/create -``` - -##target - -The `target` command allows you to manage the BlackBerry device(s) or simulator that you will use to test your app. You can add or remove a target, or set a target as the default target. - -###Add a target - -``` -/cordova/target add [-p | --password ] [--pin ] -``` - -where - -- `` specifies a unique name for the target. -- `` specifies the ip address of the BlackBerry device or simulator. -- `-p|--password ` specifies the password for the device or simulator. This is required only if the device or simulator is password protected. -- `--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 - -``` -/cordova/target remove -``` - -###Set a target as the default - -``` -/cordova/target default -``` - -##build - -The `build` command builds the project as a .bar file. You can build your app in either release mode (which produces a signed .bar file) or in debug mode (which produces an unsigned .bar file). - -###Build your project in release mode - -``` -/cordova/build release -k|--keystorepass [-b|--buildId ] [-p|--params ] -``` -where - -- `-k|--keystorepass ` specifies the password you defined when you configured your computer to sign applications. -- `-b|--buildId ` 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 ` specifies a JSON file containing additional parameters to pass to downstream tools. This argument is optional. - -###Build your project in debug mode - -``` -/cordova/build debug [] [-k|--keystorepass ] [-p|--params ] [-ll|--loglevel ] -``` - -where - -- `` specifies the name of a previously added target. If `` 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 `` 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 ` 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 ` specifies a JSON file containing additional parameters to pass to downstream tools. -- `-ll|--loglevel ` specifies the log level. The log level may be one of `error`, `warn`, or `verbose`. - -If you have previously defined a default target (and previously 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: - -``` -/cordova/build debug -``` - -##run - -The `run` command deploys the app on the specified 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 deploy script will deploy the most recent build of your app. - -``` -/cordova/run -``` - -where -- ` `specifies the name of a previously added target. If ` `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. - -##plugin - -The `target` command allows you to add and remove plugins - -###Fetch a locally-hosted plugin - - -``` -/cordova/plugin fetch -``` - -###View a list of installed plugins - -``` -/cordova/plugin ls -``` - -###Add a plugin - -``` -/cordova/plugin add -``` - -###Remove a plugin - -``` -/cordova/plugin rm -``` - http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/cordova-webview/android.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/cordova-webview/android.md b/docs/en/2.8.0rc1/guide/cordova-webview/android.md deleted file mode 100644 index c797330..0000000 --- a/docs/en/2.8.0rc1/guide/cordova-webview/android.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -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. ---- - -Embedding Cordova WebView on Android -==================================== - -Beginning in Cordova 1.9, with the assistance of the `CordovaActivity`, you can use Cordova as a component in a larger native Android application. This component is known in Android -as the `CordovaWebView`. New Cordova-based applications from 1.9 onwards will be using the `CordovaWebView` as its main view, whether the legacy `DroidGap` approach is -used or not. - -The prerequisites are the same as the prerequisites for Android application development. It is assumed that you are familiar with Android development. If not, please -look at the Getting Started guide to developing a Cordova Application and start there before continuing with this approach. This is not the main approach used -to author Android Cordova applications. Thus the instructions are currently manual. In the future, we may try to further automate project generation via this method. - -Prerequisites -------------- - -1. **Cordova 1.9** or greater -2. Android SDK updated with 15 - -Guide to using CordovaWebView in an Android Project ---------------------------------------------------- - -1. Use `bin/create` to fetch the commons-codec-1.6.jar -2. `cd` into `/framework` and run `ant jar` to build the cordova jar (it - will create the .jar file in the form `cordova-2.8.0.jar` in the - `/framework` folder) -3. Copy the cordova jar into your Android project's `/libs` directory -4. Edit your application's `main.xml` file (under `/res/xml`) to look similar the following. The `layout_height`, `layout_width` and `id` can be modified to suit your application - - - -5. Modify your activity so that it implements the `CordovaInterface`. It is recommended that you implement the methods that are included. You may wish to copy the methods from `/framework/src/org/apache/cordova/DroidGap.java`, or you may wish to implement your own methods. Below is a fragment of code from a basic application that uses the interface (note how the view id referenced matches the `id` attribute specified in the above XML fragment from step 4): - - public class CordovaViewTestActivity extends Activity implements CordovaInterface { - CordovaWebView cwv; - /* Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - cwv = (CordovaWebView) findViewById(R.id.tutorialView); - Config.init(this); - cwv.loadUrl(Config.getStartUrl()); - } - -In addition to this, if you are using camera, you will want to implement this as well: - - @Override - public void setActivityResultCallback(CordovaPlugin plugin) { - this.activityResultCallback = plugin; - } - /** - * Launch an activity for which you would like a result when it finished. When this activity exits, - * your onActivityResult() method will be called. - * - * @param command The command object - * @param intent The intent to start - * @param requestCode The request code that is passed to callback to identify the activity - */ - public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) { - this.activityResultCallback = command; - this.activityResultKeepRunning = this.keepRunning; - - // If multitasking turned on, then disable it for activities that return results - if (command != null) { - this.keepRunning = false; - } - - // Start activity - super.startActivityForResult(intent, requestCode); - } - - @Override - /** - * Called when an activity you launched exits, giving you the requestCode you started it with, - * the resultCode it returned, and any additional data from it. - * - * @param requestCode The request code originally supplied to startActivityForResult(), - * allowing you to identify who this result came from. - * @param resultCode The integer result code returned by the child activity through its setResult(). - * @param data An Intent, which can return result data to the caller (various data can be attached to Intent "extras"). - */ - protected void onActivityResult(int requestCode, int resultCode, Intent intent) { - super.onActivityResult(requestCode, resultCode, intent); - CordovaPlugin callback = this.activityResultCallback; - if (callback != null) { - callback.onActivityResult(requestCode, resultCode, intent); - } - } - -Finally, remember to add the thread pool, otherwise the plugins will have no threads to run on. - - - @Override - public ExecutorService getThreadPool() { - return threadPool; - } - -6. Copy your application's HTML and JavaScript used to the `/assets/www` directory of your Android project -7. Copy `cordova.xml` and `plugins.xml` from `/framework/res/xml` to the `/res/xml` folder in your project http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/cordova-webview/index.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/cordova-webview/index.md b/docs/en/2.8.0rc1/guide/cordova-webview/index.md deleted file mode 100644 index d3e2e72..0000000 --- a/docs/en/2.8.0rc1/guide/cordova-webview/index.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -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. ---- - -Embedding WebView -================= - -> Implement the Cordova WebView in your own project. - -- Embedding Cordova WebView on Android -- Embedding Cordova WebView on iOS - http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/cordova-webview/ios.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/cordova-webview/ios.md b/docs/en/2.8.0rc1/guide/cordova-webview/ios.md deleted file mode 100644 index 5d9ba71..0000000 --- a/docs/en/2.8.0rc1/guide/cordova-webview/ios.md +++ /dev/null @@ -1,135 +0,0 @@ ---- -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. ---- - -Embedding Cordova WebView on iOS -================================ - -Beginning with Cordova 1.4, you can use Cordova as a component in your iOS applications. This component is code-named "Cleaver". - -New Cordova-based applications created using the Xcode template provided in Cordova 1.4 or greater use Cleaver, and this template is considered the reference implementation for Cleaver. - -Beginning with Cordova 2.0.0 and greater, we only support the sub-project based Cleaver implementation from now on. - -Prerequisites -------------- - -1. **Cordova 2.3.0** or greater -2. **Xcode 4.5** or greater -3. `config.xml` file (from a [newly created](guide_command-line_index.md.html#Command-Line%20Usage_ios) Cordova project) - - -Adding Cleaver to your Xcode project (CordovaLib sub-project) -------------------------------------------------------------- - -1. **Download and extract the Cordova source** to a **permanent folder location** on your hard drive (say to ~/Documents/Cordova) -2. **Quit Xcode** if it is running. -3. **Navigate** to the directory where you put the downloaded source above, using **Terminal.app**. -4. **Copy** the `config.xml` file into your project folder on disk (see **Prerequisites** above) -5. **Drag and drop** the `config.xml` file into the Project Navigator of Xcode -6. **Choose** the radio-button **"Create groups for any added folders"**, select the **Finish** button -7. **Drag and drop** the `CordovaLib.xcodeproj` file into the Project Navigator of Xcode (from the permanent folder location above, and it should be in the CordovaLib sub-folder) -8. Select `CordovaLib.xcodeproj` in the Project Navigator -9. Press the key combination **Option-Command-1** to show the **File Inspector** -10. Choose **"Relative to Group"** in the **File Inspector** for the drop-down menu for **Location** -11. Select the **project icon** in the Project Navigator, select your **Target**, then select the **"Build Settings"** tab -12. Add `-all_load` and `-Obj-C` - for the **"Other Linker Flags"** value -13. Click on the **project icon** in the Project Navigator, select your **Target**, then select the **"Build Phases"** tab -14. Expand **"Link Binaries with Libraries"** -15. Select the **"+" button**, and add these **frameworks** (and optionally in the Project Navigator, **move** them under the Frameworks group): - - AddressBook.framework - AddressBookUI.framework - AudioToolbox.framework - AVFoundation.framework - CoreLocation.framework - MediaPlayer.framework - QuartzCore.framework - SystemConfiguration.framework - MobileCoreServices.framework - CoreMedia.framework - -16. Expand **"Target Dependencies"** - the top box labeled like this if you have multiple boxes! -17. Select the **"+" button**, and add the `CordovaLib` build product -18. Expand **"Link Binaries with Libraries"** - the top box labeled like - this if you have multiple boxes! -19. Select the **"+" button**, and add `libCordova.a` -20. Set the Xcode preference **"Xcode Preferences -> Locations -> Derived Data -> Advanced…"** to **"Unique"** -21. Select the **project icon** in the Project Navigator, select your **Target**, then select the **"Build Settings"** tab -22. Search for **"Header Search Paths"**. For that setting, add these three values below (with quotes): - - "$(TARGET_BUILD_DIR)/usr/local/lib/include" - - "$(OBJROOT)/UninstalledProducts/include" - - "$(BUILT_PRODUCTS_DIR)" - - With **Cordova 2.1.0**, CordovaLib has been upgraded to use **Automatic Reference Counting (ARC)**. You don't need to upgrade to **ARC** to use CordovaLib, but if you want to upgrade your project to use **ARC**, please use the Xcode migration wizard from the menu: **Edit -> Refactor -> Convert to Objective-C ARC…**, **de-select libCordova.a**, then run the wizard to completion. - -Using CDVViewController in your code ------------------------------------- - -1. Add this **header**: - - #import - -2. Instantiate a **new** `CDVViewController`, and **retain it somewhere** (e.g. to a property in your class): - - CDVViewController* viewController = [CDVViewController new]; - -3. (_OPTIONAL_) Set the `wwwFolderName` property (defaults to `"www"`): - - viewController.wwwFolderName = @"myfolder"; - -4. (_OPTIONAL_) Set the start page in your config.xml, the `` tag. - - - - OR - - - -5. (_OPTIONAL_) Set the `useSplashScreen` property (defaults to `NO`): - - viewController.useSplashScreen = YES; - -6. Set the **view frame** (always set this as the last property): - - viewController.view.frame = CGRectMake(0, 0, 320, 480); - -7. **Add** Cleaver to your view: - - [myView addSubview:viewController.view]; - -Adding your HTML, CSS and JavaScript assets -------------------------------------------- - -1. Create a **new folder** in your project **on disk**, for example, name it `www` -2. Put your **HTML, CSS and JavaScript assets** into this folder -3. **Drag and drop** the folder into the Project Navigator of Xcode -4. **Choose** the radio-button **"Create folder references for any added folders"** -5. **Set the appropriate `wwwFolderName` and `startPage` properties** for the folder you created in **(1)** or use the defaults (see previous section) when you instantiate the `CDVViewController`. - - /* - if you created a folder called 'myfolder' and - you want the file 'mypage.html' in it to be - the startPage - */ - viewController.wwwFolderName = @"myfolder"; - viewController.startPage = @"mypage.html" - http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/getting-started/android/index.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/getting-started/android/index.md b/docs/en/2.8.0rc1/guide/getting-started/android/index.md deleted file mode 100644 index ab34d8e..0000000 --- a/docs/en/2.8.0rc1/guide/getting-started/android/index.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -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 Android -============================ - -This guide describes how to set up your development environment for Cordova and run a sample application. - -1. Minimum Requirements for Development ---------------- -- Identical to [Android Minimum Requirements](http://developer.android.com/sdk/index.html) - -1.1 Supported Android Devices -------------------------------- -- Android 2.1 (Deprecated May 2013) -- Android 2.2 -- Android 2.3 -- Android 3.x (Deprecated May 2013) -- Android 4.x - -We currently do not support Android 1.x, and we plan to deprecate platforms in the future as they are updated and dip below 5% on the [distribution dashboard](http://developer.android.com/about/dashboards/index.html) provided by Google. - -2. Install SDK + Cordova ------------------------- - -- Download and install [Android SDK](http://developer.android.com/sdk/index.html) -- Download the latest copy of [Cordova](http://cordova.apache.org/#download) and extract its contents. We will be working with the Android directory. - - -3A. Setup your PATH environment variable on Mac OS ---------------------------------------- - -- Open the Terminal program (this is in your Applications/Utilites folder by default). -- Run the following command - -`touch ~/.bash_profile; open ~/.bash_profile` - -- This will open the file in the your default text editor. -- You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use "/Development/android-sdk-macosx" as the directory the SDK is installed in. Add the following line: - -`export PATH=${PATH}:/Development/android-sdk-macosx/platform-tools:/Development/android-sdk-macosx/tools` - -- Save the file and quit the text editor. -- Execute your .bash_profile to update your PATH. - -`source ~/.bash_profile` - -- Now everytime you open the Terminal program you PATH will included the Android SDK. - -3B. Setup your PATH environment variable on Windows ---------------------------------------- - -- From the Desktop, right-click My Computer and click Properties. -- Click Advanced System Settings link in the left column. -- In the System Properties window click the Environment Variables button. -- Select the PATH variable from the System variables section. -- Select the Edit button. -- You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use "C:\Development\android-sdk-windows" as the directory the SDK is installed in. Append the following text into the text box: - -`;C:\Development\android-sdk-windows\platform-tools;C:\Development\android-sdk-windows\tools` - -- Save your edit. Close the Environment Variables dialog. -- Additionally, you may need to include `%JAVA_HOME%\bin` to your PATH as well. To check to see if this is required, run a command prompt and type `java`. If the program can not be found add `%JAVA_HOME%\bin` to the PATH. You may need to specify the full path instead of using the `%JAVA_HOME%` environment variable. -- Finally, you may need to include `%ANT_HOME%\bin` to your PATH as well. To check to see if this is required, run a command prompt and type `ant`. If the program can not be found add `%ANT_HOME%\bin` to the PATH. You may need to specify the full path instead of using the `%ANT_HOME%` environment variable. - - -4. Setup New Project --------------------- - -- In a terminal window, navigate to the `bin` directory within the `android` subfolder of the Cordova distribution. -- Type in `./create ` then press **"Enter"** - - is the path to your new Cordova Android project - is the package name, e.g. com.YourCompany.YourAppName - is the project name, e.g. YourApp (Must not contain spaces and dashes) - -- If you're getting an 'An unexpected error occurred" error, try the command again prefixed with `sudo` - -- Launch Eclipse, and select menu item **New Project** - ![](img/guide/getting-started/android/eclipse_new_project.png) -- Select the directory you used for `` -- Click Finish. - -If your project has a red X indicating there is a problem follow these additional steps: - -- Right click on the project folder. -- In the Properties dialog that is displayed select Android from the navigation pane. -- For the project build target select the highest Android API level you have installed. -- Click OK -- Then from the Project menu bar item select Clean. -- This should correct all the errors in the project. - -5A. Deploy to Emulator ----------------------- - -- Right click the project and go to **Run As > Android Application** -- Eclipse will ask you to select an appropriate AVD. If there isn't one, then you'll need to create it. - -**Note: For a faster experience, use an Intel-based emulator image:** - -- Open the Android SDK Manager - ![](img/guide/getting-started/android/eclipse_android_sdk_button.png) -- Install one or more `Intel x86 Atom` System Images as well as the `Intel Hardware Accelerated Execution Manager` (under Extras). -- Run the Intel installer, which has been downloaded to: `extras/intel/Hardware_Accelerated_Execution_Manager` within your Android SDK -- Create a new AVD with the Target set to an Intel image. -- When starting the emulator, ensure there are no error messages about the HAX module failing to load. - - -5B. Deploy to Device --------------------- - -- Make sure USB debugging is enabled on your device and plug it into your system. Information can be found on the [Android Developer Site](http://developer.android.com/tools/device.html) -- Right click the project and go to **Run As > Android Application** - http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/getting-started/bada/index.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/getting-started/bada/index.md b/docs/en/2.8.0rc1/guide/getting-started/bada/index.md deleted file mode 100644 index d02291d..0000000 --- a/docs/en/2.8.0rc1/guide/getting-started/bada/index.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -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 Bada -========================= - -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 ---------------- - -- Windows -- You need the bada 1.2 SDK to use cordova-bada (which is no longer available on Samsung's website) - -2. Install SDK + Cordova -------------------------- - -- Download and install the [Bada SDK](http://developer.bada.com) (Windows only). -- Download the latest copy of [Cordova](http://phonegap.com/download) and extract its contents. We will be working with the bada directory. - - -3. Setup New Project --------------------- -- In Bada IDE, select _File_ -> Import project -> Bada C++ / Flash Project. - - Note: Bada 1.2 select "Bada Application Project" - - ![](img/guide/getting-started/bada/import_bada_project.png) - -- Make sure "Select root directory is checked" and then click Browse -- Browse to Cordova bada project folder (bada for 1.2 and bada-wac for 2.x) and select it. Make sure "Copy projects into workspace is checked" - - ![](img/guide/getting-started/bada/import_bada_project.png) - -- Click "Finish" - - ![](img/guide/getting-started/bada/bada_project.png) - -4. Hello World --------------- - -**Bada 2.x**: Your HTML/CSS/Javascript code lives under the Res/ folder. Make sure your index.html contains the following two lines in the section. - - - - - -**Bada 1.2**: Your HTML/CSS/Javascript code lives under the Res/ folder. Make sure your index.html contains the following line. - - - -5A. Deploy to Simulator ------------------------ - -- **Bada 2.x**: Right click on your project s folder and select Run As -> bada Emulator Web Application - - ![](img/guide/getting-started/bada/bada_1_run.png) - -- **Bada 1.2**: Right click on your project' folder and select Build configurations -> Set Active -> Simulator-Debug - - ![](img/guide/getting-started/bada/bada_set_target.png) - -- Right click on your project's folder and select Run As -> bada Simulator Application. You need to close the emulator every time you update your app! - -5B. Deploy to Device --------------------- - -- Make sure your device is properly configured - -**Bada 2.x**: Right click on your project's folder and select Run As -> bada Target Web Application - -**Bada 1.2**: -- Right click on your project's folder and select Build configurations -> Set Active -> Target-Debug -- Right click on your project's folder and select Run As -> bada Target Application. You need to close the emulator every time you update your app! - - -Done! ------ http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/getting-started/blackberry/index.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/getting-started/blackberry/index.md b/docs/en/2.8.0rc1/guide/getting-started/blackberry/index.md deleted file mode 100644 index 5d61bce..0000000 --- a/docs/en/2.8.0rc1/guide/getting-started/blackberry/index.md +++ /dev/null @@ -1,189 +0,0 @@ ---- -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 -============================ - -Cordova for BlackBerry makes use of the [BlackBerry WebWorks framework](https://bdsc.webapps.blackberry.com/html5). 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](http://www.oracle.com/technetwork/java/javase/downloads/index.html#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](http://support.apple.com/kb/DL1421). -- Apache Ant - - Windows: [Apache Ant](http://ant.apache.org/bindownload.cgi). - - 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](http://www.adobe.com/devnet/air/air-sdk-download.html) -- [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](https://www.blackberry.com/SignedKeys). - -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](https://developer.blackberry.com/html5/documentation/signing_setup_bb10_apps_2008396_11.html). - - -4. Install Cordova -------------------------- - -Download the latest copy of [Cordova](http://cordova.apache.org/#download) 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 `./cordova/build ` in your command prompt/terminal while you are in your project's directory. Replace `` with either `qnx` `playbook` or `blackberry`. For example... - -BlackBerry 10 (QNX) -- `./cordova/build qnx` - -BlackBerry PlayBook -- `./cordova/build playbook` - -BlackBerry Smartphone (OS5-7) -- `./cordova/build blackberry` - - -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](http://us.blackberry.com/developers/resources/simulators.jsp). - -For instructions on installing simulators, please visit the following link(s): -- [BlackBerry 10](https://developer.blackberry.com/html5/documentation/using_the_bb10_simulator_2008466_11.html) -- [BlackBerry PlayBook](https://developer.blackberry.com/html5/documentation/using_the_tablet_simulator_1866980_11.html) -- [BlackBerry Smartphone](https://developer.blackberry.com/html5/documentation/run_your_app_on_smartphone_sim_1876976_11.html) - -- 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 `./cordova/run `. Replace `` 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) -- `./cordova/run qnx` - -BlackBerry PlayBook -- `./cordova/run playbook` - -BlackBerry Smartphone (OS5-7) -- `./cordova/run blackberry` - -Answer 'n' when prompted "Do you have a BlackBerry device connected to your computer? (y/n)" - -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 `./cordova/run `. Replace `` with either `qnx`, `playbook`, or `blackberry`. For example... - -BlackBerry 10 (QNX) -- `./cordova/run qnx` - -BlackBerry PlayBook -- `./cordova/run playbook` - -BlackBerry Smartphone (OS5-7) -- `./cordova/run blackberry` - -Answer "y" when prompted "Do you have a BlackBerry device connected to your computer? (y/n)" - -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 - -- [BlackBerry WebWorks Development Pitfalls](http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Common-BlackBerry-WebWorks-development-pitfalls-that-can-be/ta-p/624712) - -- [Best practices for packaging WebWorks applications](https://bdsc.webapps.blackberrycom/html5/documentation/ww_developing/bestpractice_compiling_ww_apps_1873324_11.html) http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/getting-started/blackberry10/index.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/getting-started/blackberry10/index.md b/docs/en/2.8.0rc1/guide/getting-started/blackberry10/index.md deleted file mode 100644 index e5e6b21..0000000 --- a/docs/en/2.8.0rc1/guide/getting-started/blackberry10/index.md +++ /dev/null @@ -1,185 +0,0 @@ ---- -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 (> 0.9.9) [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 - ``` - -This command creates the folder structure for your project at the specified location. All of your project resource files should be stored in the **/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: - -``` -/cordova/target add [-t ] [-p | --password ] [--pin ] -``` - -where - -- `` specifies a unique name for the target. -- `` specifies the ip address of the BlackBerry device or simulator. -- `-t ` specifies the target type. If not provided, the default value is device. -- `-p|--password ` specifies the password for the device or simulator. This is required only if the device or simulator is password protected. -- `--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: - -``` -/cordova/target remove -``` - -###Set a target as the default - -To specify a specific target as the default, on the command line, type the following command: - -``` -/cordova/target default -``` - -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: - -``` -/cordova/build release -k|--keystorepass [-b|--buildId ] [-p|--params ] -``` - -where - -- `-k|--keystorepass ` specifies the password you defined when you configured your computer to sign applications. -- `-b|--buildId ` 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 ` 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: - -``` -/cordova/build debug [] [-k|--keystorepass ] [-p|--params ] [-ll|--loglevel ] -``` - -where - -- `` specifies the name of a previously added target. If `` 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 `` 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 ` 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 ` specifies a JSON file containing additional parameters to pass to downstream tools. -- `-ll|--loglevel ` 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: - -``` -/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 first build your app. If you intend to deploy an app to a physical device for testing, you must first install a debug token on that device. If you specify the `--keystorepass ` argument when running the run 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: - -``` -/cordova/run [--no-build] -``` - -where -- `` specifies the name of a previously added target. If `` 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. - -- `-no--build` will use the most recently built version of the application rather than re-building. This is useful to test an application in release mode. - -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. - -###Add a plugin - -To add a plugin, on the command line, type the following command: - -``` -/cordova/plugin add -``` - -###Remove a plugin - -To remove a plugin, on the command line, type the following command: - -``` -/cordova/plugin rm -``` - -###View a list of installed plugins - -To view a list of installed plugins, on the command line, type the following command: - -``` -/cordova/plugin ls -``` http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/getting-started/index.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/getting-started/index.md b/docs/en/2.8.0rc1/guide/getting-started/index.md deleted file mode 100644 index 766d64a..0000000 --- a/docs/en/2.8.0rc1/guide/getting-started/index.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -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 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 -- Getting Started with Windows Phone 7 -- Getting Started with Windows Phone 8 -- Getting Started with Windows 8 -- Getting Started with Bada -- Getting Started with Tizen http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/bb951076/docs/en/2.8.0rc1/guide/getting-started/ios/index.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/guide/getting-started/ios/index.md b/docs/en/2.8.0rc1/guide/getting-started/ios/index.md deleted file mode 100644 index 0a0d86c..0000000 --- a/docs/en/2.8.0rc1/guide/getting-started/ios/index.md +++ /dev/null @@ -1,323 +0,0 @@ ---- -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 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) (https://itunes.apple.com/us/app/xcode/id497799835?mt=12). 
 - - Download from [Apple Developer Downloads](https://developer.apple.com/downloads/index.action) (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. 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. - - -- **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](https://developer.apple.com/programs/ios/) 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](http://www.apache.org/dist/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.8.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. Using the Finder® app, double click the file to extract. This will create a directory named, cordova-X.Y.Z. 
 - -3. Expand this folder and locate the cordova-ios.zip file and double click to extract it. 
 - -4. The code for iOS is within the cordova-ios directory structure. - -## 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. 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.
 - -### Open Terminal - -1. In Finder, navigate to the Applications Folder. Find and expand the Utilities Folder.
 - -2. Locate the Terminal app and double click to open it. 
 - -3. 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: - - ![](img/guide/getting-started/ios/bin_dir_listing.png) - - **Note:** This screen capture was from the Cordova-2.3.0 download, your listing will vary based on the actual Cordova version installed. - -4. 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. - -### 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. **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
 - 3. **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.
 - 2. 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` - - ![](img/guide/getting-started/ios/create.png) - - 3. 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](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. - -#### 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: - -![](img/guide/getting-started/ios/helloworld_project.png) - **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. Click the device section and select an iOS Simulator such as iPhone 6.0 Simulator as shown: 
 -![](img/guide/getting-started/ios/select_xcode_scheme.png) - - 3. Click the **Run** button in your project window's toolbar to build, deploy and run the application in the simulator. 
 - -### 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](http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/00-About_the_iOS_Application_Development_Workflow/introduction.html#//apple_ref/doc/uid/TP40007959) documentation for complete details.
 - - - Join the Apple iOS Developer Program
 - - - Create a Provisioning Profile within the [iOS Provisioning Portal](https://developer.apple.com/ios/manage/overview/index.action). 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. 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. 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.
 - - 3. Click the **run** button to build, deploy and run the application on your device. - -## Results - - The running HelloWorld app is shown below. The Device is Ready line should be slowly pulsating. - - ![](img/guide/getting-started/ios/HelloWorldStandard.png) - -## 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. 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]; - } - - 3. Press Command s to save the file. 
 - 4. Navigate to the AppViewDelegate.m file in the Classes Folder. - - 5. Comment out the following line by placing a double slash at the beginning of line 73 as shown below:
 - - //self.viewController.invokeString = invokeString;
 - - 6. Press Command-s to save the file. - - 7. Press Command-b to rebuild the project and eliminate the warnings.
 - -### 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. In the Derived Data section click the Advanced button and select Unique as the Build Location as shown: 
 -![](img/guide/getting-started/ios/xcode_build_location.png) - - 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. - -## 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. - - - - - - **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: - - - - - - - ..... - - -###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.
 - - - [Start Developing iOS Apps Today](http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMapiOS/index.html#//apple_ref/doc/uid/TP40011343) provides a quick overview of steps for developing iOS Apps.
 - - [Member Center home page](https://developer.apple.com/membercenter/index.action) provides links to several iOS technical resources including technical resources, the provisioning portal, distribution guides and community forums. 
 - - [Tools Workflow Guide for iOS](http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/00-About_the_iOS_Application_Development_Workflow/introduction.html#//apple_ref/doc/uid/TP40007959) 
 - - [Xcode 4 User Guide](http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/000-About_Xcode/about.html#//apple_ref/doc/uid/TP40010215) 
 - - [Session Videos](https://developer.apple.com/videos/wwdc/2012/) from the Apple World Wide Developer Conference 2012 (WWDC2012) - -### Apache Cordova - - The [Apache Cordova home page](http://cordova.apache.org/) contains all of the links below and more. - - - Cordova API documentation is available at [http://docs.cordova.io](http://docs.cordova.io)
 - - [PhoneGap google group](https://groups.google.com/forum/?fromgroups=%23!forum/phonegap) to discuss and ask questions about Cordova. This forum is monitored by Cordova developers as well as users. When posting please include the platform, device type, Cordova version and as many details as possible about the error or problem. 
 - - File Cordova bugs at [https://issues.apache.org/jira/browse/CB](https://issues.apache.org/jira/browse/CB) - - -### Credits - - Mac®, OS X®, Apple®, Xcode®, App Store℠, iPad®, iPhone®, iPod® and Finder® are Trademarks of Apple Inc.