From 62340911b2a511cdd1bd0b11624288ede244e72a Mon Sep 17 00:00:00 2001 From: Jakub Skowron Date: Mon, 27 Jun 2016 15:02:16 +0200 Subject: [PATCH] Cordova tutorials and guide: Console Change-Id: Ib1967c5e24d091ac6627da21f12b3561730cc101 Signed-off-by: Jakub Skowron --- .../html/web/tizen/cordova/console_w.htm | 91 ++++++++++++++ .../html/web/tizen/cordova/cordova_guide_w.htm | 65 ++++++++++ org.tizen.guides/html/web/tizen/guides_tizen_w.htm | 2 + org.tizen.tutorials/html/index.htm | 6 + .../html/web/tizen/cordova/console_tutorial_w.htm | 136 +++++++++++++++++++++ .../html/web/tizen/cordova/cordova_tutorials_w.htm | 98 +++++++++++++++ .../html/web/tizen/tutorials_tizen_w.htm | 2 + 7 files changed, 400 insertions(+) create mode 100644 org.tizen.guides/html/web/tizen/cordova/console_w.htm create mode 100644 org.tizen.guides/html/web/tizen/cordova/cordova_guide_w.htm create mode 100644 org.tizen.tutorials/html/web/tizen/cordova/console_tutorial_w.htm create mode 100644 org.tizen.tutorials/html/web/tizen/cordova/cordova_tutorials_w.htm diff --git a/org.tizen.guides/html/web/tizen/cordova/console_w.htm b/org.tizen.guides/html/web/tizen/cordova/console_w.htm new file mode 100644 index 0000000..ab6b03c --- /dev/null +++ b/org.tizen.guides/html/web/tizen/cordova/console_w.htm @@ -0,0 +1,91 @@ + + + + + + + + + + + + + Console + + + + + +
+

Console

+ + +

You can write messages to system console for debugging purposes.

+ +

The main features of the Console API include:

+ + + + + + + + + + + +
Note
Wait for deviceready event before using Cordova features. + The console global object is available earlier, but it points to default system console.
+ + + + + + + + + + +
Note
See results in system console available in your IDE.
+ + + +
+ +Go to top + + + + + + + diff --git a/org.tizen.guides/html/web/tizen/cordova/cordova_guide_w.htm b/org.tizen.guides/html/web/tizen/cordova/cordova_guide_w.htm new file mode 100644 index 0000000..cd5f4e6 --- /dev/null +++ b/org.tizen.guides/html/web/tizen/cordova/cordova_guide_w.htm @@ -0,0 +1,65 @@ + + + + + + + + + + + + + Cordova + + + + + +
+

Cordova

+ +

Cordova includes common features useful in creating Tizen Web applications.

+

The main features are:

+
    +
  • Console

    Write information to system console. It includes timing operations and object dump.

  • +
+ + + + +
+ +Go to top + + + + + + + diff --git a/org.tizen.guides/html/web/tizen/guides_tizen_w.htm b/org.tizen.guides/html/web/tizen/guides_tizen_w.htm index 4d18ea5..819ac30 100644 --- a/org.tizen.guides/html/web/tizen/guides_tizen_w.htm +++ b/org.tizen.guides/html/web/tizen/guides_tizen_w.htm @@ -59,6 +59,8 @@

Enables you to manage accounts and account information.

  • Social in mobile applications only

    Enables you to manage the user's personal data, such as contacts, calendars, and call and browsing history, on the device.

  • +
  • Cordova +

    Common features useful in creating Tizen Web applications

  • diff --git a/org.tizen.tutorials/html/index.htm b/org.tizen.tutorials/html/index.htm index fa50627..89fcc03 100644 --- a/org.tizen.tutorials/html/index.htm +++ b/org.tizen.tutorials/html/index.htm @@ -317,6 +317,12 @@
  • Data Synchronization
  • +
  • Cordova + +
  • +
  • Service Application
  • diff --git a/org.tizen.tutorials/html/web/tizen/cordova/console_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/cordova/console_tutorial_w.htm new file mode 100644 index 0000000..81f5c06 --- /dev/null +++ b/org.tizen.tutorials/html/web/tizen/cordova/console_tutorial_w.htm @@ -0,0 +1,136 @@ + + + + + + + + + + + + + Console: writing messages to system console + + + + + + +
    + +

    Console: writing messages to system console

    + + +

    This tutorial demonstrates how you can write information to system console. It includes timing operations and object dump (dir).

    + +

    Global console object contains some additional features defined by Cordova.

    + + + + + + + + + + +
    Note
    Wait for deviceready event before using Cordova features. +
    document.addEventListener( "deviceready", onDeviceReady );
    +
    +function onDeviceReady() {
    +    //Cordova is ready...
    +}
    +
    + +

    Warm-up

    + + +

    Log messages and errors

    +

    Write simple log and error message to system console.

    + +
      +
    1. console.log("console.log works well");
      +console.error("console.error works well");
      +
    2. +
    + + + + + + + + + +
    Note
    See results in system console available in your IDE, or by using sdb dlog
    + +

    Formatting objects

    +

    Print a JavaScript representation of the specified object.

    + +
      +
    1. var john = {name: "John", surname: "Doe"};
      +console.dir(john.name);
    2. +
    3. Use %o formatting: +
      var john = {name: "John", surname: "Doe"};
      +console.dir( "my object %o", john );
    4. +
    + + +

    Timing

    +

    Measure time elapsed during some operation. Each timer has its label (a string) which is used to identify the timer.

    + +
      +
    1. Start timer, give it a label
      console.time("Big array initialization");
    2. +
    3. Do some operation
      var array = new Array(1000000);
      +for (var i = array.length - 1; i >= 0; i -= 1) {
      +  array[i] = new Object();
      +};
    4. +
    5. Stop the timer by passing the same label to timeEnd +
      console.timeEnd("Big array initialization");
    6. +
    7. Output will be visible in system console.

      +
      Big array initialization: 176ms
    8. +
    + + + + + +
    + +Go to top + + + + + + + diff --git a/org.tizen.tutorials/html/web/tizen/cordova/cordova_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/cordova/cordova_tutorials_w.htm new file mode 100644 index 0000000..e1bee0f --- /dev/null +++ b/org.tizen.tutorials/html/web/tizen/cordova/cordova_tutorials_w.htm @@ -0,0 +1,98 @@ + + + + + + + + + + + + + Cordova: Multiplatform Framework + + + + + + +
    + +

    Cordova: Multiplatform Framework

    + +

    Tutorials demonstrate how to use the following features in creating Tizen Web applications:

    + + + + + + + + + + + +
    Note
    To perform these operations, you need to wait until Cordova is fully set up. Wait for deviceready event before using + any Cordova features. +
    + +

    Warm-up

    +

    Example:

    +
    document.addEventListener("deviceready", onDeviceReady, false);
    +
    +function onDeviceReady() {
    +    console.log( "Cordova features now available" );
    +    console.log( "Connection type: " + navigator.connection.type );
    +}
    + + + + + + + + + + +
    Note
    See results in system console available in your IDE, or by using sdb dlog
    + + + + +
    + +Go to top + + + + + + + diff --git a/org.tizen.tutorials/html/web/tizen/tutorials_tizen_w.htm b/org.tizen.tutorials/html/web/tizen/tutorials_tizen_w.htm index cd1dce1..4d2a369 100644 --- a/org.tizen.tutorials/html/web/tizen/tutorials_tizen_w.htm +++ b/org.tizen.tutorials/html/web/tizen/tutorials_tizen_w.htm @@ -56,6 +56,8 @@

    Demonstrates how you can manage and retrieve information from the device and its sensors.

  • Account: Managing Accounts and Account Information in mobile applications only

    Demonstrates how you can manage accounts and retrieve account information.

  • +
  • Cordova: Multiplatform Framework +

    Demonstrate how to use Cordova features in creating Tizen Web applications.

  • Social: Managing Personal Data in mobile applications only

    Demonstrates how you can manage the user's personal data, such as contacts, calendars, location data, and call and browsing history, on the device.

  • -- 2.7.4