# DefaultEmojiCompatConfig

Artifact: [androidx.emoji2:emoji2](https://developer.android.com/jetpack/androidx/releases/emoji2) [View Source](https://cs.android.com/search?q=file:androidx/emoji2/text/DefaultEmojiCompatConfig.java+class:androidx.emoji2.text.DefaultEmojiCompatConfig) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.0.0)

*** ** * ** ***

<br />

```
public final class DefaultEmojiCompatConfig
```

<br />

*** ** * ** ***

The default config will use downloadable fonts to fetch the emoji compat font file.

It will automatically fetch the emoji compat font from a `ContentProvider` that is installed on the devices system image, if present.

You should use this if you want the default emoji font from a system installed downloadable fonts provider. This is the recommended behavior for all applications unless they install a custom emoji font.

You may need to specialize the configuration beyond this default config in some situations:

- If you are trying to install a custom emoji font through downloadable fonts use `https://developer.android.com/reference/androidx/emoji2/text/FontRequestEmojiCompatConfig` instead of this method.
- If you're trying to bundle an emoji font with your APK use ` BundledEmojiCompatConfig` in the `emoji2-bundled` artifact.
- If you are building an APK that will be installed on devices that won't have a downloadable fonts provider, use `BundledEmojiCompatConfig`.

The downloadable font provider used by `DefaultEmojiCompatConfig` always satisfies the following contract:

1. It *MUST* provide an intent filter for `androidx.content.action.LOAD_EMOJI_FONT`.
2. It *MUST* respond to the query `emojicompat-emoji-font` with a valid emoji compat font file including metadata.
3. It *MUST* provide fonts via the same contract as downloadable fonts.
4. It *MUST* be installed in the system image.

## Summary

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/emoji2/text/FontRequestEmojiCompatConfig` | `https://developer.android.com/reference/androidx/emoji2/text/DefaultEmojiCompatConfig#create(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` Get the default emoji compat config for this device. |

## Public methods

### create

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.0.0)

```
public static @Nullable FontRequestEmojiCompatConfig create(@NonNull Context context)
```

Get the default emoji compat config for this device. You may further configure the returned config before passing it to `https://developer.android.com/reference/androidx/emoji2/text/EmojiCompat#init(android.content.Context)`. Each call to this method will return a new EmojiCompat.Config, so changes to the returned object will not modify future return values.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | context for lookup |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/emoji2/text/FontRequestEmojiCompatConfig` | A valid config for downloading the emoji compat font, or null if no font provider could be found. |