App Development Guide for Samsung Smart TV[V1.20][1] 3

Embed Size (px)

DESCRIPTION

App Development Guide for Samsung Smart TV[V1.20][1] 3for Samsung Smart TV application Development

Text of App Development Guide for Samsung Smart TV[V1.20][1] 3

Application Development Guide for Samsung Smart TV

Version 1.20

Samsung Smart TV

Application Development Guide for Samsung Smart TVAPPLICATION DEVELOPMENT GUIDE FOR SAMSUNG SMART TV .......................................................... 1

PREFACE ............................................................................................................................................................................ 7 1. INTRODUCTION .................................................................................................................................................... 8 1.1. 2. WHAT IS SAMSUNG SMART TV? .......................................................................................................................... 8

SAMSUNG SMART TV ........................................................................................................................................... 9 2.1. 2.2. OPERATING PRINCIPLE ......................................................................................................................................... 9 OPERATING ENVIRONMENT .................................................................................................................................. 9

3.

APPLICATIONS .................................................................................................................................................... 10 3.1. 3.2. 3.3. 3.4. 3.5. 3.6. WHAT ARE APPLICATIONS? ................................................................................................................................. 10 STRUCTURE OF AN APPLICATION ........................................................................................................................ 10 DISPLAY TYPE OF APPLICATIONS ........................................................................................................................ 11 RUNNING AN APPLICATION ................................................................................................................................. 12 APPLICATION MANAGER .................................................................................................................................... 12 FEATURES OF SAMSUNG APPLICATIONS ............................................................................................................. 13

4.

CREATING AN APPLICATION .......................................................................................................................... 14 4.1. 4.2. WHAT YOU NEED TO CREATE AN APPLICATION.................................................................................................... 14 HOW TO MAKE AN APPLICATION ........................................................................................................................ 14 Writing config.xml ..................................................................................................................................... 15 Writing index.html ..................................................................................................................................... 16 Writing JavaScript .................................................................................................................................... 16 Writing a CSS ............................................................................................................................................ 17 Use of the remote control .......................................................................................................................... 18 Complete your work & Sample code......................................................................................................... 20config.xml ...............................................................................................................................................................20 index.html ...............................................................................................................................................................21 Main.js ....................................................................................................................................................................21 Main.css ..................................................................................................................................................................22

4.2.1. 4.2.2. 4.2.3. 4.2.4. 4.2.5. 4.2.6.4.2.6.1. 4.2.6.2. 4.2.6.3. 4.2.6.4.

4.3.

CONFIG.XML ....................................................................................................................................................... 23

4.3.1. 4.3.2. 4.4.

Tag information ......................................................................................................................................... 23 Example .................................................................................................................................................... 26

SINGLE-SIGN-ON ............................................................................................................................................... 27 What is Single-Sign-On ............................................................................................................................. 27 Registration of Account Information on Service Sites............................................................................... 28

4.4.1. 4.4.2.

2

Application Development Guide for Samsung Smart TV4.4.3. 4.5. How to download account information on service sites in applications ................................................... 30

RESET ................................................................................................................................................................ 32 What is Reset? ........................................................................................................................................... 32 How Reset Works? .................................................................................................................................... 32 Necessary Features Developers Should Realize ....................................................................................... 32 Guide for Config.xml Realization ............................................................................................................. 32 Guide for Module Realization ................................................................................................................... 32

4.5.1. 4.5.2. 4.5.3. 4.5.4. 4.5.5. 4.6. 5.

EXAMPLE FOR XHR COMMUNICATION .............................................................................................................. 34

COMMON MODULES .......................................................................................................................................... 37 5.1. 5.2. 5.3. 5.4. APPLICATION MANAGERS COMMON MODULES ................................................................................................. 37 HOW TO USE COMMON MODULES ....................................................................................................................... 37 TVKEYVALUE ................................................................................................................................................... 37 WIDGET ............................................................................................................................................................. 40 sendReadyEvent() ..................................................................................................................................... 40 sendExitEvent() ......................................................................................................................................... 41 sendReturnEvent() .................................................................................................................................... 41 blockNavigation() ..................................................................................................................................... 41 putInnerHTML() ....................................................................................................................................... 42 getChannelWidgetListPath() ..................................................................................................................... 43 getSearchWidgetListPath() ....................................................................................................................... 43 runSearchWidget() .................................................................................................................................... 44 checkSapTicket () ...................................................................................................................................... 44 requestSapTicket () .................................................................................................................................... 45

5.4.1. 5.4.2. 5.4.3. 5.4.4. 5.4.5. 5.4.6. 5.4.7. 5.4.8. 5.4.9. 5.4.10. 5.5.

PLUGIN .............................................................................................................................................................. 45 setOnWatchDog() ...................................................................................................................................... 47 setOffWatchDog()...................................................................................................................................... 47 setOnOSDState() ....................................................................................................................................... 48 setOffOSD