# MediaMetadataEditor

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/media/MediaMetadataEditor#constants)\|[Methods](https://developer.android.com/reference/android/media/MediaMetadataEditor#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/media/MediaMetadataEditor#inhmethods)  

# MediaMetadataEditor

*** ** * ** ***

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

`
public


abstract
class
MediaMetadataEditor
`  
`

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


``


`

|---|-----------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.MediaMetadataEditor |

|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [RemoteControlClient.MetadataEditor](https://developer.android.com/reference/android/media/RemoteControlClient.MetadataEditor),[RemoteController.MetadataEditor](https://developer.android.com/reference/android/media/RemoteController.MetadataEditor) |--------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [RemoteControlClient.MetadataEditor](https://developer.android.com/reference/android/media/RemoteControlClient.MetadataEditor) | *This class was deprecated in API level 21. Use[MediaMetadata](https://developer.android.com/reference/android/media/MediaMetadata)and[MediaSession](https://developer.android.com/reference/android/media/session/MediaSession)instead.*                                                     | | [RemoteController.MetadataEditor](https://developer.android.com/reference/android/media/RemoteController.MetadataEditor)       | A class to read the metadata published by a[RemoteControlClient](https://developer.android.com/reference/android/media/RemoteControlClient), or send a[RemoteControlClient](https://developer.android.com/reference/android/media/RemoteControlClient)new values for keys that can be edited. | |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 21.**   
Use[MediaMetadata](https://developer.android.com/reference/android/media/MediaMetadata)instead together with[MediaSession](https://developer.android.com/reference/android/media/session/MediaSession).

An abstract class for editing and storing metadata that can be published by[RemoteControlClient](https://developer.android.com/reference/android/media/RemoteControlClient). See the[RemoteControlClient.editMetadata(boolean)](https://developer.android.com/reference/android/media/RemoteControlClient#editMetadata(boolean))method to instantiate a[RemoteControlClient.MetadataEditor](https://developer.android.com/reference/android/media/RemoteControlClient.MetadataEditor)object.

## Summary

|                                                                                              ### Constants                                                                                              ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [BITMAP_KEY_ARTWORK](https://developer.android.com/reference/android/media/MediaMetadataEditor#BITMAP_KEY_ARTWORK) The metadata key for the content artwork / album art.                         |
| `int` | [RATING_KEY_BY_OTHERS](https://developer.android.com/reference/android/media/MediaMetadataEditor#RATING_KEY_BY_OTHERS) The metadata key for the content's average rating, not the user's rating. |
| `int` | [RATING_KEY_BY_USER](https://developer.android.com/reference/android/media/MediaMetadataEditor#RATING_KEY_BY_USER) The metadata key for the content's user rating.                               |

|                                                                                                                                                                                                                  ### Public methods                                                                                                                                                                                                                   ||
|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                             | ` `[addEditableKey](https://developer.android.com/reference/android/media/MediaMetadataEditor#addEditableKey(int))`(int key) ` Flags the given key as being editable.                                                                                                                                                                            |
| ` abstract void`                                                                                    | ` `[apply](https://developer.android.com/reference/android/media/MediaMetadataEditor#apply())`() ` Applies all of the metadata changes that have been set since the MediaMetadataEditor instance was created or since[clear()](https://developer.android.com/reference/android/media/MediaMetadataEditor#clear())was called.                     |
| ` void`                                                                                             | ` `[clear](https://developer.android.com/reference/android/media/MediaMetadataEditor#clear())`() ` Clears all the pending metadata changes set since the MediaMetadataEditor instance was created or since this method was last called.                                                                                                          |
| ` `[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)                        | ` `[getBitmap](https://developer.android.com/reference/android/media/MediaMetadataEditor#getBitmap(int,%20android.graphics.Bitmap))`(int key, `[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)` defaultValue) ` Returns the[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)value for the key. |
| ` int[]`                                                                                            | ` `[getEditableKeys](https://developer.android.com/reference/android/media/MediaMetadataEditor#getEditableKeys())`() ` Retrieves the keys flagged as editable.                                                                                                                                                                                   |
| ` long`                                                                                             | ` `[getLong](https://developer.android.com/reference/android/media/MediaMetadataEditor#getLong(int,%20long))`(int key, long defaultValue) ` Returns the long value for the key.                                                                                                                                                                  |
| ` `[Object](https://developer.android.com/reference/java/lang/Object)                               | ` `[getObject](https://developer.android.com/reference/android/media/MediaMetadataEditor#getObject(int,%20java.lang.Object))`(int key, `[Object](https://developer.android.com/reference/java/lang/Object)` defaultValue) ` Returns an object representation of the value for the key                                                            |
| ` `[String](https://developer.android.com/reference/java/lang/String)                               | ` `[getString](https://developer.android.com/reference/android/media/MediaMetadataEditor#getString(int,%20java.lang.String))`(int key, `[String](https://developer.android.com/reference/java/lang/String)` defaultValue) ` Returns the[String](https://developer.android.com/reference/java/lang/String)value for the key.                      |
| ` `[MediaMetadataEditor](https://developer.android.com/reference/android/media/MediaMetadataEditor) | ` `[putBitmap](https://developer.android.com/reference/android/media/MediaMetadataEditor#putBitmap(int,%20android.graphics.Bitmap))`(int key, `[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)` bitmap) ` Adds image.                                                                                                  |
| ` `[MediaMetadataEditor](https://developer.android.com/reference/android/media/MediaMetadataEditor) | ` `[putLong](https://developer.android.com/reference/android/media/MediaMetadataEditor#putLong(int,%20long))`(int key, long value) ` Adds numerical information.                                                                                                                                                                                 |
| ` `[MediaMetadataEditor](https://developer.android.com/reference/android/media/MediaMetadataEditor) | ` `[putObject](https://developer.android.com/reference/android/media/MediaMetadataEditor#putObject(int,%20java.lang.Object))`(int key, `[Object](https://developer.android.com/reference/java/lang/Object)` value) ` Adds information stored as an instance.                                                                                     |
| ` `[MediaMetadataEditor](https://developer.android.com/reference/android/media/MediaMetadataEditor) | ` `[putString](https://developer.android.com/reference/android/media/MediaMetadataEditor#putString(int,%20java.lang.String))`(int key, `[String](https://developer.android.com/reference/java/lang/String)` value) ` Adds textual information.                                                                                                   |
| ` void`                                                                                             | ` `[removeEditableKeys](https://developer.android.com/reference/android/media/MediaMetadataEditor#removeEditableKeys())`() ` Causes all metadata fields to be read-only.                                                                                                                                                                         |

| ### 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*.                                                                                             | ||

## Constants

### BITMAP_KEY_ARTWORK

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

```
public static final int BITMAP_KEY_ARTWORK
```

The metadata key for the content artwork / album art.

<br />

Constant Value: 100 (0x00000064)  

### RATING_KEY_BY_OTHERS

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

```
public static final int RATING_KEY_BY_OTHERS
```

The metadata key for the content's average rating, not the user's rating. The value associated with this key is a[Rating](https://developer.android.com/reference/android/media/Rating)instance.

<br />

**See also:**

- [RATING_KEY_BY_USER](https://developer.android.com/reference/android/media/MediaMetadataEditor#RATING_KEY_BY_USER)

Constant Value: 101 (0x00000065)  

### RATING_KEY_BY_USER

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

```
public static final int RATING_KEY_BY_USER
```

The metadata key for the content's user rating. The value associated with this key is a[Rating](https://developer.android.com/reference/android/media/Rating)instance. This key can be flagged as "editable" (with[addEditableKey(int)](https://developer.android.com/reference/android/media/MediaMetadataEditor#addEditableKey(int))) to enable receiving user rating values through the[RemoteControlClient.OnMetadataUpdateListener](https://developer.android.com/reference/android/media/RemoteControlClient.OnMetadataUpdateListener)interface.

<br />

Constant Value: 268435457 (0x10000001)

## Public methods

### addEditableKey

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

```
public void addEditableKey (int key)
```

Flags the given key as being editable. This should only be used by metadata publishers, such as[RemoteControlClient](https://developer.android.com/reference/android/media/RemoteControlClient), which will declare the metadata field as eligible to be updated, with new values received through the[RemoteControlClient.OnMetadataUpdateListener](https://developer.android.com/reference/android/media/RemoteControlClient.OnMetadataUpdateListener)interface.

<br />

|                                                                                              Parameters                                                                                               ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `key` | `int`: the type of metadata that can be edited. The supported key is[RATING_KEY_BY_USER](https://developer.android.com/reference/android/media/MediaMetadataEditor#RATING_KEY_BY_USER). <br /> |

### apply

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

```
public abstract void apply ()
```

Applies all of the metadata changes that have been set since the MediaMetadataEditor instance was created or since[clear()](https://developer.android.com/reference/android/media/MediaMetadataEditor#clear())was called. Subclasses should synchronize on`this`for thread safety.

<br />

### clear

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

```
public void clear ()
```

Clears all the pending metadata changes set since the MediaMetadataEditor instance was created or since this method was last called. Note that clearing the metadata doesn't reset the editable keys (use[removeEditableKeys()](https://developer.android.com/reference/android/media/MediaMetadataEditor#removeEditableKeys())instead).

<br />

### getBitmap

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

```
public Bitmap getBitmap (int key, 
                Bitmap defaultValue)
```

Returns the[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)value for the key.

<br />

|                                                                       Parameters                                                                       ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------|
| `key`          | `int`: the[BITMAP_KEY_ARTWORK](https://developer.android.com/reference/android/media/MediaMetadataEditor#BITMAP_KEY_ARTWORK)key <br /> |
| `defaultValue` | `Bitmap`: the value returned if the key is not present <br />                                                                          |

|                                                                                                                 Returns                                                                                                                  ||
|---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap) | the[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)value for the key, or the supplied default value if the key is not present <br /> |

|                                                                   Throws                                                                   ||
|--------------------------------------------------------------------------------------------------------|------------------------------------|
|                                                                                                        | java.lang.IllegalArgumentException |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) |                                    |

### getEditableKeys

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

```
public int[] getEditableKeys ()
```

Retrieves the keys flagged as editable.

<br />

|                                       Returns                                        ||
|---------|-----------------------------------------------------------------------------|
| `int[]` | null if there are no editable keys, or an array containing the keys. <br /> |

### getLong

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

```
public long getLong (int key, 
                long defaultValue)
```

Returns the long value for the key.

<br />

|                                                                                   Parameters                                                                                   ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `key`          | `int`: one of the keys supported in[putLong(int, long)](https://developer.android.com/reference/android/media/MediaMetadataEditor#putLong(int,%20long)) <br /> |
| `defaultValue` | `long`: the value returned if the key is not present <br />                                                                                                    |

|                                              Returns                                               ||
|--------|--------------------------------------------------------------------------------------------|
| `long` | the long value for the key, or the supplied default value if the key is not present <br /> |

|                                                                   Throws                                                                   ||
|--------------------------------------------------------------------------------------------------------|------------------------------------|
|                                                                                                        | java.lang.IllegalArgumentException |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) |                                    |

### getObject

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

```
public Object getObject (int key, 
                Object defaultValue)
```

Returns an object representation of the value for the key

<br />

|                                                                                                 Parameters                                                                                                 ||
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `key`          | `int`: one of the keys supported in[putObject(int, java.lang.Object)](https://developer.android.com/reference/android/media/MediaMetadataEditor#putObject(int,%20java.lang.Object)) <br /> |
| `defaultValue` | `Object`: the value returned if the key is not present <br />                                                                                                                              |

|                                                                                                                                                                                                                                     Returns                                                                                                                                                                                                                                     ||
|--------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Object](https://developer.android.com/reference/java/lang/Object) | the object for the key, as a[Long](https://developer.android.com/reference/java/lang/Long),[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap),[String](https://developer.android.com/reference/java/lang/String), or[Rating](https://developer.android.com/reference/android/media/Rating)depending on the key value, or the supplied default value if the key is not present <br /> |

|                                                                   Throws                                                                   ||
|--------------------------------------------------------------------------------------------------------|------------------------------------|
|                                                                                                        | java.lang.IllegalArgumentException |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) |                                    |

### getString

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

```
public String getString (int key, 
                String defaultValue)
```

Returns the[String](https://developer.android.com/reference/java/lang/String)value for the key.

<br />

|                                                                                                 Parameters                                                                                                 ||
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `key`          | `int`: one of the keys supported in[putString(int, java.lang.String)](https://developer.android.com/reference/android/media/MediaMetadataEditor#putString(int,%20java.lang.String)) <br /> |
| `defaultValue` | `String`: the value returned if the key is not present <br />                                                                                                                              |

|                                                                                                          Returns                                                                                                           ||
|--------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the[String](https://developer.android.com/reference/java/lang/String)value for the key, or the supplied default value if the key is not present <br /> |

|                                                                   Throws                                                                   ||
|--------------------------------------------------------------------------------------------------------|------------------------------------|
|                                                                                                        | java.lang.IllegalArgumentException |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) |                                    |

### putBitmap

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

```
public MediaMetadataEditor putBitmap (int key, 
                Bitmap bitmap)
```

Adds image.

<br />

|                                                                                               Parameters                                                                                               ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `key`    | `int`: the identifier of the bitmap to set. The only valid value is[BITMAP_KEY_ARTWORK](https://developer.android.com/reference/android/media/MediaMetadataEditor#BITMAP_KEY_ARTWORK) <br /> |
| `bitmap` | `Bitmap`: The bitmap for the artwork, or null if there isn't any. <br />                                                                                                                     |

|                                                                                                  Returns                                                                                                  ||
|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| [MediaMetadataEditor](https://developer.android.com/reference/android/media/MediaMetadataEditor) | Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together. <br /> |

|                                                                   Throws                                                                   ||
|--------------------------------------------------------------------------------------------------------|------------------------------------|
|                                                                                                        | java.lang.IllegalArgumentException |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) |                                    |

**See also:**

- [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)  

### putLong

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

```
public MediaMetadataEditor putLong (int key, 
                long value)
```

Adds numerical information. Note that none of the information added after[apply()](https://developer.android.com/reference/android/media/MediaMetadataEditor#apply())has been called will be available to consumers of metadata stored by the MediaMetadataEditor.

<br />

|                                                                                                                                                                                                                                                                                                                                                                       Parameters                                                                                                                                                                                                                                                                                                                                                                       ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `key`   | `int`: the identifier of a the metadata field to set. Valid values are[MediaMetadataRetriever.METADATA_KEY_CD_TRACK_NUMBER](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_CD_TRACK_NUMBER),[MediaMetadataRetriever.METADATA_KEY_DISC_NUMBER](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_DISC_NUMBER),[MediaMetadataRetriever.METADATA_KEY_DURATION](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_DURATION)(with a value expressed in milliseconds),[MediaMetadataRetriever.METADATA_KEY_YEAR](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_YEAR). <br /> |
| `value` | `long`: The long value for the given key <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

|                                                                                                  Returns                                                                                                  ||
|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| [MediaMetadataEditor](https://developer.android.com/reference/android/media/MediaMetadataEditor) | Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together. <br /> |

|                                                                   Throws                                                                   ||
|--------------------------------------------------------------------------------------------------------|------------------------------------|
|                                                                                                        | java.lang.IllegalArgumentException |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) |                                    |

### putObject

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

```
public MediaMetadataEditor putObject (int key, 
                Object value)
```

Adds information stored as an instance. Note that none of the information added after[apply()](https://developer.android.com/reference/android/media/MediaMetadataEditor#apply())has been called will be available to consumers of metadata stored by the MediaMetadataEditor.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `key`   | `int`: the identifier of a the metadata field to set. Valid keys for a: - [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap)object are[BITMAP_KEY_ARTWORK](https://developer.android.com/reference/android/media/MediaMetadataEditor#BITMAP_KEY_ARTWORK), - [String](https://developer.android.com/reference/java/lang/String)object are the same as for[putString(int, java.lang.String)](https://developer.android.com/reference/android/media/MediaMetadataEditor#putString(int,%20java.lang.String)) - [Long](https://developer.android.com/reference/java/lang/Long)object are the same as for[putLong(int, long)](https://developer.android.com/reference/android/media/MediaMetadataEditor#putLong(int,%20long)) - [Rating](https://developer.android.com/reference/android/media/Rating)object are[RATING_KEY_BY_OTHERS](https://developer.android.com/reference/android/media/MediaMetadataEditor#RATING_KEY_BY_OTHERS)and[RATING_KEY_BY_USER](https://developer.android.com/reference/android/media/MediaMetadataEditor#RATING_KEY_BY_USER). <br /> |
| `value` | `Object`: the metadata to add. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

|                                                                                                  Returns                                                                                                  ||
|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| [MediaMetadataEditor](https://developer.android.com/reference/android/media/MediaMetadataEditor) | Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together. <br /> |

|                                                                   Throws                                                                   ||
|--------------------------------------------------------------------------------------------------------|------------------------------------|
|                                                                                                        | java.lang.IllegalArgumentException |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) |                                    |

### putString

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

```
public MediaMetadataEditor putString (int key, 
                String value)
```

Adds textual information. Note that none of the information added after[apply()](https://developer.android.com/reference/android/media/MediaMetadataEditor#apply())has been called, will be available to consumers of metadata stored by the MediaMetadataEditor.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `key`   | `int`: The identifier of a the metadata field to set. Valid values are[MediaMetadataRetriever.METADATA_KEY_ALBUM](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_ALBUM),[MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_ALBUMARTIST),[MediaMetadataRetriever.METADATA_KEY_TITLE](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_TITLE),[MediaMetadataRetriever.METADATA_KEY_ARTIST](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_ARTIST),[MediaMetadataRetriever.METADATA_KEY_AUTHOR](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_AUTHOR),[MediaMetadataRetriever.METADATA_KEY_COMPILATION](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_COMPILATION),[MediaMetadataRetriever.METADATA_KEY_COMPOSER](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_COMPOSER),[MediaMetadataRetriever.METADATA_KEY_DATE](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_DATE),[MediaMetadataRetriever.METADATA_KEY_GENRE](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_GENRE),[MediaMetadataRetriever.METADATA_KEY_WRITER](https://developer.android.com/reference/android/media/MediaMetadataRetriever#METADATA_KEY_WRITER). <br /> |
| `value` | `String`: The text for the given key, or`null`to signify there is no valid information for the field. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

|                                                                                                  Returns                                                                                                  ||
|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| [MediaMetadataEditor](https://developer.android.com/reference/android/media/MediaMetadataEditor) | Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together. <br /> |

|                                                  Throws                                                   ||
|--------------------------------------------------------------------------------------------------------|---|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) |   |

### removeEditableKeys

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

```
public void removeEditableKeys ()
```

Causes all metadata fields to be read-only.

<br />