WarsawJS Slides: First app on Samsung Smart TV

We talk about JavaScript. Each month in Warsaw, Poland.


Piotr Kowalski

"First app on Samsung Smart TV platform"



Problems & Restrictions

  1. Remote controller (without mouse and keyboard)
  2. Limited space for all view port of application (not infinity longest page)
  3. Not everywhere WebKit (in old platforms Maple4)
  4. Low internet connection (application should always waiting for long request)
  5. Lazy user? (with beer and remote controller in hand on sofa)

How to start?

  1. TV: Price: +600pln or Blu-Ray: Price: +300pln
  2. Register account: develop
  3. Installation on workstation Samsung Smart TV SDK?
  4. Pair device with workstation by set IP Address
  5. Synchronize

Necessary (minimum) files

  1. ~/projects/first_app/config.xml
  2. ~/projects/first_app/index.html
  3. ~/projects/first_app/scripts/boot.js
  4. ~/projects/first_app/images/thumb.png
  5. ~/projects/widgetlist.xml
  6. ~/projects/widget/first_app.zip


                <?xml version="1.0" encoding="utf-8"?>
                 <widgetname>Project Name</widgetname>


                <!DOCTYPE html>
                <html lang="en">
                 <script src="scripts/boot.js"></script>
                <body style="margin: 0px;">
                 <img src="http://lorempixel.com/960/540/sports/" />


                // Alias to launched widget. `||` for browser protection.
                var launchWidget = window.curWidget || {};
                // Smart Hub call method `onload` on launch widget.
                window.onload = function () {
                 // Inform Smart Hub, that app is ready.
                 if (typeof launchWidget.setPreference === 'function') {
                  launchWidget.setPreference('ready', 'true');



                <?xml version="1.0" encoding="UTF-8"?>
                <rsp stat="ok">
                  <widget id="first_app">
                  <compression size="10000000" type="zip"/>
                  <download>http://[PC IP]/widget/first_app.zip</download>


Synchronize warnings

Synchronize process

  1. Device requesting for file widgetlist.xml
  2. Next, device read that file, and download defined inside packages
  3. After completion shows popup with success message

Now, we could launch new smart tv app!



Samples applications

Helpful tools

  1. Browser - Develop app for TV, but try keep running on browser
  2. Gulp - Tasking, ex. create zip package with command: $ gulp zip
  3. Weinre - Web Inspector Remote
  4. Network Link Conditioner - Manage your down / up net limits
  5. Emulator?


See you next month at WarsawJS

Fork me on Github