Skip to content

Tizen API: Application

zuzu_yun edited this page Mar 21, 2017 · 5 revisions

For converting Application API of tizen to TOAST API, please refer to the followings.

If you want more information, please refer to toast.application

exit

  • Before

    tizen.application.getCurrentApplication().exit();
  • After

    toast.application.exit();

launchApp

  • Before

    var appControl = new tizen.ApplicationControl(
          'http://tizen.org/appcontrol/operation/pick',
          null,
          'image/jpeg',
          null);
    
    tizen.application.launchAppControl(
          appControl,
          null,
          function() {console.log('launch application control succeed'); },
          function(e) {console.log('launch application control failed. reason: ' + e.message); },
          null);
  • After

    toast.application.launchApp({appId: 'xxxxxxx', data: {url: 'http://...', info: 'This is video url.'}}, function() {
        console.log('success');
    }, function(err) {
        console.log('fail' + err.message);
    });

getRequestedAppInfo

  • Before

    var reqAppControl = tizen.application.getCurrentApplication().getRequestedAppControl();
    if (reqAppControl) {
      console.log('Requester AppID : ' + reqAppControl.callerAppId);
    
      var appControl = reqAppControl.appControl;
      if (appControl.operation == 'http://tizen.org/appcontrol/operation/pick') {
          var data = new tizen.ApplicationControlData('http://tizen.org/appcontrol/data/selected', ['Image1.jpg']);
          reqAppControl.replyResult([data]);
      }
    }
  • After

    toast.application.getRequestedAppInfo(function(reqAppInfo) {
        console.log('success' + reqAppInfo.callerAppId + ' ' + JSON.stringify(reqAppInfo.data));
    }, function(err) {
        console.log('fail' + err.message);
    });
Clone this wiki locally