# Clear Key on Android

This article provides a simple example of how to use Clear Key with THEOplayer.

Usually, DRM systems require you to specify a `licenseAcquisitionURL` and additional optional data (e.g.: certificate, credentials, headers). Clear Key does not need a DRM provider. You can provide the key(s) directly to the player (hence "clear" key) through the `keys` property in its `LicenseAcquisitionDescription` (in fact, this property is only available for Clear Key). Alternatively, you can have the player fetch the keys from a `licenseAcquisitionURL`, which returns a JSON object containing the same keys.

Head to our page on [DRM](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/introduction.md) for more general information.

Please check also our related [API documentation](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/v11/api-reference/android/com/theoplayer/android/api/source/drm/ClearkeyKeySystemConfiguration) on how to set these.

## Code example

```java
SourceDescription.Builder clearKey = new SourceDescription.Builder(
        new TypedSource.Builder("https://storage.googleapis.com/shaka-demo-assets/angel-one-clearkey/dash.mpd")
                .drm(
                        new DRMConfiguration.Builder()
                                .clearkey(
                                        new ClearkeyKeySystemConfiguration.Builder("https://cwip-shaka-proxy.appspot.com/clearkey?_u3wDe7erb7v8Lqt8A3QDQ=ABEiM0RVZneImaq7zN3u_w")
                                                .useCredentials(false)
                                                .build()
                                )
                                .build()
                )
                .build()
);

tpv.getPlayer().setSource(clearKey.build());
```

## Resources

* [Generate MPEG DASH content encrypted with MPEG CENC ClearKey](https://github.com/Dash-Industry-Forum/dash.js/wiki/Generate-MPEG-DASH-content-encrypted-with-MPEG-CENC-ClearKey): DASH IF on GitHub
* [Clear Key license format](https://w3c.github.io/encrypted-media/#clear-key-license-format): W3C - Encrypted Media Extensions
