You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/application/native/guides/connectivity/download.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,22 @@
1
1
# Download
2
2
3
3
4
-
You can create and manage 1 or more download requests at a time. Each download process goes through a [set of states](#state), and you can manage the process though the states with specific functions.
4
+
You can create and manage 1 or more download requests at a time. Each download process goes through a [set of states](#download-states), and you can manage the process though the states with specific functions.
5
5
6
6
This feature is optional.
7
7
8
8
The following figure illustrates the user scenario for the download:
9
9
10
-
1. When the user wants to download a file, you can [create a new download process](#download), configure the download URL or destination, and launch the process.
10
+
1. When the user wants to download a file, you can [create a new download process](#downloading-content-from-a-url), configure the download URL or destination, and launch the process.
11
11
2. During the download, you can pause, resume, or stop the process programmatically, or as a response to user requests. In addition, you can monitor the progress of the download process.
12
12
13
13
**Figure: User scenario**
14
14
15
15

16
16
17
-
<aname="state"></a>
18
17
## Download States
19
18
20
-
The following figure illustrates the various download states (such as READY and DOWNLOADING), and the functions (such as `download_start()`) that cause transitions between the states. The download states are defined in the download_state_e [enumerator](../../api/common/latest/group__CAPI__WEB__DOWNLOAD__MODULE.html#gae9d05ac4ab7a2ba2fe6b3c329d273810).
19
+
The following figure illustrates the various download states (such as READY and DOWNLOADING), and the functions (such as `download_start()`) that cause transitions between the states. The download states are defined in the `download_state_e`[enumerator](../../api/common/latest/group__CAPI__WEB__DOWNLOAD__MODULE.html#gae9d05ac4ab7a2ba2fe6b3c329d273810).
21
20
22
21
Each function can only be called when the download process is in a specific state. To avoid undefined behavior in the application, make sure that you handle every possible scenario in the code.
23
22
@@ -40,7 +39,6 @@ To use the functions and data types of the [Download API](../../api/common/lates
40
39
41
40
The downloading library needs no initialization prior to the API usage.
42
41
43
-
<aname="download"></a>
44
42
## Downloading Content from a URL
45
43
46
44
To download content:
@@ -77,7 +75,7 @@ To download content:
77
75
Before the download can be started, set the URL source path for the download:
You can also set the destination path and file name. If the values are not given, the default storage and an auto-generated file name are used.
@@ -104,7 +102,7 @@ To download content:
104
102
105
103
- Network type
106
104
107
-
To set the desired network type, use the `download_set_network_type()` function. The download_network_type_e [enumerator](../../api/common/latest/group__CAPI__WEB__DOWNLOAD__MODULE.html#gadf73239ac2efa6d4214a03751c76c9b8) defines the network types available for downloading. If no type is set, the `DOWNLOAD_NETWORK_ALL` default value is used.
105
+
To set the desired network type, use the `download_set_network_type()` function. The `download_network_type_e` [enumerator](../../api/common/latest/group__CAPI__WEB__DOWNLOAD__MODULE.html#gadf73239ac2efa6d4214a03751c76c9b8) defines the network types available for downloading. If no type is set, the `DOWNLOAD_NETWORK_ALL` default value is used.
108
106
109
107
```
110
108
download_network_type_e value = 0;
@@ -115,7 +113,7 @@ To download content:
115
113
116
114
- Notifications
117
115
118
-
To set notifications with a service action, use the `download_set_notification_type()` function. The download_notification_type_e [enumerator](../../api/common/latest/group__CAPI__WEB__DOWNLOAD__MODULE.html#gab2ec29afc07197987eb2b88614fac67f) defines the available download notification types. If no type is set, the `DOWNLOAD_NOTIFICATION_TYPE_NONE` default value is used.
116
+
To set notifications with a service action, use the `download_set_notification_type()` function. The `download_notification_type_e` [enumerator](../../api/common/latest/group__CAPI__WEB__DOWNLOAD__MODULE.html#gab2ec29afc07197987eb2b88614fac67f) defines the available download notification types. If no type is set, the `DOWNLOAD_NOTIFICATION_TYPE_NONE` default value is used.
119
117
120
118
To change the title or description of the notification item, use the `download_set_notification_title()` or `download_set_notification_description()` function. To change the action when the notification item is clicked, use the `download_set_notification_service_handle()` function. If the service action is not set, the default operation is the following:
121
119
@@ -144,7 +142,7 @@ To download content:
144
142
145
143
5. Control the download process.
146
144
147
-
Downloading can be started, paused, or canceled using the `download_start()`, `download_pause()`, and `download_cancel()` functions. The download ID handle is used as a parameter for all these functions.
145
+
Downloading can be started, paused, or canceled using the `download_start()`, `download_pause()`, and `download_cancel()` functions respectively. The download ID handle is used as a parameter for all these functions.
The download_error_e [enumerator](../../api/common/latest/group__CAPI__WEB__DOWNLOAD__MODULE.html#ga2d9ccc088c02cf1ab70879f1beda1cd1) defines the available error types.
203
+
The `download_error_e` [enumerator](../../api/common/latest/group__CAPI__WEB__DOWNLOAD__MODULE.html#ga2d9ccc088c02cf1ab70879f1beda1cd1) defines the available error types.
0 commit comments