Downloading Data

This topic describes how your application can download data from a remote server.

Samsung Smart Signage supports downloading data from a remote server, using the Download API. For example, you can download external subtitles for a video.


To use the Download API, the application has to request permission by adding the following privilege to the "config.xml" file:

<tizen:privilege name=''></tizen:privilege> 

Starting a Download

To download data:

  1. Check that downloading is supported using the getCapability() method of the SystemInfo API:

    var downloadPossible =       tizen.systeminfo.getCapability('');console.log(downloadPossible);
  2. Create a download request object using the DownloadRequest() method:

    var download_obj = new tizen.DownloadRequest('', 'downloads');
  3. Start the download using the start() method, with the download request object as a parameter:, {  onprogress: function(id, receivedSize, totalSize) {    console.log(id);    console.log(receivedSize);    console.log(totalSize);  },  onpaused: function(id) {    console.log(id);  },  oncanceled: function(id) {    console.log(id);  },  oncompleted: function(id, fullPath) {    console.log(id);    console.log(fullPath);  },  onfailed: function(id, error) {    console.log(id);    console.log(JSON.stringify(error));  }});

    When downloading is complete, the oncompleted() event handler fires.