index.md 2.78 KB
Newer Older
MickeyMoz's avatar
MickeyMoz committed
1
2
3
4
[android-components](../../index.md) / [mozilla.components.feature.downloads.manager](../index.md) / [AndroidDownloadManager](./index.md)

# AndroidDownloadManager

MickeyMoz's avatar
MickeyMoz committed
5
`class AndroidDownloadManager : `[`DownloadManager`](../-download-manager/index.md) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/manager/AndroidDownloadManager.kt#L38)
MickeyMoz's avatar
MickeyMoz committed
6
7
8
9
10
11
12

Handles the interactions with the [AndroidDownloadManager](./index.md).

### Constructors

| Name | Summary |
|---|---|
MickeyMoz's avatar
MickeyMoz committed
13
| [&lt;init&gt;](-init-.md) | `AndroidDownloadManager(applicationContext: <ERROR CLASS>, onDownloadCompleted: `[`OnDownloadCompleted`](../-on-download-completed.md)` = noop)`<br>Handles the interactions with the [AndroidDownloadManager](./index.md). |
MickeyMoz's avatar
MickeyMoz committed
14
15
16
17
18

### Properties

| Name | Summary |
|---|---|
MickeyMoz's avatar
MickeyMoz committed
19
20
| [onDownloadCompleted](on-download-completed.md) | `var onDownloadCompleted: `[`OnDownloadCompleted`](../-on-download-completed.md) |
| [permissions](permissions.md) | `val permissions: <ERROR CLASS>` |
MickeyMoz's avatar
MickeyMoz committed
21
22
23
24
25

### Functions

| Name | Summary |
|---|---|
MickeyMoz's avatar
MickeyMoz committed
26
| [download](download.md) | `fun download(download: `[`DownloadState`](../../mozilla.components.browser.state.state.content/-download-state/index.md)`, cookie: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`?`<br>Schedules a download through the [AndroidDownloadManager](./index.md). |
MickeyMoz's avatar
MickeyMoz committed
27
28
29
30
31
32
33
| [onReceive](on-receive.md) | `fun onReceive(context: <ERROR CLASS>, intent: <ERROR CLASS>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Invoked when a download is complete. Calls [onDownloadCompleted](on-download-completed.md) and unregisters the broadcast receiver if there are no more queued downloads. |
| [unregisterListeners](unregister-listeners.md) | `fun unregisterListeners(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Remove all the listeners. |

### Extension Functions

| Name | Summary |
|---|---|
MickeyMoz's avatar
MickeyMoz committed
34
| [loadResourceAsString](../../mozilla.components.support.test.file/kotlin.-any/load-resource-as-string.md) | `fun `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`.loadResourceAsString(path: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Loads a file from the resources folder and returns its content as a string object. |
MickeyMoz's avatar
MickeyMoz committed
35
| [validatePermissionGranted](../validate-permission-granted.md) | `fun `[`DownloadManager`](../-download-manager/index.md)`.validatePermissionGranted(context: <ERROR CLASS>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |