Getting your Smart TV app to Samsung TV (from Mac OS X).

koppis

I’ve been studying Samsung Smart TV development environment for a week now. Yesterday I finally got my first app deployed to my TV, but I gotta say, Samsung didn’t make it too easy and the developer community ain’t the most lively one. That’s why I decided to tell you in my first tutorial, how to do the trick.

Before hopping in to the action, I’d like to remind you, that there are instructions for deploying the app on Samsung developer page. However, it seems those instructions are a bit outdated. I also assume you’ve already fooled around a bit with Samsung Smart TV SDK 5.0. If not, you can find the software from here and come back when you’re familiar with it.

This tutorial is for Samsung SDK 5.0 and Mac OS X (Mountain Lion).

1. Installing the server

Apache server in Mountain Lion is not as easily accessible as before, but it’s still running in the system. Follow these instructions and you will get it started and configured.

2. Eclipse server settings

In Eclipse, open Preferences > Samsung SmartTV > Server

Screen Shot 2014-01-20 at 10.18.21 PM

If you don’t know what is the IP of your computer, go to System Preferences > Network > Advanced > TCP/IP. Then look for “IPv4 Address”.

As you can see, I’ve set my root folder to /Library/WebServer/Documents/samsung. You can name the folder whatever you like.

When the app package is exported from SDK it is supposed to create .zip file in the server folder. That’s not what happens with me, but it doesn’t matter because the file can be copied in to the right place. However, it’s probably a good idea to set the server IP and folder properly.

3. Export

This differs quite a bit from what Samsung says in the developer guide.

Right click the app you want to export at Project Explorer window and select Export. If Project Explorer is not visible, open it from Window > Show View.

Screen Shot 2014-01-20 at 10.39.35 PM

Open Samsung Smart TV Apps from folder tree and select “Package file”.

Screen Shot 2014-01-20 at 10.41.55 PM

Click “Next”.

Screen Shot 2014-01-20 at 10.43.57 PM

Select region, toggle “Update the packaged files on the server” (for me it doesn’t), set title and description and click “Finish”. Now you’ll get a popup window which tells where the package is located. For me, they go to /Users/jaakkokarhu/Package/, so probably it’s something similar for you too.

4. Copy/paste the .zip file to right server folder

Now find the created package (.zip) file in your Finder. Copy it to the server folder you set before (step 2, remember?). If the folder doesn’t exist, create one.

5. Create widgetlist.xml

Okay, this step is very important, so pay attention. You need a file named “widgetlist.xml” to tell Samsung Smart TV, where the zipped app is located in your server. Open notepad or TextWrangler or whatever you prefer and copy this code to it:

<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="ok">
  <list>
    <widget id="AwesomeApp">
      <title>AwesomeApp</title>
      <compression size="10" type="zip"/>
      <description>This app is very, very awesome!</description>
      <download>http://10.0.1.3/samsung/AwesomeApp_0.1_Europe_20140120.zip</download>
    </widget>
  </list>
</rsp>

Now let’s take a look of the file a bit.

Compression size is the package size. I just put there number 10 to demonstrate how little it matters.

<compression size="10" type="zip"/>

Fill description as you like.

<description>This app is very, very awesome!</description>

Be careful with following line, because that tells the TV where to look for the package file. When Smart TV connects to your computer, it at first looks for the widgetlist.xml and then download tag tells where the file actually is. If this is not set properly, the installation won’t begin.

<download>http://10.0.1.3/samsung/AwesomeApp_0.1_Europe_20140120.zip</download>

Replace “samsung” with whatever is the folder you like to keep your apps and “AwesomeApp_0.1_Europe_20140120.zip” with the name of the .zip file.

Save the file with name “widgetlist.xml” to the server root. So, ie. my root folder is /Library/WebServer/Documents.

6. Create developer account to Samsung Smart TV

Actually you don’t need to create the account because it’s built in the system. Grab your remote and open Smart TV. Select login and create new account with the name developer. In my model I don’t need to set password but there can be differences.

Oh, and make sure that your TV is connected to same router as your computer.

7. Upload your app

Fingers crossed now…

When you’re logged in as a developer, select Tools > Developer. Set your IP (yes, the one you’ve found earlier) and select “User Application Synchronization”.

The installation should begin shortly and after it you should see a thumbnail of your app with text “User”.

My result is this…

kuva

…what is yours?

If you have a problem, please ask. Let’s figure it out.

Advertisements

15 thoughts on “Getting your Smart TV app to Samsung TV (from Mac OS X).

  1. What did you need to do to actually create an app?

    When I start Eclipse (the one that’s distributed with the SDK), the splash message mentions samsung smart tv sdk. However, don’t see any such project types nor do I see Samsung Smart TV listed in the servers.

    I’ve read other pages that mentioning running the app as administrator, but they seem to relate to the window version of Eclipse.

    Thoughts?

    • Hi Craig!

      I haven’t fooled around with Smart TV SDK for a while, but let’s see if I can help you out.

      You can create new Smart TV project by clicking “File -> New -> Other -> Samsung Smart TV Apps -> JavaScript App Project”.

      Name the project, click finish. Now you should see the project structure left.

      Then I’ve made two new folders under “App” tree: “htmls” and “scenes”. In “scenes” folder I have file named “Scene1.html” and in “stylesheets” folder I got “Scene1.css”. Then there is “init.js” file under “App” -folder. There I got this code:

      function onStart () {

      sf.scene.show(‘Scene1’);
      sf.scene.focus(‘Scene1’);
      }

      Now playing around with html/css should be pretty straight forward. I remember I used some getting started tutorial for creating this, too bad I can’t recall what it was!

      However, if you can’t create an app at all, then it’s probably because you have installed Eclipse but not Samsung Smart TV SDK. Eclipse is a development platform for various different devices and you have to be sure you’ve installed right extensions to it. Check out the Samsung site again to be sure you’ve installed everything needed.

      Did this help at all?

  2. Thanks for this great guide.
    I have the same issue as craibuc so sadly I have to opt to windows machine dev and it ^&%@#.
    Do you have some additional info on the subject? would really appreciate it.

  3. I’m having the same issue as above, can’t get the Samsung Smart TV options for importing, new projects to work. Replied on the forums to. Sadly this just shows again how Samsung handles its tools..

  4. Hi JAAKKOKARHU,

    Thanks for awesome guide! It helps me a lot.
    Could you also share your experience, how to redeploy application on TV? E.g. I deployed my application zip file, then I made some changes and would like to redeploy it. I just clicked “sync” with new zip file, but nothing happends. I need to delete app and switch off/switch on TV and deploy again to see changes.

    Did you come across my problem?

    Thanks in advance.
    Vlad

    • I’m glad to hear my tutorial is helping you out, Vlad.

      It’s been very long since I tested the Smart TV api and I don’t even have the access to the TV right now, so I’m afraid I can’t help you much. If I remember right, I didn’t encounter that kind of a problem. Have you posted to Samsung developer forum?

      If you find a solution, please post it to this comment section also!

  5. Hi jaakkokarhu,

    Could you please tell me the scenario when I want my package to be deployed on multiple TV size(Samsung Smart TV). My application has tiles, and I wish to increase or decrease the number of tiles displayed in one line. Do I need to create multiple packages of varying tile count in one row for different TV sizes viz; 32 inch, 40 inch, 46 inch, 64 inch, etc. Or, is there some better alternative. Thanks in advance.

    • Hi Shoeb,

      I’m very sorry, but I have no idea. I advice you to go to the Samsung Developer Forum (even thought it’s not the most lively place to ask questions) or Stack Overflow.

      If you find an answer, please post it under this post!

      Cheers,

      Jaakko

  6. Does anyone know how to get the Dish Anywhere app onto a Samsung Smart TV or what streaming device to use to be able to run Dish Anywhere from an iphone, ipad, or macbook pro. So far Samsung does not have the platform, they say, and dish is no help at all. Don’t know where to turn next. Don’t know if Chromecast or Roku or any of those would have the app. Anyone HELP!!!????

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s