Android APIs
public final class

TvContract

extends Object
java.lang.Object
   ↳ android.media.tv.TvContract

Class Overview

The contract between the TV provider and applications. Contains definitions for the supported URIs and columns.

Overview

TvContract defines a basic database of TV content metadata such as channel and program information. The information is stored in TvContract.Channels and TvContract.Programs tables.

  • A row in the TvContract.Channels table represents information about a TV channel. The data format can vary greatly from standard to standard or according to service provider, thus the columns here are mostly comprised of basic entities that are usually seen to users regardless of standard such as channel number and name.
  • A row in the TvContract.Programs table represents a set of data describing a TV program such as program title and start time.

Summary

Nested Classes
interface TvContract.BaseTvColumns Common base for the tables of TV channels/programs. 
class TvContract.Channels Column definitions for the TV channels table. 
class TvContract.Programs Column definitions for the TV programs table. 
Constants
String AUTHORITY The authority for the TV provider.
Public Methods
final static Uri buildChannelLogoUri(Uri channelUri)
Builds a URI that points to a channel logo.
final static Uri buildChannelLogoUri(long channelId)
Builds a URI that points to a channel logo.
final static Uri buildChannelUri(long channelId)
Builds a URI that points to a specific channel.
final static Uri buildChannelsUriForInput(ComponentName name, boolean browsableOnly)
Builds a URI that points to all or browsable-only channels from a given TV input.
final static Uri buildChannelsUriForInput(ComponentName name)
Builds a URI that points to all browsable channels from a given TV input.
final static Uri buildProgramUri(long programId)
Builds a URI that points to a specific program.
final static Uri buildProgramsUriForChannel(Uri channelUri)
Builds a URI that points to all programs on a given channel.
final static Uri buildProgramsUriForChannel(Uri channelUri, long startTime, long endTime)
Builds a URI that points to programs on a specific channel whose schedules overlap with the given time frame.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String AUTHORITY

The authority for the TV provider.

Constant Value: "android.media.tv"

Public Methods

public static final Uri buildChannelLogoUri (Uri channelUri)

Builds a URI that points to a channel logo. See TvContract.Channels.Logo.

Parameters
channelUri The URI of the channel whose logo is pointed to.

public static final Uri buildChannelLogoUri (long channelId)

Builds a URI that points to a channel logo. See TvContract.Channels.Logo.

Parameters
channelId The ID of the channel whose logo is pointed to.

public static final Uri buildChannelUri (long channelId)

Builds a URI that points to a specific channel.

Parameters
channelId The ID of the channel to point to.

public static final Uri buildChannelsUriForInput (ComponentName name, boolean browsableOnly)

Builds a URI that points to all or browsable-only channels from a given TV input.

Parameters
name ComponentName of the TvInputService that implements the given TV input.
browsableOnly If set to true the URI points to only browsable channels. If set to false the URI points to all channels regardless of whether they are browsable or not.

public static final Uri buildChannelsUriForInput (ComponentName name)

Builds a URI that points to all browsable channels from a given TV input.

Parameters
name ComponentName of the TvInputService that implements the given TV input.

public static final Uri buildProgramUri (long programId)

Builds a URI that points to a specific program.

Parameters
programId The ID of the program to point to.

public static final Uri buildProgramsUriForChannel (Uri channelUri)

Builds a URI that points to all programs on a given channel.

Parameters
channelUri The URI of the channel to return programs for.

public static final Uri buildProgramsUriForChannel (Uri channelUri, long startTime, long endTime)

Builds a URI that points to programs on a specific channel whose schedules overlap with the given time frame.

Parameters
channelUri The URI of the channel to return programs for.
startTime The start time used to filter programs. The returned programs should have COLUMN_END_TIME_UTC_MILLIS that is greater than this time.
endTime The end time used to filter programs. The returned programs should have COLUMN_START_TIME_UTC_MILLIS that is less than this time.