Testing Your Application on a TV for 2014
Setting the environment for developing Samsung SMART TV application
Once you have finished testing and debugging your application on the emulator, it is time to upload your Samsung Smart TV application to a TV set for testing on a full target system.
The functionality of a Samsung Smart TV application can be easily tested using the emulator. The results of any code change can be viewed immediately, thereby enabling incremental development. However, note that the emulator is never an exact simulation of the TV as it runs on different hardware. Therefore, to be certain of how an application will behave, you must also run it on a Samsung Smart TV.
The TV environment is different from the computer environment in the following ways:
- Less memory is available on the TV; therefore an application may run out of memory.
- A real TV picture can be seen and the blending of widget graphics over a TV picture can be evaluated.
- The response to remote control keys may have a different timing; therefore the responsiveness to user key presses must be separately tested.
Applications uploaded directly from the development PC to a TV set are known as User Applications. The Smart Hub’s User Application feature allows developers to upload applications from the local server directly to the TV for testing, without affecting other users of Samsung Smart TV.
To configure the computer for testing your application on a TV, you must:
You are prompted to install the Apache web server during the Samsung Smart TV SDK installation. The web server is used to host Smart TV apps that will be downloaded from your development PC to the real TV for testing. It is recommended that you choose all default options. If you skip the Apache installation, you can either:
- Re-install the SDK and choose Apache
- Manually install Apache (version 2.2.16).
If you wish, you may also use a different web server.
You must configure the SDK to set the correct location for uploading widgets by doing the following:
- Close the emulator.
- Select the Preferences option from the Window menu. A number of tabs are listed on the left.
- Enter the User App Sync Server (with TV) tab from the Samsung SMART TV tab.
- Enter Server PC IP.
- Enter Root folder(ex. [$Apache install directory]\htdocs).
Use the Browse button to select a folder that is either directly accessed by a web server or another directory where files can be stored for later uploads (for example by FTP).
Before packaging applications for uploading to the TV, you must first develop and test the application using the emulator.
To package the user application for uploading to a TV :
- Mark your application as a user application by adding a line to the config.xml file, between the
andtags, as follows : <type>user</type>
- Right click the user application project and click the Export button.
A export dialog box is displayed(see the figure below).
A ZIP Export dialog box is displayed(see the figure below).
- Enter the Package file tab from Samsung SMART TV Apps tab and click the Next button.
A ZIP Export dialog box is displayed(see the figure below).
- Enter :
- Application name and version number
- Region where the application will be used
- Package date (the default is the current date)
- These settings determine the file name that is used for the package.
- Select Update the packaged files on the server, and enter a title and description for the App (see the figure below).
Click Finish button.
The message Packaging finished is displayed. If you are using the default installation folder, the packaged application is on the Apache web server.
Transfer the widgetlist.xml file, the widget folder and its contents to the web server so that they can be accessed:
Multiple applications can be packaged and stored on the web server to be uploaded together. Give each one a description in the widgetlist.xml file and store the files for each in the widget folder.
To configure the TV for testing applications:
- Set up the network.
- Login to User App and Install an application.
- Running and Testing an Application.
To set-up the network:
- Connect the TV by Ethernet cable to an IP network that has access to the web server where the packaged application is stored.
- In the TV Settings menu, select Network, and enter Network Setup.
- Choose either automatic configuration (for DHCP) or manual configuration (for fixed IP address).
- For manual configuration, enter IP address, subnet mask, and gateway and DNS servers.
- To see that the network is functioning correctly, select Network Test. If the test fails, contact your network administrator. If the test succeeds, the TV is correctly connected to the network.
- Press the Return key to go back to the menu.
To login to the User App tool as a developer:
- Ensure that the TV country is set to a location where Samsung applications on Samsung SMART TV are used.
- Press Menu button on the remote control
- Enter Smart Features.
- Enter Samsung Account.
- To activate the User Application feature, enter Log In.
Login with “develop” ID (password leave blank).
If you are using a 2013 Samsung Smart TV, you do not need to create an account(the “develop” account has been created in advance).
- Enter the Apps panel.
- Long press the Enter button on remote control to any application. And enter the IP Setting.
- In the boxes, enter the IP address of the web server that contains the packaged application.
- Long press the Enter button on remote control to any application again and enter the Start App Sync.
- The TV indicates that it is installing a new service, and displays the name of your application.
- To enter the application, select it and press the Enter key on the remote control. This action loads the index.html file in the TV web browser.
- Press the Return key on the remote control to return to Smart Hub display.
- Press the Exit key to exit Samsung Smart TV (unless the key is handled by the widget and the API function blockNavigation has been used).
- After further changes are made to the application using the SDK, package it again.
- Synchronize the TV with the server. After this, the updated application is available in Smart Hub for further testing.
Sometimes, user applications on TV can have errors or must be deleted for some other reason. To delete a user application:
- Connect the Ethernet cable and start the Samsung Smart TV.
- Login with “develop” ID.
- Choose the user application that you want to delete and long press the Enter button.