# CustomModelDownloadConditions.Builder


```
public class CustomModelDownloadConditions.Builder
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Builder of `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions`.

## Summary

| ### Public constructors |
|---|
| `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions` | `[build](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder#build())()` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html(value = VERSION_CODES.N) @https://developer.android.com/reference/kotlin/android/annotation/TargetApi.html(value = VERSION_CODES.N) [requireCharging](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder#requireCharging())()` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html(value = VERSION_CODES.N) @https://developer.android.com/reference/kotlin/android/annotation/TargetApi.html(value = VERSION_CODES.N) [requireDeviceIdle](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder#requireDeviceIdle())()` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder` | `[requireWifi](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder#requireWifi())()` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |

## Public constructors

### Builder

```
public Builder()
```

## Public methods

### build

```
public @NonNull CustomModelDownloadConditions [build](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder#build())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Builds `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions`.

### requireCharging

```
@RequiresApi(value = VERSION_CODES.N)
@TargetApi(value = VERSION_CODES.N)
public @NonNull CustomModelDownloadConditions.Builder [requireCharging](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder#requireCharging())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Sets charging as required. Only works on Android N and above.

### requireDeviceIdle

```
@RequiresApi(value = VERSION_CODES.N)
@TargetApi(value = VERSION_CODES.N)
public @NonNull CustomModelDownloadConditions.Builder [requireDeviceIdle](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder#requireDeviceIdle())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Sets device idle as required.

Idle mode is a loose definition provided by the system, which means that the device is not in use, and has not been in use for some time.

Only works on Android N and above.

### requireWifi

```
public @NonNull CustomModelDownloadConditions.Builder [requireWifi](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModelDownloadConditions.Builder#requireWifi())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Sets wifi as required.