android - 将表情符号添加到 Android 键盘

标签 android unicode ascii android-softkeyboard emoji

我正在制作自己的自定义键盘,但在向其中添加表情符号时遇到问题。作为一个 android:keyIcon,我有一个该表情符号的可绘制对象,我需要它的 android:codes。我不知道按下表情符号时会输出什么。我在网上寻找解决方案,但没有找到任何东西。有谁知道我应该使用什么代码来输出表情符号。提前致谢。

这是 xml 代码的一部分:

 <Row>
    <Key android:codes="1F926" android:keyIcon="@drawable/e415" />
    <Key android:codes="U+1F601" android:keyIcon="@drawable/e415" />
    <Key android:codes="57430" android:keyIcon="@drawable/e0415" />
</Row>

当我单击第一个或第二个时,输出为空,当我单击第二个时,输出是一些中文字母。

最佳答案

如果您使用的是 android studio,这会有所帮助(在 build.gradle 文件中):

dependencies {

   compile 'com.rockerhieu.emojicon:library:1.0'
}

关于android - 将表情符号添加到 Android 键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31639800/

相关文章:

android - 从一个 Activity 中获取文本并将其设置到另一个 Activity 中

c++ - Google RE2无法在正则表达式中识别Unicode转义

javascript - 我认为 JS 给了我 Unicode,而我想要的只是 ASCII

android - Android Studio不支持的gradle版本,但我使用的是兼容版本

android - getInputStream 抛出异常

windows - 使用 AutoHotKey(或其他工具)创建自定义键盘布局

c - 在 C 中实现二进制编码字符的安全编码?

ascii - 如何使用 Java 解压缩 COMP 数字?

java - Android LibGDX 游戏 : FPS drops because of long EGLImpl. eglSwapBuffers 调用

Python 和希伯来语编码/解码错误