# NetworkType

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/NetworkType.kt+class:androidx.work.NetworkType) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

*** ** * ** ***


```
enum NetworkType : Enum<NetworkType>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[NetworkType](https://developer.android.com/reference/kotlin/androidx/work/NetworkType)\> ||
|   | ↳ | [androidx.work.NetworkType](https://developer.android.com/reference/kotlin/androidx/work/NetworkType) |

*** ** * ** ***

An enumeration of various network types that can be used as `https://developer.android.com/reference/kotlin/androidx/work/Constraints` for work.

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/work/NetworkType#CONNECTED` | Any working network connection is required for this work. |
| `https://developer.android.com/reference/kotlin/androidx/work/NetworkType#METERED` | A metered network connection is required for this work. |
| `https://developer.android.com/reference/kotlin/androidx/work/NetworkType#NOT_REQUIRED` | A network is not required for this work. |
| `https://developer.android.com/reference/kotlin/androidx/work/NetworkType#NOT_ROAMING` | A non-roaming network connection is required for this work. |
| `https://developer.android.com/reference/kotlin/androidx/work/NetworkType#TEMPORARILY_UNMETERED` | A temporarily unmetered Network. |
| `https://developer.android.com/reference/kotlin/androidx/work/NetworkType#UNMETERED` | An unmetered network connection is required for this work. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/work/NetworkType` | `https://developer.android.com/reference/kotlin/androidx/work/NetworkType#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/work/NetworkType>` | `https://developer.android.com/reference/kotlin/androidx/work/NetworkType#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/work/NetworkType>` | `https://developer.android.com/reference/kotlin/androidx/work/NetworkType#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. |

## Enum Values

### CONNECTED

```
val NetworkType.CONNECTED: NetworkType
```

Any working network connection is required for this work.

### METERED

```
val NetworkType.METERED: NetworkType
```

A metered network connection is required for this work.

### NOT_REQUIRED

```
val NetworkType.NOT_REQUIRED: NetworkType
```

A network is not required for this work.

### NOT_ROAMING

```
val NetworkType.NOT_ROAMING: NetworkType
```

A non-roaming network connection is required for this work.

### TEMPORARILY_UNMETERED

```
val NetworkType.TEMPORARILY_UNMETERED: NetworkType
```

A temporarily unmetered Network. This capability will be set for networks that are generally metered, but are currently unmetered.

Note: This capability can be changed at any time. When it is removed, `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`s are responsible for stopping any data transfer that should not occur on a metered network.

### UNMETERED

```
val NetworkType.UNMETERED: NetworkType
```

An unmetered network connection is required for this work.

## Public functions

### valueOf

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
fun valueOf(value: String): NetworkType
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
fun values(): Array<NetworkType>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

```
val entries: EnumEntries<NetworkType>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.