# TvContractCompat.Programs.Genres

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-tv-provider:28.0.0-alpha1  
Summary:[Constants](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#constants)\|[Methods](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#)  

# TvContractCompat.Programs.Genres

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static
final

class
TvContractCompat.Programs.Genres
`  
`

extends Object


``


`

|---|-----------------------------------------------------------|
| java.lang.Object                                             ||
| ↳ | android.support.media.tv.TvContractCompat.Programs.Genres |

<br />

*** ** * ** ***

Canonical genres for TV programs.

## Summary

|                                                                                 ### Constants                                                                                 ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `String` | [ANIMAL_WILDLIFE](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#ANIMAL_WILDLIFE) The genre for Animal/Wildlife. |
| `String` | [ARTS](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#ARTS) The genre for Arts.                                  |
| `String` | [COMEDY](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#COMEDY) The genre for Comedy.                            |
| `String` | [DRAMA](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#DRAMA) The genre for Drama.                               |
| `String` | [EDUCATION](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#EDUCATION) The genre for Education.                   |
| `String` | [ENTERTAINMENT](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#ENTERTAINMENT) The genre for Entertainment.       |
| `String` | [FAMILY_KIDS](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#FAMILY_KIDS) The genre for Family/Kids.             |
| `String` | [GAMING](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#GAMING) The genre for Gaming.                            |
| `String` | [LIFE_STYLE](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#LIFE_STYLE) The genre for Life Style.                |
| `String` | [MOVIES](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#MOVIES) The genre for Movies.                            |
| `String` | [MUSIC](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#MUSIC) The genre for Music.                               |
| `String` | [NEWS](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#NEWS) The genre for News.                                  |
| `String` | [PREMIER](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#PREMIER) The genre for Premier.                         |
| `String` | [SHOPPING](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#SHOPPING) The genre for Shopping.                      |
| `String` | [SPORTS](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#SPORTS) The genre for Sports.                            |
| `String` | [TECH_SCIENCE](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#TECH_SCIENCE) The genre for Tech/Science.          |
| `String` | [TRAVEL](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#TRAVEL) The genre for Travel.                            |

|                                                                                                                                                                                    ### Public methods                                                                                                                                                                                     ||
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static String[]` | ` `[decode](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#decode(java.lang.String))`(String genres) ` Decodes the genre strings from the text stored in the database.                                                                                                                                             |
| ` static String`   | ` `[encode](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#encode(java.lang.String...))`(String... genres) ` Encodes genre strings to a text that can be put into the database.                                                                                                                                    |
| ` static boolean`  | ` `[isCanonical](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#isCanonical(java.lang.String))`(String genre) ` Returns whether a given text is a canonical genre defined in[TvContractCompat.Programs.Genres](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres). |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### ANIMAL_WILDLIFE

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String ANIMAL_WILDLIFE
```

The genre for Animal/Wildlife.

<br />

Constant Value: "ANIMAL_WILDLIFE"  

### ARTS

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String ARTS
```

The genre for Arts.

<br />

Constant Value: "ARTS"  

### COMEDY

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String COMEDY
```

The genre for Comedy.

<br />

Constant Value: "COMEDY"  

### DRAMA

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String DRAMA
```

The genre for Drama.

<br />

Constant Value: "DRAMA"  

### EDUCATION

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String EDUCATION
```

The genre for Education.

<br />

Constant Value: "EDUCATION"  

### ENTERTAINMENT

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String ENTERTAINMENT
```

The genre for Entertainment.

<br />

Constant Value: "ENTERTAINMENT"  

### FAMILY_KIDS

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String FAMILY_KIDS
```

The genre for Family/Kids.

<br />

Constant Value: "FAMILY_KIDS"  

### GAMING

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String GAMING
```

The genre for Gaming.

<br />

Constant Value: "GAMING"  

### LIFE_STYLE

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String LIFE_STYLE
```

The genre for Life Style.

<br />

Constant Value: "LIFE_STYLE"  

### MOVIES

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String MOVIES
```

The genre for Movies.

<br />

Constant Value: "MOVIES"  

### MUSIC

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String MUSIC
```

The genre for Music.

<br />

Constant Value: "MUSIC"  

### NEWS

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String NEWS
```

The genre for News.

<br />

Constant Value: "NEWS"  

### PREMIER

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String PREMIER
```

The genre for Premier.

<br />

Constant Value: "PREMIER"  

### SHOPPING

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String SHOPPING
```

The genre for Shopping.

<br />

Constant Value: "SHOPPING"  

### SPORTS

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String SPORTS
```

The genre for Sports.

<br />

Constant Value: "SPORTS"  

### TECH_SCIENCE

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String TECH_SCIENCE
```

The genre for Tech/Science.

<br />

Constant Value: "TECH_SCIENCE"  

### TRAVEL

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String TRAVEL
```

The genre for Travel.

<br />

Constant Value: "TRAVEL"

## Public methods

### decode

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String[] decode (String genres)
```

Decodes the genre strings from the text stored in the database.

<br />

|                                                                                                                                                                              Parameters                                                                                                                                                                               ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `genres` | `String`: The encoded genre string retrieved from the[COLUMN_BROADCAST_GENRE](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs#COLUMN_BROADCAST_GENRE)or[COLUMN_CANONICAL_GENRE](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs#COLUMN_CANONICAL_GENRE)column. <br /> |

|              Returns              ||
|------------|-----------------------|
| `String[]` | genre strings. <br /> |

### encode

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String encode (String... genres)
```

Encodes genre strings to a text that can be put into the database.

<br />

|                Parameters                 ||
|----------|---------------------------------|
| `genres` | `String`: Genre strings. <br /> |

|                                                                                                                                                                                Returns                                                                                                                                                                                ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `String` | an encoded genre string that can be inserted into the[COLUMN_BROADCAST_GENRE](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs#COLUMN_BROADCAST_GENRE)or[COLUMN_CANONICAL_GENRE](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs#COLUMN_CANONICAL_GENRE)column. <br /> |

### isCanonical

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isCanonical (String genre)
```

Returns whether a given text is a canonical genre defined in[TvContractCompat.Programs.Genres](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres).

<br />

|                         Parameters                         ||
|---------|---------------------------------------------------|
| `genre` | `String`: The name of genre to be checked. <br /> |

|                               Returns                                ||
|-----------|-----------------------------------------------------------|
| `boolean` | `true`if the genre is canonical, otherwise`false`. <br /> |

-

  ## Interfaces

  - [TvContractCompat.BaseTvColumns](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.BaseTvColumns)
-

  ## Classes

  - [Channel](https://developer.android.com/reference/android/support/media/tv/Channel)
  - [Channel.Builder](https://developer.android.com/reference/android/support/media/tv/Channel.Builder)
  - [ChannelLogoUtils](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils)
  - [PreviewProgram](https://developer.android.com/reference/android/support/media/tv/PreviewProgram)
  - [PreviewProgram.Builder](https://developer.android.com/reference/android/support/media/tv/PreviewProgram.Builder)
  - [Program](https://developer.android.com/reference/android/support/media/tv/Program)
  - [Program.Builder](https://developer.android.com/reference/android/support/media/tv/Program.Builder)
  - [R](https://developer.android.com/reference/android/support/media/tv/R)
  - [R.attr](https://developer.android.com/reference/android/support/media/tv/R.attr)
  - [R.bool](https://developer.android.com/reference/android/support/media/tv/R.bool)
  - [R.color](https://developer.android.com/reference/android/support/media/tv/R.color)
  - [R.dimen](https://developer.android.com/reference/android/support/media/tv/R.dimen)
  - [R.drawable](https://developer.android.com/reference/android/support/media/tv/R.drawable)
  - [R.id](https://developer.android.com/reference/android/support/media/tv/R.id)
  - [R.integer](https://developer.android.com/reference/android/support/media/tv/R.integer)
  - [R.layout](https://developer.android.com/reference/android/support/media/tv/R.layout)
  - [R.string](https://developer.android.com/reference/android/support/media/tv/R.string)
  - [R.style](https://developer.android.com/reference/android/support/media/tv/R.style)
  - [R.styleable](https://developer.android.com/reference/android/support/media/tv/R.styleable)
  - [TvContractCompat](https://developer.android.com/reference/android/support/media/tv/TvContractCompat)
  - [TvContractCompat.Channels](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels)
  - [TvContractCompat.Channels.Logo](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels.Logo)
  - [TvContractCompat.PreviewPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.PreviewPrograms)
  - [TvContractCompat.Programs](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs)
  - [TvContractCompat.Programs.Genres](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres)
  - [TvContractCompat.RecordedPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.RecordedPrograms)
  - [TvContractCompat.WatchNextPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.WatchNextPrograms)
  - [WatchNextProgram](https://developer.android.com/reference/android/support/media/tv/WatchNextProgram)
  - [WatchNextProgram.Builder](https://developer.android.com/reference/android/support/media/tv/WatchNextProgram.Builder)