Samsung SmartTV's Server-Side Data Processing and API Design - dummies

Samsung SmartTV’s Server-Side Data Processing and API Design

By Handstudio Co., Ltd

The design of an application for the Samsung SmartTVvdepends on how efficiently its data server responds to API requests on necessary data for the application. A well-designed application development project can significantly reduce its development schedule. For efficient API data exchanges, it is vital for a developer to familiarize oneself with the server API, and actively consult with the data provider.

The application shown in the figure has a static menu list of titles in the left pane, and a focused menu item shows a list of VOD files for the item.


To display meta information for the VOD files as shown previously, an API concept can be designed as shown here.

Request Parameters for the VOD Gallery
Parameter Type Description
titleId String Unique ID for the VOD
Data Structure of the VOD Gallery Response
Field Name Type Description
titleId String Unique ID for the VOD
title String Title of the VOD
date String Registered date for the VOD
thumbnail String Thumbnail address for the VOD
vodURL String Location for the VOD
Description Text Description for the VOD
State Boolean If the VOD is currently active

The API structure is similar to a common bulletin board service’s data structure. A titleid (unique ID for each VOD title) is used as the key value in a POST or GET request, and for receiving the corresponding data from the server.

XML type response with the data structure

An XML-type API Response with the preceding data structure is shown in the following example.


JSON type response with the data structure

A JSON type API Response with the preceding data structure is shown in the following example.


XML versus JSON

Most API services in the SmartTV are provided in either the XML or the JSON format, and occasionally in a plain-text format. Many developers prefer the JSON type. But that does not mean JSON is superior to other types.

Each environment calls a different response type for more efficient processing. The JSON format is optimized for the web platform, easy to use, light-weight, and most of all, fits the object-oriented JavaScript model. On the other hand, the XML format is supported by many platforms, easily readable, and supplied with a wealth of reference information.

Pros Concise with only necessary data
Optimized for JavaScript data handling
Easy to use
Easy to write
Easy to read
Well referenced
Cons Not as easy as XML to read
Not suitable for receiving large data
Bloated file size
Hard to parse data

Efficient API handling

A large portion of API design is up to the API provider’s system environment. An application developer’s API design is limited by available options by the API provider. Some API providers have severely limited options or even fixed-API structure only, rendering concept of the API design meaningless.

Even so, creating and managing an API structure table, as shown previously, can still save a huge amount of unnecessary communication with the service company. The table can be used during the entire development and debugging. It can also be shared with non-programmers: producers, designers, and clients—and allow them to quickly check if a desired function can be implemented.