O'Reilly logo

Samsung SmartTV Application Development by Handstudio Co., Ltd

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

14

Exception Handling

Exception Handling for the Focus

Exception Handling for the Return/Exit Key

Exception Handling for the Player Exit Event

Exception Handling for the IME

Summary

The SmartTV application development needs to handle more exceptions than other platforms. However, understanding characteristics of the remote controlled TV and SDF provides guides that will help handling the exceptions. This chapter will cover a few important points using the Hands Frame advanced version application.

Exception Handling for the Focus

As emphasized many times already, a SmartTV uses a remote controller to move the focus to control an application. The focus must be controlled during the entire time that an application runs. Losing the focus means that a user lost the only control tool to use the application. This can cause erroneous feedback to remote control inputs, or simply no feedback at all.

When the focus is lost while running an application, due to inadequate exception handling, the only solution is ending and restarting the application. See the below example.

// Empty an element and output data from the IME input on the element.
var form_submit = function(){
      Main.login.elem.empty();
      Main.login.elem.text(‘Welcome ! ‘+Main.login.form.val() + ’.’);
};

The above code was used in the Hands Frame advanced version to implement the login feature. The code uses the IME to get user data for the login form, empty the Main.login.elem element, and enter the received data on there. Although ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required