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
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.
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.
Open Samsung Smart TV Apps from folder tree and select “Package file”.
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.
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…
…what is yours?
If you have a problem, please ask. Let’s figure it out.