top

Testing Your Application on a TV for 2011

Published 2014-10-28 | (Compatible with 2011 models)

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 Samsung Smart TV applications 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; 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 use this feature, follow the instructions below to to set up the a development computer and a TV.

Configuring the Computer

To configure the computer for testing your application on a TV, you must

  1. Install the web server.
  2. Set the SDK preferences
  3. Package application for upload

Installing the Web Server

You are prompted to install the Apache web server during the Samsung Smart TV SDK installation. 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.11).

If you wish, you may also use a different web server.

Setting SDK Preferences

You must configure the SDK to set the correct location for uploading widgets by doing the following:

  1. Close the emulator.

  2. Select the Samsung Smart TV SDK Preferences option from the Samsung Smart TV SDK.

  3. Enter Server PC IP

  4. Enter Root folder (i.e. [$Apache install directory]\htdocs)

    Figure. Location for uploading Apps using Apache

  5. 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).

Packaging Applications for Upload

Before packaging applications for uploading to the TV, you must first develop and test the application using the emulator.

Note

For information on packaging AIR applications for Flash, see Using Adobe AIR in TV Applications.

To package the user application for uploading to a TV:

  1. Mark your application as a user application by adding a line to the config.xml file, between the <widget> and </widget> tags, as follows:

    <type>user</type>
    
  2. Click the App packaging button at the Samsung Smart TV SDK of the menu.

    Figure. App Packaging button

    A Packaging dialog box is displayed (see the figure below).

    Figure. Packaging dialog

  3. 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.

  4. Select menuselection:Update the packaged files on the server, and enter a title and description for the App (see the figure below).

    Figure. Update the packaged files on the server

  5. Click OK. The message Packaging complete is displayed. If you are using the the default installation folder, the packaged application is on the Apache web server.

  6. Transfer the widgetlist.xml file, the widget folder and its contents to the web server so that they can be accessed:

    http://<ip address>/widgetlist.xml
    http://<ip address>/widget/...

    Multiple applications can be packaged and stored on the web server to be uploaded together. Give each each one a description in the widgetlist.xml file and store the files for each in the widget folder.

Configuring the TV

To configure the TV for testing applications:

  1. Set up the network
  2. Login to User App
  3. Install an Application
  4. Run and test an application

Setting up the Network

To set-up the network:

  1. Connect the TV by Ethernet cable to an IP network that has access to the web server where the packaged application is stored.
  2. In the TV Settings menu, select Network, and enter Network Setup.
  3. Choose either automatic configuration (for DHCP) or manual configuration (for fixed IP address).
  4. For manual configuration, enter IP address, subnet mask, and gateway and DNS servers.
  5. 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.
  6. Press the Return key to go back to the menu.

Developer Login

To login to the User App tool as a developer:

  1. Ensure that the TV country is set to a location where Samsung applications on Samsung Smart TV are used. (see the figure below).

  2. Click Samsung Smart TV to display the Samsung Smart Hub.

    Figure. Samsung Smart Hub

  3. Click Login (see the figure below).

    Figure. Login

  4. Press the SMART HUB button on the remote control.

  5. To activate the User Application feature, set the login name (Smart Hub ID) to “develop” and select Create Account (see the figure below).

    Figure. Activate User Application feature

  6. In the Create Account window, enter the name “develop” using the numeric keys on the remote control (similar to the numeric keypad on a mobile telephone) and select OK (see the figures below).

    Figure. Entering “develop”

  7. Choose a 6~12 digit password (there are no specific password rules) and select Create Account (see the figure below).

    Figure. Adding a password

  8. Select Login to log in to the “develop” account.(see the figure below).

    Figure. Login to developer account

    If the login is successful, the develop icon is displayed at the bottom-left corner of the screen.

    Figure. Successful login to developer account

  9. Click Settings to enter settings. A new option, Development, should appear at the end of the Settings menu.

    Figure: Settings menu

  10. Select Development and choose the Setting Server IP option (see the figure below).

    Figure: Setting server IP

  11. In the boxes, enter the IP address of the web server that contains the packaged application.

  12. Press the Return button on the remote control.

    Figure: Press Return

    The information entered in the above steps is now saved in the TV memory.

  13. Turn the TV off and back on, and press the Samsung Smart TV button. Now, Smart Hub is displayed.

  14. Login to the “develop” account again by clicking the red button from the Smart Hub display.

  15. Select the “develop” account and enter the password you set earlier.

Installing an Application

  1. From the Development menu in Settings, select User Application Synchronization (see the figure below).

    Figure. User Application Synchronization selected

  2. The TV indicates that it is installing a new service, and displays the name of your application (see the figure below).

    Figure. User application installation

  3. After the installation is complete, select Complete and press the Return key on the remote control two times to exit settings.

    Figure. User application installation complete

    If the installation was successful, a new application is available in Smart Hub (see the figure below). The application icon contains the text USER in the lower right corner on a red background (see the image below).

    Figure: Application icon

Running and Testing an Application

  1. 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.
  2. Press the Return key on the remote control to return to Smart Hub display.
  3. Press the Exit key to exit Samsung Smart TV (unless the key is handled by the widget and th API function blockNavigation has been used).
  4. After further changes are made to the application using the SDK, package it again.
  5. Synchronize the TV with the server. After this, the updated application is available in Smart Hub for further testing.

Deleting an Application

Sometimes, user applications on TV can have errors or must be deleted for some other reason. To delete a user application:

  1. Connect the Ethernet cable and start the Samsung Smart TV.
  2. Login with “develop” ID and your password and enter Settings.
  3. Look for Edit Mode menu below and push the yellow button.
  4. Choose the user application that you want to delete and press the Enter button.