Mobile native

Download

You can create and manage one or more download requests. Tizen allows you to create a new download process, configure the download URL or destination, and launch the process.

This feature is supported in mobile applications only.

Download States

The following figure illustrates the download states (such as READY and DOWNLOADING), and API functions (such as download_start()) which cause transitions between those states. Functions can be called only from specific states. Every possible scenario must be handled in the code to avoid undefined behavior in the application.

Figure: Download states

Download states

The following table defines the download state enumerator values.

Table: Download state enumerator values
Enumerator value Description
DOWNLOAD_STATE_NONE Default value.
DOWNLOAD_STATE_READY Ready to download.
DOWNLOAD_STATE_QUEUED Queued to start downloading.
DOWNLOAD_STATE_DOWNLOADING Download is currently running.
DOWNLOAD_STATE_PAUSED Download is waiting to resume.
DOWNLOAD_STATE_COMPLETED Download is complete.
DOWNLOAD_STATE_FAILED Download failed.
DOWNLOAD_STATE_CANCELED Download was cancelled by the user.

The following figure illustrates the user scenario for the download.

Figure: User scenario

User scenario

Stopping and Destroying a Download

The download_cancel() function can be used to stop downloading a file. The function changes the download state to DOWNLOAD_STATE_CANCELED. From this state, the download_start() function can be called to restart the download.

The download_destroy() function can be called to unload all data concerning a download_id handle from the memory. The download_id handle is stored for 48 hours (even if the device is powered off), unless the download_destroy() is called.

Go to top