You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by na...@apache.org on 2014/05/22 20:50:28 UTC
docs commit: [CB-6717][amazon-fireos] Platform guide and other docs
needs to be updated for amazon-fireos Updated amazon-fireos platform guide as
well as config and embeded webview guides.
Repository: cordova-docs
Updated Branches:
refs/heads/master d520506be -> e31db8841
[CB-6717][amazon-fireos] Platform guide and other docs needs to be updated for amazon-fireos
Updated amazon-fireos platform guide as well as config and embeded webview guides.
Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/e31db884
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/e31db884
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/e31db884
Branch: refs/heads/master
Commit: e31db8841d8e79fa55e9a0db9d6299f980d8b815
Parents: d520506
Author: Archana Naik <na...@lab126.com>
Authored: Thu May 22 11:48:19 2014 -0700
Committer: Archana Naik <na...@lab126.com>
Committed: Thu May 22 11:48:19 2014 -0700
----------------------------------------------------------------------
.../edge/guide/platforms/amazonfireos/config.md | 35 ++++--
.../edge/guide/platforms/amazonfireos/index.md | 120 +++++++++++++------
.../guide/platforms/amazonfireos/webview.md | 30 +++--
3 files changed, 130 insertions(+), 55 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e31db884/docs/en/edge/guide/platforms/amazonfireos/config.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/platforms/amazonfireos/config.md b/docs/en/edge/guide/platforms/amazonfireos/config.md
index 436d292..f935126 100644
--- a/docs/en/edge/guide/platforms/amazonfireos/config.md
+++ b/docs/en/edge/guide/platforms/amazonfireos/config.md
@@ -26,24 +26,28 @@ config.xml File for information on global configuration options.
- `KeepRunning` (boolean, defaults to `true`): Determines whether the
application stays running in the background even after a `pause`
- event fires.
+ event fires. Setting this to `false` does not kill the app after a
+ `pause` event, but simply halts execution of code within the cordova
+ webview while the app is in the background.
<preference name="KeepRunning" value="false"/>
-- `ErrorUrl`: Specifies an error page that displays in response to
- standard HTTP errors in the 400-500 range. Place the specified file
- in the top-level directory containing the home page and other web
- assets.
+- `ErrorUrl` (URL, defaults to `null`):
+ If set, will display the referenced page upon an error in the application
+ instead of a dialog with the title "Application Error".
<preference name="ErrorUrl" value="error.html"/>
-- `LoadingDialog`: Display a native dialog when loading the app. The
- value's format is _Title, Message_
-
+- `LoadingDialog` (string, defaults to `null`): If set, displays a dialog with
+ the specified title and message, and a spinner, when loading the first
+ page of an application. The title and message are separated by a comma
+ in this value string, and that comma is removed before the dialog is
+ displayed.
+
<preference name="LoadingDialog" value="Please wait, the app is loading"/>
-- `LoadingPageDialog`: Display a native dialog when loading sub-pages
- within an app. The value's format is _Title, Message_
+- `LoadingPageDialog` (string, defaults to `null`): The same as `LoadingDialog`,
+ but for loading every page after the first page in the application.
<preference name="LoadingPageDialog" value="Please wait, the data is loading"/>
@@ -63,4 +67,15 @@ config.xml File for information on global configuration options.
time the splash screen image displays.
<preference name="SplashScreenDelay" value="10000"/>
+
+- `ShowTitle` (boolean, defaults to `false`): Show the title at the top
+ of the screen.
+
+ <preference name="ShowTitle" value="true"/>
+
+- `LogLevel` (string, defaults to `ERROR`): Sets the minimum log level
+ through which log messages from your application will be filtered. Valid
+ values are `ERROR`, `WARN`, `INFO`, `DEBUG`, and `VERBOSE`.
+
+ <preference name="LogLevel" value="VERBOSE"/>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e31db884/docs/en/edge/guide/platforms/amazonfireos/index.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/platforms/amazonfireos/index.md b/docs/en/edge/guide/platforms/amazonfireos/index.md
index a4bee1e..9fc3efa 100644
--- a/docs/en/edge/guide/platforms/amazonfireos/index.md
+++ b/docs/en/edge/guide/platforms/amazonfireos/index.md
@@ -28,18 +28,26 @@ See the following for more detailed platform-specific information:
* Amazon Fire OS WebViews
* Amazon Fire OS Plugins
-## Requirements and Support
+## Introduction
+
+By targeting the Amazon Fire OS platform, Cordova developers can create hybrid web apps that take advantage of the advanced web engine integrated into Kindle Fire devices. Amazon WebView API (AWV) is a Chromium-derived web runtime exclusive to Fire OS. A drop-in replacement for the WebView that comes with Android devices, AWV makes it possible to create better performing and more powerful hybrid web apps by providing support for a faster JavaScript engine (V8), remote debugging, and hardware optimizations for Kindle Fire devices including an accelerated 2D Canvas, and access to HTML5 features not supported by Android’s built in WebView such as: CSS Calc, Form Validation, getUserMedia, IndexedDB, Web Workers, WebSockets and WebGL.
-Developing Cordova apps for Amazon Fire OS requires the Android SDK and the Amazon WebView SDK. Check the requirements for these SDKs at the links below:
+For more information about the Amazon WebView API, please see the Amazon Developer Portal's [HTML5 Hybrid Apps page](https://developer.amazon.com/public/solutions/platforms/android-fireos/docs/building-and-testing-your-hybrid-app). For questions about getting started and other support issues, please see the Amazon Developer Portal [Forums - HTML5 Hybrid Apps](http://forums.developer.amazon.com/forums/category.jspa?categoryID=41).
-* [Android SDK System](http://developer.android.com/sdk/)
-* [Amazon WebView SDK](https://developer.amazon.com/sdk/fire/IntegratingAWV.html#installawv)
+## Requirements and Support
+
+Developing Cordova apps for Amazon Fire OS requires installation of a variety of support files, including everything needed for Android development, as well as the Amazon WebView SDK. Check the list below for the required installs:
+
+* The Command-Line Interface
+* [Android SDK](http://developer.android.com/sdk/)
+* [Apache Ant](http://ant.apache.org)
+* [Amazon WebView SDK](https://developer.amazon.com/public/solutions/platforms/android-fireos/docs/building-and-testing-your-hybrid-app)
## Installation
-### Android SDK
+### Android SDK and Apache Ant
Install the Android SDK from
[developer.android.com/sdk](http://developer.android.com/sdk/). You
@@ -47,21 +55,29 @@ may be presented with a choice of where to install the SDK, otherwise
move the downloaded `adt-bundle` tree to wherever you store
development tools.
-For Cordova command-line tools to work, you need to include the SDK's
-`tools` and `platform-tools` directories in your PATH environment.
+You'll need to run the Android SDK Manager (`android` from a command line) at least once before starting your Cordova project. Make sure to install the most recent version of the Android SDK Tools and SDK Platform **specifically API level 19**. Please see [Setting up your Development Environment](https://developer.amazon.com/public/resources/development-tools/ide-tools/tech-docs/01-setting-up-your-development-environment) on the Amazon Developer Portal for more information about setting up your development environment for Kindle Fire OS devices.
+
+Install the Apache Ant build tool by [downloading an Ant binary distribution](http://ant.apache.org/bindownload.cgi), unzipping into a directory you can refer to later. See the [Ant manual](http://ant.apache.org/manual/index.html) for more info.
+
+For Cordova command-line tools to work, you need to include the Android SDK's
+`tools`, `platform-tools` and `apache-ant/bin` directories in your PATH environment.
+
+#### Mac/Linux Path
On Mac, Linux or other Unix-like platforms, you can use a text editor to create or modify the
`~/.bash_profile` file, adding a line such as the following, depending
-on where the SDK installs:
+on where the SDK and Ant are installed:
- export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools
+ export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools:/Development/apache-ant/bin
This exposes SDK tools in newly opened terminal windows. Otherwise run
this to make them available in the current session:
$ source ~/.bash_profile
-To modify the PATH environment on Windows 7:
+#### Windows Path
+
+To modify the PATH environment on Windows:
* Click on the __Start__ menu in the lower-left corner of the desktop,
right-click on __Computer__, then click __Properties__.
@@ -73,29 +89,35 @@ To modify the PATH environment on Windows 7:
* Select the __PATH__ variable and press __Edit__.
* Append the following to the PATH based on where you installed the
- SDK, for example:
+ SDK and Ant, for example:
- ;C:\Development\adt-bundle\sdk\platform-tools;C:\Development\adt-bundle\sdk\tools
+ ;C:\Development\adt-bundle\sdk\platform-tools;C:\Development\adt-bundle\sdk\tools;C:\Development\apache-ant\bin
* Save the value and close both dialog boxes.
-You may also need to enable Java and Ant. Open a command prompt and
-type `java`, and also type `ant`. Append to the PATH whichever fail to
-run:
+* You will also need to enable Java. Open a command prompt and
+type `java`, if it does not run, append the location of the Java binaries to your PATH as well. Make sure %JAVA_HOME% is pointing to installed JDK directory. You might have to add JAVA_HOME environment variable seperately.
+
+ ;%JAVA_HOME%\bin
- ;%JAVA_HOME%\bin;%ANT_HOME%\bin
### Amazon WebView SDK
-Download the Amazon WebView SDK from the [Amazon Developer Portal](https://developer.amazon.com/sdk/fire/IntegratingAWV.html#installawv).
+In order to create Cordova apps using the Amazon Fire OS platform target, you'll need to download, unpack and install the Amazon WebView SDK support files. This step will only need to be done for your first Amazon Fire OS project, or if you upgrade Cordova.
-Note: Replace [cordova_release] below to whatever release of cordova you are working with.
+* Download the Amazon WebView SDK from the [Amazon Developer Portal](https://developer.amazon.com/public/solutions/platforms/android-fireos/docs/building-and-testing-your-hybrid-app).
-* Create a `libs/` folder in `~/.cordova/lib/amazon-fireos/cordova/[cordova_release]/` folder.
-* Add the `awv_interface.jar` from the downloaded SDK to `~/.cordova/lib/amazon-fireos/cordova/[cordova_release]/libs/`
+* Copy `awv_interface.jar` from the downloaded SDK to Cordova's working directory:
+
+ **Mac/Linux:**
+ `~/.cordova/lib/amazon-fireos/cordova/[cordova_release]/framework/libs/`
+ **Windows:**
+ `%USERPROFILE%\.cordova\lib\amazon-fireos\cordova\[cordova_release]\framework\libs`
-## Open a Project in the SDK
+***Note:*** Because of Cordova's on-demand install process, the `~/.cordova/lib/amazon-fireos` platform directory will not be created until you add the platform to your first project.
+
+## Create New Project for Amazon Fire OS
Use the `cordova` utility to set up a new project, as described in The
Cordova The Command-line Interface. For example, in a source-code directory:
@@ -105,7 +127,43 @@ Cordova The Command-line Interface. For example, in a source-code directory:
$ cordova platform add amazon-fireos
$ cordova build
-Once created, you can use the Eclipse that comes along with the Android SDK to modify it:
+***Note:*** The first time the amazon-fireos platform is installed on your system, it will download the appropriate files to the Cordova working directory, but will then fail as it is missing the AWV SDK support files (see above). Follow the instructions above to install the `awv_interface.jar`, then remove and re-add the amazon-fireos platform to your project. This step will only need to be done for first Amazon Fire OS project.
+
+
+## Deploy to Device
+
+To push an app directly to the device, make sure USB debugging is enabled on your device as described on the
+[Android Developer Site](http://developer.android.com/tools/device.html),
+and use a mini USB cable to plug it into your system.
+
+You can push the app to the device from the command line:
+
+ $ cordova run amazon-fireos
+
+Alternately within Eclipse, right-click the project and choose __Run
+As → Android Application__.
+
+__Note__: Currently, testing via an emulator is not supported for Amazon WebView based apps, additionally the Amazon WebView API is only available on Fire OS devices. For more information, please see the [Amazon WebView API SDK](https://developer.amazon.com/public/solutions/platforms/android-fireos/docs/building-and-testing-your-hybrid-app) documentation.
+
+### Run Flags
+
+The run command accepts optional parameters as specified in the Cordova Command Line Interface document, Fire OS also accepts an additional `--debug` flag which will enable Chromium's Developer Tools for remote web debugging.
+
+To use Developer Tools, enter:
+
+ $ cordova run --debug amazon-fireos
+
+This will enable the tools on the running client. You can then connect to the client by port forwarding using the Android Debug Bridge (adb) referring to the app's package name.
+
+For example:
+
+ adb forward tcp:9222 localabstract:com.example.helloworld.devtools
+
+You can then use the DevTools via a Chromium-based browser by navigating to: `http://localhost:9222`.
+
+### Optional Eclipse support
+
+Once created, you can use the Eclipse that comes along with the Android SDK to modify the project. Beware that modifications made through Eclipse will be overwritten if you continue to use Cordova command line tools.
* Launch the __Eclipse__ application.
@@ -116,6 +174,8 @@ Once created, you can use the Eclipse that comes along with the Android SDK to m
* Navigate to `hello`, or whichever directory you created for the project, then to the `platforms/amazon-fireos` subdirectory.
+* Eclipse will show you hello and hello-CorddovaLib - 2 projects to be added. Add both.
+
* Press __Finish__.
Once the Eclipse window opens, a red __X__ may appear to indicate
@@ -125,23 +185,9 @@ unresolved problems. If so, follow these additional steps:
* In the resulting __Properties__ dialog, select __Android__ from the navigation pane.
-* For the project build target, select the highest Android API level you have installed.
+* For the project build target, select the highest Android API level (currently API Level 19) you have installed.
* Click __OK__.
* Select __Clean__ from the __Project__ menu. This should correct all the errors in the project.
-## Deploy to Device
-
-To push an app directly to the device, make sure USB debugging is enabled on your device as described on the
-[Android Developer Site](http://developer.android.com/tools/device.html),
-and use a mini USB cable to plug it into your system.
-
-You can push the app to the device from the command line:
-
- $ cordova run amazon-fireos
-
-Alternately within Eclipse, right-click the project and choose __Run
-As → Android Application__.
-
-__Note__: Currently, testing via an emulator is not supported for Amazon WebView based apps.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e31db884/docs/en/edge/guide/platforms/amazonfireos/webview.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/platforms/amazonfireos/webview.md b/docs/en/edge/guide/platforms/amazonfireos/webview.md
index a92cae3..8037b4f 100644
--- a/docs/en/edge/guide/platforms/amazonfireos/webview.md
+++ b/docs/en/edge/guide/platforms/amazonfireos/webview.md
@@ -19,11 +19,14 @@ license: Licensed to the Apache Software Foundation (ASF) under one
# Amazon Fire OS WebViews
-Beginning with 3.0.0, you can use Cordova as a component in Amazon Fire OS applications. Amazon Fire OS refers to this component as `CordovaWebView`. `CordovaWebView` extends Amazon WebView that is built on the open source Chromium Project. By leveraging this feature, your web apps can utilize the latest HTML5 web standards running in a modern web runtime engine.
+Beginning with 3.3.0, you can use Cordova as a component in Amazon Fire OS applications. Amazon Fire OS refers to this component as `CordovaWebView`. `CordovaWebView` extends Amazon WebView that is built on the open source Chromium Project. By leveraging this feature, your web apps can utilize the latest HTML5 web standards running in a modern web runtime engine.
+
+If you're unfamiliar with Amazon Fire OS, you should first familiarize
+yourself with the Amazon Fire OS Platform Guide and have the latest SDKs installed before you attempt the more unusual development option of embedding a WebView.
## Prerequisites
-* Cordova 3.0.0 or greater
+* Cordova 3.3.0 or greater
* Android SDK updated to the latest SDK
@@ -31,18 +34,29 @@ Beginning with 3.0.0, you can use Cordova as a component in Amazon Fire OS appli
## Guide to using CordovaWebView in a Amazon Fire OS Project
-1. Download and expand the [Amazon WebView SDK](https://developer.amazon.com/sdk/fire/IntegratingAWV.html#installawv) , then copy the awv_interface.jar into `/framework/libs` directory. Create a libs/ folder if it doesn't exist.
+1. To follow these instructions, make sure you have the latest Cordova
+ distribution. Download it from
+ [cordova.apache.org](http://cordova.apache.org) and unzip its
+ Amazon Fire OS package.
+
+2. Download and expand the [Amazon WebView SDK](https://developer.amazon.com/sdk/fire/IntegratingAWV.html#installawv) , then copy the awv_interface.jar into `/framework/libs` directory. Create a libs/ folder if it doesn't exist.
+
+3. Navigate to the package's `/framework` directory and run
+ `ant jar`. It creates the Cordova `.jar` file, formed as
+ `/framework/cordova-x.x.x.jar`.
-2. `cd` into `/framework` and run `ant jar` to build the cordova jar. It creates the .jar file formed as `cordova-x.x.x.jar` in the `/framework` directory.
+4. Copy the `.jar` file into the Android project's `/libs` directory.
-3. Edit your application's `main.xml` file (under `/res/layout`) to look like the following, with the `layout_height`, `layout_width` and `id` modified to suit your application:
+5. Add the following to the application's `/res/xml/main.xml` file,
+ with the `layout_height`, `layout_width` and `id` modified to suit
+ the application:
<org.apache.cordova.CordovaWebView
android:id="@+id/tutorialView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
-4. Modify your activity so that it implements the `CordovaInterface`. You should implement the included methods. You may wish to copy them from `/framework/src/org/apache/cordova/CordovaActivity.java`, or implement them on your own. The code fragment below shows a basic application that uses the interface. Note how the referenced view id matches the `id` attribute specified in the XML fragment shown above:
+6. Modify your activity so that it implements the `CordovaInterface`. You should implement the included methods. You may wish to copy them from `/framework/src/org/apache/cordova/CordovaActivity.java`, or implement them on your own. The code fragment below shows a basic application that uses the interface. Note how the referenced view id matches the `id` attribute specified in the XML fragment shown above:
public class CordovaViewTestActivity extends Activity implements CordovaInterface {
CordovaWebView cwv;
@@ -108,6 +122,6 @@ Finally, remember to add the thread pool, otherwise the plugins have no threads
return threadPool;
}
-6. Copy your application's HTML and JavaScript files to your Amazon Fire OS project's `/assets/www` directory.
+7. Copy your application's HTML and JavaScript files to your Amazon Fire OS project's `/assets/www` directory.
-7. Copy `config.xml` from `/framework/res/xml` to your project's `/res/xml` directory.
+8. Copy `config.xml` from `/framework/res/xml` to your project's `/res/xml` directory.