# StreamingService

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

# StreamingService

*** ** * ** ***

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

`
public


class
StreamingService
`  
`

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


``


implements

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


`

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

<br />

*** ** * ** ***

Class used to represent a single MBMS stream. After a stream has been started with[MbmsStreamingSession.startStreaming(StreamingServiceInfo, java.util.concurrent.Executor,
StreamingServiceCallback)](https://developer.android.com/reference/android/telephony/MbmsStreamingSession#startStreaming(android.telephony.mbms.StreamingServiceInfo,%20java.util.concurrent.Executor,%20android.telephony.mbms.StreamingServiceCallback)), this class is used to hold information about the stream and control it.

## Summary

|                                                                                                                                                                                                                                                                                                         ### Constants                                                                                                                                                                                                                                                                                                          ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [BROADCAST_METHOD](https://developer.android.com/reference/android/telephony/mbms/StreamingService#BROADCAST_METHOD) The method of transmission currently used for a stream, reported via[StreamingServiceCallback.onStreamMethodUpdated](https://developer.android.com/reference/android/telephony/mbms/StreamingServiceCallback#onStreamMethodUpdated(int))                                                                                                                                                                                                                                                           |
| `int` | [REASON_BY_USER_REQUEST](https://developer.android.com/reference/android/telephony/mbms/StreamingService#REASON_BY_USER_REQUEST) State changed due to a call to[close()](https://developer.android.com/reference/android/telephony/mbms/StreamingService#close())or[MbmsStreamingSession.startStreaming(StreamingServiceInfo, java.util.concurrent.Executor, StreamingServiceCallback)](https://developer.android.com/reference/android/telephony/MbmsStreamingSession#startStreaming(android.telephony.mbms.StreamingServiceInfo,%20java.util.concurrent.Executor,%20android.telephony.mbms.StreamingServiceCallback)) |
| `int` | [REASON_END_OF_SESSION](https://developer.android.com/reference/android/telephony/mbms/StreamingService#REASON_END_OF_SESSION) State changed due to the streaming session ending at the carrier.                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `int` | [REASON_FREQUENCY_CONFLICT](https://developer.android.com/reference/android/telephony/mbms/StreamingService#REASON_FREQUENCY_CONFLICT) State changed due to a frequency conflict with another requested stream.                                                                                                                                                                                                                                                                                                                                                                                                         |
| `int` | [REASON_LEFT_MBMS_BROADCAST_AREA](https://developer.android.com/reference/android/telephony/mbms/StreamingService#REASON_LEFT_MBMS_BROADCAST_AREA) State changed due to the device leaving the where this stream is being broadcast.                                                                                                                                                                                                                                                                                                                                                                                    |
| `int` | [REASON_NONE](https://developer.android.com/reference/android/telephony/mbms/StreamingService#REASON_NONE) Indicates that the middleware does not have a reason to provide for the state change.                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `int` | [REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE](https://developer.android.com/reference/android/telephony/mbms/StreamingService#REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE) State changed due to the device leaving the home carrier's LTE network.                                                                                                                                                                                                                                                                                                                                                                              |
| `int` | [REASON_OUT_OF_MEMORY](https://developer.android.com/reference/android/telephony/mbms/StreamingService#REASON_OUT_OF_MEMORY) State changed due to the middleware running out of memory                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `int` | [STATE_STALLED](https://developer.android.com/reference/android/telephony/mbms/StreamingService#STATE_STALLED) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `int` | [STATE_STARTED](https://developer.android.com/reference/android/telephony/mbms/StreamingService#STATE_STARTED) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `int` | [STATE_STOPPED](https://developer.android.com/reference/android/telephony/mbms/StreamingService#STATE_STOPPED) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `int` | [UNICAST_METHOD](https://developer.android.com/reference/android/telephony/mbms/StreamingService#UNICAST_METHOD) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

|                                                                                                                                                                                ### Public methods                                                                                                                                                                                 ||
|----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                                        | ` `[close](https://developer.android.com/reference/android/telephony/mbms/StreamingService#close())`() ` Stop streaming this service.                                                                                                                             |
| ` `[StreamingServiceInfo](https://developer.android.com/reference/android/telephony/mbms/StreamingServiceInfo) | ` `[getInfo](https://developer.android.com/reference/android/telephony/mbms/StreamingService#getInfo())`() ` Retrieve the[StreamingServiceInfo](https://developer.android.com/reference/android/telephony/mbms/StreamingServiceInfo)corresponding to this stream. |
| ` `[Uri](https://developer.android.com/reference/android/net/Uri)                                              | ` `[getPlaybackUri](https://developer.android.com/reference/android/telephony/mbms/StreamingService#getPlaybackUri())`() ` Retrieve the Uri used to play this stream.                                                                                             |

| ### 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*.                                                                                             | ||
| From interface` `[java.lang.AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable)` ` |------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[close](https://developer.android.com/reference/java/lang/AutoCloseable#close())`() ` Closes this resource, relinquishing any underlying resources. | ||

## Constants

### BROADCAST_METHOD

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

```
public static final int BROADCAST_METHOD
```

The method of transmission currently used for a stream, reported via[StreamingServiceCallback.onStreamMethodUpdated](https://developer.android.com/reference/android/telephony/mbms/StreamingServiceCallback#onStreamMethodUpdated(int))

<br />

Constant Value: 1 (0x00000001)  

### REASON_BY_USER_REQUEST

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

```
public static final int REASON_BY_USER_REQUEST
```

State changed due to a call to[close()](https://developer.android.com/reference/android/telephony/mbms/StreamingService#close())or[MbmsStreamingSession.startStreaming(StreamingServiceInfo,
java.util.concurrent.Executor, StreamingServiceCallback)](https://developer.android.com/reference/android/telephony/MbmsStreamingSession#startStreaming(android.telephony.mbms.StreamingServiceInfo,%20java.util.concurrent.Executor,%20android.telephony.mbms.StreamingServiceCallback))

<br />

Constant Value: 1 (0x00000001)  

### REASON_END_OF_SESSION

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

```
public static final int REASON_END_OF_SESSION
```

State changed due to the streaming session ending at the carrier.

<br />

Constant Value: 2 (0x00000002)  

### REASON_FREQUENCY_CONFLICT

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

```
public static final int REASON_FREQUENCY_CONFLICT
```

State changed due to a frequency conflict with another requested stream.

<br />

Constant Value: 3 (0x00000003)  

### REASON_LEFT_MBMS_BROADCAST_AREA

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

```
public static final int REASON_LEFT_MBMS_BROADCAST_AREA
```

State changed due to the device leaving the where this stream is being broadcast.

<br />

Constant Value: 6 (0x00000006)  

### REASON_NONE

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

```
public static final int REASON_NONE
```

Indicates that the middleware does not have a reason to provide for the state change.

<br />

Constant Value: 0 (0x00000000)  

### REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE

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

```
public static final int REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE
```

State changed due to the device leaving the home carrier's LTE network.

<br />

Constant Value: 5 (0x00000005)  

### REASON_OUT_OF_MEMORY

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

```
public static final int REASON_OUT_OF_MEMORY
```

State changed due to the middleware running out of memory

<br />

Constant Value: 4 (0x00000004)  

### STATE_STALLED

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

```
public static final int STATE_STALLED
```

<br />

<br />

Constant Value: 3 (0x00000003)  

### STATE_STARTED

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

```
public static final int STATE_STARTED
```

<br />

<br />

Constant Value: 2 (0x00000002)  

### STATE_STOPPED

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

```
public static final int STATE_STOPPED
```

<br />

<br />

Constant Value: 1 (0x00000001)  

### UNICAST_METHOD

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

```
public static final int UNICAST_METHOD
```

<br />

<br />

Constant Value: 2 (0x00000002)

## Public methods

### close

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

```
public void close ()
```

Stop streaming this service. Further operations on this object will fail with an[IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException). May throw an[IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)or an[IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)

<br />

### getInfo

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

```
public StreamingServiceInfo getInfo ()
```

Retrieve the[StreamingServiceInfo](https://developer.android.com/reference/android/telephony/mbms/StreamingServiceInfo)corresponding to this stream.

<br />

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

### getPlaybackUri

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

```
public Uri getPlaybackUri ()
```

Retrieve the Uri used to play this stream. May throw an[IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)or an[IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException).

<br />

|                                                                                                Returns                                                                                                 ||
|----------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri) | The[Uri](https://developer.android.com/reference/android/net/Uri)to pass to the streaming client, or`null`if an error occurred. <br /> |