# DownloadRequest.Builder

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#inhmethods)  

# DownloadRequest.Builder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/telephony/mbms/DownloadRequest.Builder "View this page in Kotlin")\|Java

`
public
static


class
DownloadRequest.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telephony.mbms.DownloadRequest.Builder |

<br />

*** ** * ** ***

## Summary

|                                                                                                                                                              ### Public constructors                                                                                                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#Builder(android.net.Uri,%20android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` sourceUri, `[Uri](https://developer.android.com/reference/android/net/Uri)` destinationUri) ` Builds a new DownloadRequest. |

|                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                              ||
|-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[DownloadRequest](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest)                        | ` `[build](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#build())`() `                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` static `[DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder) | ` `[fromDownloadRequest](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#fromDownloadRequest(android.telephony.mbms.DownloadRequest))`(`[DownloadRequest](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest)` other) ` Constructs a[Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder)from a[DownloadRequest](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest) |
| ` static `[DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder) | ` `[fromSerializedRequest](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#fromSerializedRequest(byte[]))`(byte[] data) ` This method constructs a new instance of[Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder)based on the serialized data passed in.                                                                                                                                                               |
| ` `[DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder)        | ` `[setAppIntent](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#setAppIntent(android.content.Intent))`(`[Intent](https://developer.android.com/reference/android/content/Intent)` intent) ` Set the[Intent](https://developer.android.com/reference/android/content/Intent)that should be sent when the download completes or fails.                                                                                                                                   |
| ` `[DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder)        | ` `[setServiceInfo](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#setServiceInfo(android.telephony.mbms.FileServiceInfo))`(`[FileServiceInfo](https://developer.android.com/reference/android/telephony/mbms/FileServiceInfo)` serviceInfo) ` Sets the service from which the download request to be built will download from.                                                                                                                                         |
| ` `[DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder)        | ` `[setSubscriptionId](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder#setSubscriptionId(int))`(int subscriptionId) ` Set the subscription ID on which the file(s) should be downloaded.                                                                                                                                                                                                                                                                                 |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### Builder

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Builder (Uri sourceUri, 
                Uri destinationUri)
```

Builds a new DownloadRequest.

<br />

|                                                                                                                                                                                                                                                                           Parameters                                                                                                                                                                                                                                                                           ||
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sourceUri`      | `Uri`: the source URI for the DownloadRequest to be built. This URI should never be null. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `destinationUri` | `Uri`: The final location for the file(s) that are to be downloaded. It must be on the same filesystem as the temp file directory set via[MbmsDownloadSession.setTempFileRootDirectory(File)](https://developer.android.com/reference/android/telephony/MbmsDownloadSession#setTempFileRootDirectory(java.io.File)). The provided path must be a directory that exists. An[IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)will be thrown otherwise. This value cannot be`null`. <br /> |

## Public methods

### build

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DownloadRequest build ()
```

<br />

<br />

|                                                  Returns                                                  ||
|---------------------------------------------------------------------------------------------------|--------|
| [DownloadRequest](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest) | <br /> |

### fromDownloadRequest

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static DownloadRequest.Builder fromDownloadRequest (DownloadRequest other)
```

Constructs a[Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder)from a[DownloadRequest](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest)

<br />

|                                                                                                                                   Parameters                                                                                                                                    ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `other` | `DownloadRequest`: The[DownloadRequest](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest)from which the data for the[Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder)should come. <br /> |

|                                                                                                                                                                                       Returns                                                                                                                                                                                        ||
|-------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder) | An instance of[Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder)pre-populated with data from the provided[DownloadRequest](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest). <br /> |

### fromSerializedRequest

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static DownloadRequest.Builder fromSerializedRequest (byte[] data)
```

This method constructs a new instance of[Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder)based on the serialized data passed in.

<br />

|                                                                                                             Parameters                                                                                                             ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `data` | `byte`: A byte array, the contents of which should have been originally obtained from[DownloadRequest.toByteArray()](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest#toByteArray()). <br /> |

|                                                          Returns                                                          ||
|-------------------------------------------------------------------------------------------------------------------|--------|
| [DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder) | <br /> |

### setAppIntent

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DownloadRequest.Builder setAppIntent (Intent intent)
```

Set the[Intent](https://developer.android.com/reference/android/content/Intent)that should be sent when the download completes or fails. This should be an intent with a explicit[ComponentName](https://developer.android.com/reference/android/content/ComponentName)targeted to a[BroadcastReceiver](https://developer.android.com/reference/android/content/BroadcastReceiver)in the app's package. The middleware should not use this method.

<br />

|                                                          Returns                                                          ||
|-------------------------------------------------------------------------------------------------------------------|--------|
| [DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder) | <br /> |

### setServiceInfo

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DownloadRequest.Builder setServiceInfo (FileServiceInfo serviceInfo)
```

Sets the service from which the download request to be built will download from.

<br />

|                                                          Returns                                                          ||
|-------------------------------------------------------------------------------------------------------------------|--------|
| [DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder) | <br /> |

### setSubscriptionId

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DownloadRequest.Builder setSubscriptionId (int subscriptionId)
```

Set the subscription ID on which the file(s) should be downloaded.

<br />

|                                                          Returns                                                          ||
|-------------------------------------------------------------------------------------------------------------------|--------|
| [DownloadRequest.Builder](https://developer.android.com/reference/android/telephony/mbms/DownloadRequest.Builder) | <br /> |