Introduction to Samsung Smart TV SDK

27
Samsung Smart TV SDK Manikantan K [email protected] @manikantan_k
  • date post

    17-Oct-2014
  • Category

    Technology

  • view

    1.902
  • download

    0

description

Overview of getting started with Samsung Smart TV SDK 4.5 for an app developer. Outlines the different programming languages supported by the platform including HTML5, and some devices APIs.

Transcript of Introduction to Samsung Smart TV SDK

Page 1: Introduction to Samsung Smart TV SDK

Samsung Smart TV SDK

Manikantan K

[email protected]@manikantan_k

Page 2: Introduction to Samsung Smart TV SDK

What is Samsung SMART TV App?

• Samsung Smart TV applications are web-based small software programs that run on Digital TVs connected to the Internet.

• Applications are installed on TVs via Internet and run on App Engine

Application Manager

App Engine

Page 3: Introduction to Samsung Smart TV SDK

Operating Principle

Page 4: Introduction to Samsung Smart TV SDK
Page 5: Introduction to Samsung Smart TV SDK
Page 6: Introduction to Samsung Smart TV SDK
Page 7: Introduction to Samsung Smart TV SDK
Page 8: Introduction to Samsung Smart TV SDK
Page 9: Introduction to Samsung Smart TV SDK

Visit www.samsungdforum.com to download the latest SDK

Samsung D Forum

Page 10: Introduction to Samsung Smart TV SDK

Smart TV SDK evolution

2.x

• Designed for 2011 Devices ( D Model )

• HTML5/CSS3 Support

• Maple Web Engine

3.x

• Designed for 2012 Devices ( E Model )

• Smart Interaction, In-Apps Ads & Convergence Support

• WebKit Web Engine

4.x

• Designed for 2013 Devices ( F Model )

• Smart Interaction 2.0 Support

• Eclipse Based IDE (Linux & Mac OS SDK Available)

http://www.samsungdforum.com

Page 11: Introduction to Samsung Smart TV SDK

Project Types

Flash 11.1Native Client

SDK 4.5+

Page 12: Introduction to Samsung Smart TV SDK

Improved HTML5 support

• Support for <video> and <audio> tags

• For formats & support, see link

http://www.samsungdforum.com/Guide/art00066/index.html

<video src=“movie.mp4” width=“320” height=“240”>No HTML5 video tag support.</video>

Page 13: Introduction to Samsung Smart TV SDK

Improved HTML5 support

• Support for <canvas> tag

http://www.samsungdforum.com/Guide/art00066/index.html

<canvas id=“example” width=“200” height=“200”>This text is displayed if your browser does not support HTML5 canvas.</canvas>

var example = document.getElementById(‘example’);var context = example.getContext(‘2d’);context.fillStyle = “rgd(255,0,0)”;context.fillRect(30,30,50,50);

Page 14: Introduction to Samsung Smart TV SDK

Web Device APIList of APIs to access low level functionalities of the Smart TV like

• Network capabilities

• TV channels

• Gamepad connectivity

• External Camera support

• Microphone

• Filesystem

• Voice recognition

• MIDI etc<script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/webapis.js"></script>

Page 15: Introduction to Samsung Smart TV SDK

Web Device API > Network

• Check network connection

• Set Listeners for changes

http://www.samsungdforum.com/Guide/ref00008/network/dtv_network_module.html

try { webapis.network.getAvailableNetworks(successCB, errorCB);

} catch(err) {alert(err.name);

}

function successCB(networks) {for(var i=0; I < networks.length; i++) {

if(networks[i].isActive() ) {networks[i].setWatchListener(watchCB, errCB);

} }}

Page 16: Introduction to Samsung Smart TV SDK

Web Device API > TVChannel

• Get ProgramList for current channel

http://www.samsungdforum.com/Guide/ref00008/tvchannel/dtv_tvchannel_module.html

try { var channel = webapis.tv.channel.getCurrentChannel();webapis.tv.channel.getProgramList(channel, webapis.tv.info.getEpochTime(),

successCB, errorCB, 3600 );} catch(err) {

alert(err.name);}

function successCB(programs) {console.log(“program query success”);

}

Page 17: Introduction to Samsung Smart TV SDK

Single Handed Gestures• You need to include mouse support in

config.xml<mouse>y</mouse>

• Mouse listener like the web.• Create a div in scene1.html<div id="button0">Button</div> <!-- make it as button --><div id="div0“></div> <!-- make it as trial element -->

• Adding listenerdocument.getElementById('div0').addEventListener('mouseover', function(){

document.getElementById('div0').style.backgroundColor = 'lime';}, false);

document.getElementById('div0').addEventListener('mouseout', function(){document.getElementById('div0').style.backgroundColor = 'yellow';}, false);

document.getElementById('div0').addEventListener('click', function(){alert("clicked");}, false);

Page 18: Introduction to Samsung Smart TV SDK

Double Handed GesturesCheck for support/enabled

if (webapis.recognition.IsRecognitionSupported()) { if (webapis.recognition.IsGestureRecognitionEnabled()) {// perform Recognition related actions here, e.g. subscribe } else { alert("ERROR: Gesture recognition is not enabled"); }

} else { alert("ERROR: Gesture recognition not supported"); }

Subscribe to eventswebapis.recognition.SubscribeExEvent(webapis.recognition.PL_RECOGNITION_TYPE_GESTURE, “returnID", function (evt) { that.handleRecognitionEvent.call(that, evt); });

EVENT_GESTURE_2HAND_ZOOM , EVENT_GESTURE_2HAND_ROTATE etc

Page 19: Introduction to Samsung Smart TV SDK

Voice Recognition• Embedded Mode

Predefined voice commands.The engine does more of comparison than recognitionDoes NOT require internet.Limited to comparing between 7 items.

• Server Guide ModeFree- form speech.Depends heavily on user’s linguistics and pronunciation.Voice Data is sent to internet to recognize user’s speech.No limits.

Page 20: Introduction to Samsung Smart TV SDK

Voice Recognition

• Add the voice tag in the config.xml

– <voice>y</voice>

• Include the following library in the index.html

– $MANAGER_WIDGET/Common/webapi/1.0/deviceapis.js– The VR library can be used under the deviceapis.recognition

object

• Set Helpbar!

Page 21: Introduction to Samsung Smart TV SDK

Voice Recognition

• Not all TV Series have VR feature, it be best to check device compatibility before using the feature.

• Check Device VR Feature Availibility:– deviceapis.recognition.IsRecognitionSupported()

• Check Device VR Feature Enabled or Disabled:– deviceapis.recognition.IsVoiceRecognitionEnabled()

• Check Device Server Guide VR Availibility:– deviceapis.recognition.IsVoiceServerLanguageSupported()

Page 22: Introduction to Samsung Smart TV SDK

Voice Recognition

• Since the VR runs separately with apps, the apps must subscribe to VR events to use the data from VR.

deviceapis.recognition.SubscribeExEvent(

deviceapis.recognition.PL_RECOGNITION_TYPE_VOICE,

"VoiceEvt",

Main.onVoiceEvent

);

deviceapis.recognition.UnsubscribeExEvent(

deviceapis.recognition.PL_RECOGNITION_TYPE_VOICE,

"VoiceEvt”

);

Page 23: Introduction to Samsung Smart TV SDK

Built-In Emulator

Virtual Box based. Can test voice and gesture input.

Page 24: Introduction to Samsung Smart TV SDK

Web Inspector

Breakpoints, stepping and debugging support

Page 25: Introduction to Samsung Smart TV SDK

Automatic Test Tool

Create input test sequences, schedule screen captures, record events

Page 26: Introduction to Samsung Smart TV SDK

Important TV vs Emulator

• Performance

• Viewing Distance

• Usage with remote control / Interaction

Page 27: Introduction to Samsung Smart TV SDK

Thank You