RemoteControlClient.MetadataEditor


public class RemoteControlClient.MetadataEditor
extends MediaMetadataEditor

java.lang.Object
   ↳ android.media.MediaMetadataEditor
     ↳ android.media.RemoteControlClient.MetadataEditor


This class was deprecated in API level 21.
Use MediaMetadata and MediaSession instead.

Class used to modify metadata in a RemoteControlClient object. Use RemoteControlClient#editMetadata(boolean) to create an instance of an editor, on which you set the metadata for the RemoteControlClient instance. Once all the information has been set, use apply() to make it the new metadata that should be displayed for the associated client. Once the metadata has been "applied", you cannot reuse this instance of the MetadataEditor.

Summary

Constants

int BITMAP_KEY_ARTWORK

The metadata key for the content artwork / album art.

Inherited constants

Public methods

void apply()

Associates all the metadata that has been set since the MetadataEditor instance was created with RemoteControlClient#editMetadata(boolean), or since clear() was called, with the RemoteControlClient.

void clear()

Clears all the metadata that has been set since the MetadataEditor instance was created (with RemoteControlClient#editMetadata(boolean)).

RemoteControlClient.MetadataEditor putBitmap(int key, Bitmap bitmap)

Sets the album / artwork picture to be displayed on the remote control.

RemoteControlClient.MetadataEditor putLong(int key, long value)

Adds numerical information to be displayed.

RemoteControlClient.MetadataEditor putObject(int key, Object object)

Adds information stored as an instance.

RemoteControlClient.MetadataEditor putString(int key, String value)

Adds textual information to be displayed.

Inherited methods

Constants

BITMAP_KEY_ARTWORK

Added in API level 14
public static final int BITMAP_KEY_ARTWORK

The metadata key for the content artwork / album art.

Constant Value: 100 (0x00000064)

Public methods

apply

Added in API level 14
public void apply ()

Associates all the metadata that has been set since the MetadataEditor instance was created with RemoteControlClient#editMetadata(boolean), or since clear() was called, with the RemoteControlClient. Once "applied", this MetadataEditor cannot be reused to edit the RemoteControlClient's metadata.

clear

Added in API level 14
public void clear ()

Clears all the metadata that has been set since the MetadataEditor instance was created (with RemoteControlClient#editMetadata(boolean)). Note that clearing the metadata doesn't reset the editable keys (use MediaMetadataEditor#removeEditableKeys() instead).

putBitmap

Added in API level 14
public RemoteControlClient.MetadataEditor putBitmap (int key, 
                Bitmap bitmap)

Sets the album / artwork picture to be displayed on the remote control.

Parameters
key int: the identifier of the bitmap to set. The only valid value is BITMAP_KEY_ARTWORK

bitmap Bitmap: The bitmap for the artwork, or null if there isn't any.

Returns
RemoteControlClient.MetadataEditor Returns a reference to the same MetadataEditor object, so you can chain put calls together.

Throws
java.lang.IllegalArgumentException
IllegalArgumentException

See also:

putLong

Added in API level 14
public RemoteControlClient.MetadataEditor putLong (int key, 
                long value)

Adds numerical information to be displayed. Note that none of the information added after apply() has been called, will be displayed.

Parameters
key int: the identifier of a the metadata field to set. Valid values are MediaMetadataRetriever.METADATA_KEY_CD_TRACK_NUMBER, MediaMetadataRetriever.METADATA_KEY_DISC_NUMBER, MediaMetadataRetriever.METADATA_KEY_DURATION (with a value expressed in milliseconds), MediaMetadataRetriever.METADATA_KEY_YEAR.

value long: The long value for the given key

Returns
RemoteControlClient.MetadataEditor Returns a reference to the same MetadataEditor object, so you can chain put calls together.

Throws
java.lang.IllegalArgumentException
IllegalArgumentException

putObject

Added in API level 19
Deprecated in API level 21
public RemoteControlClient.MetadataEditor putObject (int key, 
                Object object)

Adds information stored as an instance. Note that none of the information added after apply() has been called will be available to consumers of metadata stored by the MediaMetadataEditor.

Parameters
key int: the identifier of a the metadata field to set. Valid keys for a:

object Object: the metadata to add.

Returns
RemoteControlClient.MetadataEditor Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together.

Throws
IllegalArgumentException

putString

Added in API level 14
public RemoteControlClient.MetadataEditor putString (int key, 
                String value)

Adds textual information to be displayed. Note that none of the information added after apply() has been called, will be displayed.

Parameters
key int: The identifier of a the metadata field to set. Valid values are MediaMetadataRetriever.METADATA_KEY_ALBUM, MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST, MediaMetadataRetriever.METADATA_KEY_TITLE, MediaMetadataRetriever.METADATA_KEY_ARTIST, MediaMetadataRetriever.METADATA_KEY_AUTHOR, MediaMetadataRetriever.METADATA_KEY_COMPILATION, MediaMetadataRetriever.METADATA_KEY_COMPOSER, MediaMetadataRetriever.METADATA_KEY_DATE, MediaMetadataRetriever.METADATA_KEY_GENRE, MediaMetadataRetriever.METADATA_KEY_TITLE, MediaMetadataRetriever.METADATA_KEY_WRITER.

value String: The text for the given key, or null to signify there is no valid information for the field.

Returns
RemoteControlClient.MetadataEditor Returns a reference to the same MetadataEditor object, so you can chain put calls together.

Throws
IllegalArgumentException