Chapter 3. Getting Started

The following steps outline how to setup the development environment for TV Apps using the sample apps for guidance.

Using the TV Simulator

Before we start building a TV App, you need to make sure that the TV Simulator is installed and tested on your machine. To install the Simulator, follow the steps outlined in the Installation Guide.

The largest part of app development is the creation of the user interface and its behaviors. During the app design and development phases you can use the Simulator to preview and test your work. The benefits of using the TV Simulator for testing include:

  • App layout and design review for 960x540 pixel resolution.
  • User interface behavior and functionality testing with keyboard mappings.
  • Network and roundtrip testing.

Launch the Simulator

After the ADK installation, if you have created launch icons on your desktop you can double click on one of the launch icons to launch the Simulator for a particular OEM or resolution. The Engine executable has been installed in the Linux directory /usr/local/TVSimBuild. A startup script for the Engine is /usr/local/bin/YCTV-SIM.sh.

You can also launch the Simulator from the terminal command line. For the latest production Simulator, at the prompt enter:

/usr/local/bin/YCTV-SIM.sh --Latest

Extract a Sample TV App to your Development Directory

The following tutorial examples use the MediaPlayerSample app as a reference. Sample apps are installed with the ADK. You can find the source code for this app compressed into .widget files in the $HOME/YCTV-ADK/YCTV-SIM-Latest/TV/Widgets directory after you have completed the latest production installation.

The ADK installer will also create a root-level directory called /devapps if it does not already exist. Any apps you copy into this folder are picked up by the Simulator when it starts up. This directory can be used for testing your TV Apps.

For this tutorial, extract the MediaPlayerSample app DL-XXX.com.yahoo.widgets.tv.videosample-2.0.0-install.widget into your local root-level development directory /devapps. The .widget file is compressed, and must be unzipped (extracted) into the root-level /devapps directory to create the MediaPlayerSample.widget folder.

Load a New TV App into the Simulator

This tutorial uses sample apps to highlight the development process. Instead of using the sample apps in these examples you are free to create new apps while following the outline of this tutorial. New apps should also be saved in the /devapps folder. Follow these steps to load a new TV App into the Simulator:

  1. Make sure the Simulator is not running. Press the ESC key to exit the Simulator.
  2. Define a unique identifier in your widget.xml file. To be safe, we recommend using a reverse domain name.

    <identifier>com.mycompany.apps.myapp</identifier>

  3. To add a new app, save your app in the /devapps folder.
  4. Choose the Simulator Reset menu item that applies to the version of the Simulator you are testing. For example, from the Applications→Yahoo CTV-ADK→Latest Production menu choose the Latest Production Simulator Reset menu item. The Simulator Reset tool removes the local data in the corresponding $HOME/YCTV-ADK/YCTV-SIM-Latest/data directory. Any apps you have downloaded from the TV Store will also be removed by the Simulator Reset tool. You can download these apps again after a reset operation.

  5. Restart the Simulator. For example, from the Applications→Yahoo CTV-ADK→Latest Production menu choose the Latest Production Simulator menu item.

  6. For updates to your app, you can edit your existing app in /devapps, or copy it to the /devapps directory, and stop/restart the Simulator application without needing to do a Simulator Reset.

  7. The new or updated app shows up in the dock. If you do not see your new app in the dock, check the ownership and permissions of the /devapps directory and its files to ensure your current user has read/write/execute permissions, make sure you have a unique app identifier, and reboot Linux.

Table of Contents