Skip to content

Prepare to convert for Tizen

zuzu_yun edited this page Mar 21, 2017 · 6 revisions

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

Package

You can get Toast app by platform as the following.

  • You should delete config.xml in your tizen project.

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

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

  • 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.

# Create TOASTApp cordova application using your tizen project
cordova create MyTOASTApp --template=../../MyTizenApp
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>
  • webapi.js will be added by Cordova in index.html. So remove the below code.

    <script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>

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