Develop Web Simulator

From Tizen Wiki
Jump to: navigation, search

How to update Web Simulator in Tizen SDK

Download the source code of Web Simulator

Set up development environment

$ unzip web-simulator-ivi.zip
$ cd web-simulator-ivi
$ sudo ./configure
$ jake

A folder 'web' will be generated in the './pkg' directory

Further develop and integrate into Tizen SDK

Develop code in './lib' folder and run 'jake' command.

Copy the 'web' folder into Tizen SDK installation directory and replace the original one. The default plugin directory of web simulator will be as below.

Windows Linux Mac OS
C:/tizen-sdk/tools/websimulator ~/tizen-sdk/tools/websimulator ~/tizen-sdk/tools/websimulator

Launch Tizen SDK and run Web Simulator. Then, new implementation will take effect.

How to update or add a module in 'tizen' namespace

Update an existing module

E.g., tizen.vehicle

Add or modify methods and properties in './lib/ripple/platform/ivi/3.0/vehicle.js'.

Add or modify type definition accordingly in './lib/ripple/platform/ivi/3.0/typedef.js'.

Add a new module

Create a new '.js' file in './lib/ripple/platform/ivi/3.0/'. The file name should be same as the module name.

Implement related methods and export the module object.

  • If there are sub-features defined in the module, an extra method 'handleSubFeatures' should be defined.
    • See example, './lib/ripple/platform/ivi/3.0/vehicle.js'.

Register a module entry to 'tizen' object in './lib/ripple/platform/ivi/3.0/spec.js'.

Register all features priviledge of this module in './lib/ripple/platform/ivi/3.0/spec/config.js'.

How to update or add a device panel in Web Simulator

Update an existing panel

E.g., Vehicle

Add or modify widgets in './lib/ripple/ui/plugins/vehicle/panel.html' and './lib/ripple/ui/plugins/vehicle.js'.

Add a new panel

Create a folder named with the panel name in './lib/ripple/ui/plugins/' and a file named 'panel.html' in this folder.

Create a new '.js' file in './lib/ripple/ui/plugins/'. The file name should be same as the panel name.

Implement user interface in 'panel.html' and control code in *.js file.

Register the panel in './lib/ripple/platform/ivi/3.0/spec/ui.js'.