The Yahoo! KONtx Toolbox contains the common user interface elements and behaviors used in building apps. The purpose of the Yahoo! KONtx Toolbox is to:
The supported standards in the Yahoo! KONtx Toolbox are:
This file is included by each TV App and defines the elements, components, controls, and behaviors of Yahoo! objects used
for the rapid development of apps.
The design and implementation of TV Apps is based on a Framework Development methodology. The Yahoo! KONtx Framework is a flexible application generator which supports the creation of all types of TV Apps. The KONtx Framework encapsulates all communication with the Application Engine (the "Engine") and provides pre-packaged user interface components and building blocks for the app developer. The KONtx Framework listens for events from the Engine that are passed to the app through the Container. The Container is the encapsulating software that manages the communication and display for multiple apps on the connected TV device. The Container supports the privileged functionality of both the dock and the sidebar, and is in charge of all those elements that are outside of the control of individual apps (for example, dock, sidebar, global toolbar, bookmark activation, adding, and deleting apps, and others).
The call stack for KONtx Framework development is illustrated below:
The KONtx Framework has elevated repeated patterns found in many app implementations to be part of the Yahoo! core Framework proper. TV App code has been restructured around views and view classes. Events and methods are simplified to support the concepts of UI component creation and content update.
The KONtx Framework will simplify coding going forward by having a lot of previously manual tasks handled for you automatically, it will also maximize the performance of your apps for the best possible user experience leveraging internal caching built into the Engine.
The basic app views (bookmark, sidebar, fullscreen) are represented by these classes:
KONtx.system.SnippetView– this view is an abstract base class for bookmarks, use AnchorSnippetView and ProfileSnippetView instead.
KONtx.system.AnchorSnippetView– the main bookmark view for the app. This view is not removed when switching profiles if both profiles have the app installed.
KONtx.system.ProfileSnippetView– a profile specific bookmark view. This view is removed when switching profiles.
KONtx.system.SidebarView– a sidebar view.
KONtx.system.FullscreenView– a fullscreen view.
To create a view for your app, you extend the view class and override two app-specific methods:
updateView(). The method
createView() is where you create the
basic user interface components in the view. No content is present at this stage. The
createView() method is called once. The method
updateView() is where you populate the view with content. The
method is called each time a user views the page, or the data on the page has been updated. The user interface components
in the view do not need to be physically re-rendered to update data in the view.
Using the methods
updateView() allow the Engine to optimize rendering views. Once
createView() is called, the Engine does not need to create the XML elements onscreen again.
updateView() method is fast because it can swap content inside the view without having to re-render the XML, which is often slow.
Each view is defined by a view Id, a view class and an optional data parameter. The
defaultViewId is the navigation start point or HOME of your app. The
settingsViewId is displayed when the GREEN key
on the remote control is pressed. The
settingsViewId is used for the “About Box” of the app, and can be set to the default view
The views array and the
defaultViewId properties are required.
settingsViewId property is recommended and an error is logged if the settings view is not set. If your app does not require a network connection
widgetNeedsNetwork property to false.
The default value for