Navigation Menu

Skip to content

Prepare to convert for Legacy (A.K.A. Orsay)

zuzu_yun edited this page Feb 20, 2017 · 4 revisions

Describes how to convert applications from Legacy app to TOAST app.

Package

You can get Toast app by platform as the following.

  • You should delete config.xml in your Legacy app project.

  • For making the toast.js cordova.js, Please refer the Prepare to start

  • For package the app, Please refer the Build and Package

  • If you want to use preexisting code to jumpstart your project, you must create your tizen project to template before you create cordova application for using this option, --template.

The reference url : Cordova app templates / Toast sample app / Toast issue #19

```sh
# Create TOASTApp cordova application using your Legacy project
cordova create MyTOASTApp --template=../../MyLegacyApp
cd MyTOASTApp 
npm install ../grunt-cordova-sectv
cp -rf ../grunt-cordova-sectv/sample/* ./
npm install
cordova platform add browser
cordova plugin add ../cordova-plugin-toast

# Run on browser platform
cordova build browser
cordova emulate browser

# Prepare for sectv-orsay platform
grunt sectv-prepare:sectv-orsay

# Prepare for sectv-tizen platform
grunt sectv-prepare:sectv-tizen
```

Precondition

First, Include toast.js cordova.js.

  • Include toast.js right after the including cordova.js in index.html.

    <script src="cordova.js"></script>
    <script src="toast.js"></script>
  • For conversion to TOAST App from Legacy App, you should remove it which has dependency of Legacy platform.

  • You can convert with reference to the following index of Converting Guide(Legacy App to Tizen App).

  • The part of converting Legacy API to Tizen API in the guide will be convert to TOAST API.

    • 3.1 Object Tag and Plugin APIs
    • 3.2 Common API
    • 3.3 Curwidget
    • 3.4 Alert
    • 3.5 Viewport
    • 3.6 Network Policy
    • 3.7 Anchor Tag
    • 3.9 PlayPause button to existing application

deviceready event

  • The toast object is not available until after the deviceready event which is provided by Cordova.

    document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {
        console.log("start the app");
    }
Clone this wiki locally