added in version 26.1.0
belongs to Maven artifact com.android.support:support-tv-provider:28.0.0-alpha1

Program

public final class Program
extends Object implements Comparable<Program>

java.lang.Object
   ↳ android.support.media.tv.Program


A convenience class to access TvContractCompat.Programs entries in the system content provider.

This class makes it easy to insert or retrieve a program from the system content provider, which is defined in TvContractCompat.

Usage example when inserting a program:

 Program program = new Program.Builder()
         .setChannelId(channel.getId())
         .setTitle("Program Title")
         .setDescription("Program Description")
         .setPosterArtUri(Uri.parse("http://example.com/poster_art.png"))
         // Set more attributes...
         .build();
 Uri programUri = getContentResolver().insert(Programs.CONTENT_URI, program.toContentValues());
 

Usage example when retrieving a program:

 Program program;
 try (Cursor cursor = resolver.query(programUri, null, null, null, null)) {
     if (cursor != null && cursor.getCount() != 0) {
         cursor.moveToNext();
         program = Program.fromCursor(cursor);
     }
 }
 

Usage example when updating an existing program:

 Program updatedProgram = new Program.Builder(program)
         .setEndTimeUtcMillis(newProgramEndTime)
         .build();
 getContentResolver().update(TvContractCompat.buildProgramUri(updatedProgram.getId()),
         updatedProgram.toContentValues(), null, null);
 

Usage example when deleting a program:

 getContentResolver().delete(TvContractCompat.buildProgramUri(existingProgram.getId()),
         null, null);
 

Summary

Nested classes

class Program.Builder

This Builder class simplifies the creation of a Program object. 

Public methods

int compareTo(Program other)
boolean equals(Object other)
static Program fromCursor(Cursor cursor)

Creates a Program object from a cursor including the fields defined in TvContractCompat.Programs.

String[] getAudioLanguages()
String[] getBroadcastGenres()
String[] getCanonicalGenres()
long getChannelId()
TvContentRating[] getContentRatings()
String getDescription()
long getEndTimeUtcMillis()
String getEpisodeNumber()
String getEpisodeTitle()
long getId()
byte[] getInternalProviderDataByteArray()
Long getInternalProviderFlag1()
Long getInternalProviderFlag2()
Long getInternalProviderFlag3()
Long getInternalProviderFlag4()
String getLongDescription()
Uri getPosterArtUri()
String getReviewRating()
int getReviewRatingStyle()