# DownloadableSubscription.Builder

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

# Builder

*** ** * ** ***

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

```
class Builder
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                       ||
| ↳ | [android.telephony.euicc.DownloadableSubscription.Builder](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#) |

## Summary

|                                                                                                                                                             Public constructors                                                                                                                                                             ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#Builder(android.telephony.euicc.DownloadableSubscription))`(`baseSubscription:` `[DownloadableSubscription](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription)`)` <br /> |
| [Builder](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#Builder(kotlin.String))`(`encodedActivationCode:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` <br />                                                                          |

|                                                                                                                                                                                                                       Public methods                                                                                                                                                                                                                       ||
|----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DownloadableSubscription](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription)                  | [build](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#build())`()` Builds a[DownloadableSubscription](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription)object.                                      |
| [DownloadableSubscription.Builder](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#) | [setConfirmationCode](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#setConfirmationCode(kotlin.String))`(`value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Sets the confirmation code.                 |
| [DownloadableSubscription.Builder](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#) | [setEncodedActivationCode](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#setEncodedActivationCode(kotlin.String))`(`value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Sets the encoded activation code. |

## Public constructors

### Builder

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

```
Builder(baseSubscription: DownloadableSubscription)
```

|                                                                                 Parameters                                                                                  ||
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `baseSubscription` | [DownloadableSubscription](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription):This value cannot be`null`. |

### Builder

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

```
Builder(encodedActivationCode: String)
```

|                                                              Parameters                                                               ||
|-------------------------|--------------------------------------------------------------------------------------------------------------|
| `encodedActivationCode` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

## Public methods

### build

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

```
fun build(): DownloadableSubscription
```

Builds a[DownloadableSubscription](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription)object.

|                                                                                                                                  Return                                                                                                                                   ||
|-----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| [DownloadableSubscription](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription) | a non-null[DownloadableSubscription](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription)object. |

### setConfirmationCode

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

```
fun setConfirmationCode(value: String): DownloadableSubscription.Builder
```

Sets the confirmation code.

|                                                                                                    Parameters                                                                                                    ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):the confirmation code to use to authenticate the carrier server got subscription download. This value cannot be`null`. |

|                                                                                  Return                                                                                   ||
|----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [DownloadableSubscription.Builder](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#) | This value cannot be`null`. |

### setEncodedActivationCode

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

```
fun setEncodedActivationCode(value: String): DownloadableSubscription.Builder
```

Sets the encoded activation code.

|                                                                                                                                                                                         Parameters                                                                                                                                                                                          ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):the activation code to use. An activation code can be parsed from a user scanned QR code. The format of activation code is defined in SGP.22. For example, "1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815$1.3.6.1.4.1.31746". For detail, see`com.android.euicc.data.ActivationCode`. Must not be null. |

|                                                                                  Return                                                                                   ||
|----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [DownloadableSubscription.Builder](https://developer.android.com/reference/kotlin/android/telephony/euicc/DownloadableSubscription.Builder#) | This value cannot be`null`. |