AllShare API Reference (ASF 0.4)
This chapter defines a set of application interface used for developing convergence services such as contents sharing, device control, etc.
Note
This document contains information about AllShare API compatible with Samsung SDK 3.5 only. Please visit AllShare API Reference (ASF1.5) in order to see information written for Samsung SDK 4.0 version and higher.
This chapter defines a set of application interface used for developing convergence services such as contents sharing, device control, etc. An AllShare API can be defines as an application interface with which a widget application can use a set of features provided by other devices. This chapter provides the functionalities which are applicable to all types of devices including:
- Share media between different devices
- Discovery devices distributed in a home network
- Provide access control to different pre-defined devices
AllShare APIs applicable to DTV devices consist of 6 modules including device, devicefinder, item, mediasharing, provider, and servicepias modules. The device module represents all types of the devices located on local and remote network. This device module can be a DLNA device such as a digital media server (DMS) device, a digital media renderer (DMS) device, and a local device in the DLNA domain. Developers can get a set of information including its name, identification, etc through interfaces in this module. The provider module is a specific type of device that shares its media contents to other devices. Developers can browse or search media contents shared by the provider device thought interfaces in this module. Additionally, developers can get a set of device information for the provider device. These devices can be discovered by using interfaces defined in the devicefinder module. The devicefinder module provides features with which developers can discover any types of devices providing services such as media sharing, device controlling, etc. The item module represents any types of shared media provided by a provider device. The item can be a folder, image, audio, and video. Through interfaces in this module, developers can get meta-data for the items and information on how to access the media contents. The serviceapis module provides a general mechanism such as error handling specific for the AllShare APIs. The interfaces defined by this AllShare APIs are the below:
Module | Inerface | Description |
---|---|---|
devicefinder | provides access to device discovery features | |
provider | provides access to contents browsing and searching | |
device | provides generic features common for all types of devices | |
item | provides access to contents’ meta data retrieval features | |
serviceapis | provides generic features common for all the AllShare APIs | |
mediasharing | internally used for aggregating devicefinder interfaces into serviceapis module |
Developers can use the APIS defined in the devicefinder modules through the window object provided by web browsers based on the following interface hierarchy. The Window interface whose instance is provided by web browser implements the ServiceapisObject interface. The Serviceapis interface that is defined as an attribute of the ServiceapisObject interface implements the ServiceapisMediaSharing interface which has an attribute object whose type is the Mediasharing interface.

For example, a widget code discovering provider devices might be like the below:
var devFinder = serviceapis.mediasharing.mediaproviderfinder;
var providerList = devFinder.getMediaProviders();
The above service modules refer to the deviceapis module for asynchronous invocation mechanisms. The deviceapis module provides generic success and error callback interfaces that are used for several AllShare APIs. In addition the deviceapis module provides a function with which a widget application can cancel its asynchronous call during its execution by providing the PendingOperation interface.
Interface | Description |
---|---|
SuccessCallback | used in functions not requiring any return value in the success callback |
ErrorCallback | used in functions requiring only an error as an input parameter in the error callback |
PendingOperation | An object representing the pending operation of an asynchronous call. Interface that is returned by asynchronous operations in order to provide a cancellation operation. |
Feature | Provides all the information about a feature |
Param | Represents a parameter linked to a feature |
Additionally, the AllShare APIs uses basic type definitions defined by the deviceapis module. The type definition includes the below:
Type definition | Description |
---|---|
StringArray | Array of DOMStrings. |
UnsignedShortArray | Array of unsigned short values. |
ShortArray | Array of short values. |
FeatureArray | Array of Feature IRIs. |
Param | Array of Feature parameters. |
The interfaces provided by this AllShare APIs are based on the JAVA APIs defined by ASF 0.4. This AllShare APIs will be updated as the ASF APIs’ update.