A quick demonstration of the various ways to Support Modern Emoji using Google's EmojiCompat library
Source initially copied from android/user-interface-samples/EmojiCompat
library | version |
---|---|
appcompat | 1.5.1 |
emoji2 | 1.2.0 |
Using AppCompat to support the latest emoji.
AppCompat will invoke EmojiCompatInitializer
at app startup.
Bundling the Noto Color Emoji Compat font by way of the emoji2-bundled
artifact, as described
here.
- Invoking
EmojiCompat.init(BundledEmojiCompatConfig(..))
duringApplication.onCreate
. - Manifest provider for
EmojiCompatInitializer
is still present. Removing this as described here breaks the integration.
Launching a Font Request to download the Noto Color Emoji Compat font by initializing EmojiCompat
with FontRequestEmojiCompatConfig
.
- Following the FontRequest flow as demonstrated in the Android EmojiCompat Sample project
- Removed the Manifest provider for
EmojiCompatInitializer
as described here
EmojiCompat configurations that rely on FontRequest do not appear functional on an Android 11 Emulator with up-to-date Google Play Services. The steps to resolve this issue provided here have not resolved the issue.
Test: Multi-skin-toned handshake emoji should render successfully: 🫱🏿🫲🏻
Result: Only renders when EmojiCompat is initialized with BundledEmojiCompatConfig
Device | AppCompat | Bundled | FontRequest |
---|---|---|---|
❌ Emulator Android 11 (Pixel 4 with Playstore) Running recent version (22.39.15) of Playstore |
![]() |
![]() |
![]() |
✅ Real Device Android 11 One Plus |
![]() |
![]() |
![]() |
./gradlew assembleDebug
adb install -r -t ./app-emojicompat-bundled/build/outputs/apk/debug/app-emojicompat-bundled-debug.apk
adb install -r -t ./app-emojicompat-fontrequest/build/outputs/apk/debug/app-emojicompat-fontrequest-debug.apk
adb install -r -t ./app-emojicompat-appcompat/build/outputs/apk/debug/app-emojicompat-appcompat-debug.apk