Steps to Convert a Tizen Application to Orsay

The Samsung TV app development is developed using the HTML and the CSS. When the native component of the Smart TV is not being used, it is used in developing the application for it to run on the different Smart TV’s like the Tizen, LG, Opera, Smart Alliance, Orsay. The Samsung TV app developer requires the Tizen code and the Samsung Smart TV SDK along with the IDE. Additionally, the Samsung TV app developer will need to have immense knowledge about HTML, JavaScript, AngularJS, and CSS. Just like the Samsung TV app development process, the steps required for the conversion of Tizen application to the Orsay are as follows:

  • The sample project is created for the Orsay TV.  The AngularJS based application is completely based on the HTML/UI component type, instead of the usual Native UI component. Here, the focus handling is being done by either the AngularJS or the JavaScript as well.

 

  • The Samsung Tv app developer, on creating the project for the Orsay TV, will find two files get automatically created namely the widget.info and config.xml. This widget.info is mainly responsible for managing the resolution. The other file config.xml is the one that has the complete configuration of the entire project. The Samsung TV app developer will now delete the config file of the Tizen application and paste the contents in the project created.

 

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

  • The next major step will be to add the common API in the Index.html file in order to run the application in the Samsung app development process.

 

<!– Common widget API–><script type=”text/javascript”

src=”$MANAGER_WIDGET/Common/API/Plugin.js”></script>

<script type=”text/javascript” language=”javascript” src=”$MANAGER_WIDGET/Common/API/TVKeyValue.js”></script>

 

  • The Caph library that is very much required for the Samsung TV app development can be added by the Samsung TV app developer in the Index.html.

<!– Caph Library –>

<script src=”$CAPH/1.0.0/caph-level1-unified.min.js” type=”text/javascript”></script>

 

The function is then added to onload of the body section to start the application.

<body onload=”func_onLoad();”> </body>

 

  • The next step will be to add the script to the head section of the index.html that contains the function named func_onLoad() that is required to start the application in the Samsung TV app development.

 

<script>

var flag = false;

var widgetAPI = new Common.API.Widget();

var pluginAPI = new Common.API.Plugin();

function func_onLoad() {

if (typeof curWidget != ‘undefined’) {

curWidget.setPreference(“ready”, “true”);

}

if (!caph.platform.dtv.Browser

|| caph.platform.dtv.Browser.browserType().sectvbd) {

} else {

widgetAPI.sendReadyEvent();

}

}

window.onShow = function(e) {

if (flag === false) {

flag = true;

widgetAPI.sendReadyEvent();

}}

</script>

 

  • Now, from the Samsung TV app development, the mapping of TV keys will have to change from the Tizen to the Orsay. Now in the Samsung TV development process, the application now runs successfully with the entire focus of the application. The changed Mapping keys can be coded like below,

 

var tvKeyOrsay = new Common.API.TVKeyValue();

var tvKey = {

KEY_RETURN : tvKeyOrsay.KEY_RETURN,

KEY_PANEL_RETURN : tvKeyOrsay.KEY_PANEL_RETURN,

KEY_EXIT : tvKeyOrsay.KEY_EXIT };

 

  • The Samsung TV app developer then will have to completely block the default navigation to return the keys of the remote control.

 

window.addEventListener(“keydown”, function (event) {

switch (event.keyCode) {

case tvKey.KEY_RETURN:

var widgetAPI = new Common.API.Widget();

widgetAPI.blockNavigation(event);

break;}}

 

  • The next step is that the Samsung TV app developer needs to completely change the exit key functionality that helps in the Samsung TV app development conversion

window.addEventListener (“keydown”, function (event) {

switch (event.keyCode) {

case tvKey.KEY_EXIT:

var widgetAPI = new Common.API.Widget();

widgetAPI.sendExitEvent(event);

break;}

}

 

For the Samsung app development, the above steps should be followed sequentially to convert the Tizen application to Orsay. Features like the network connection scanning, keyboard handling, application resolution can also be achieved to utilize the full advantages of the Android TV app development.

 

Few of the points to be noticed for the Samsung TV app developer during this conversion is to always include the platform dependent features in a single place, prefer creating a unique platform dependent functions to perform the various operations like the return, exit etc. By these approaches, the Samsung TV app developer can easily convert Tizen to Samsung TV application development medium like Orsay thereby converting applications for different Smart TVs.