首页 > 解决方案 > 有没有办法在android上使用json格式的表情?

问题描述

我想从 emoji-datasource 站点接收表情符号作为 json 文件并在 android 中显示。你怎么做呢?json格式的文件是:

[
    {
        "name": "HASH KEY",
        "unified": "0023-FE0F-20E3",
        "non_qualified": "0023-20E3",
        "docomo": "E6E0",
        "au": "EB84",
        "softbank": "E210",
        "google": "FE82C",
        "image": "0023-fe0f-20e3.png",
        "sheet_x": 0,
        "sheet_y": 0,
        "short_name": "hash",
        "short_names": [
            "hash"
        ],
        "text": null,
        "texts": null,
        "category": "Symbols",
        "sort_order": 132,
        "added_in": "0.0",
        "has_img_apple": true,
        "has_img_google": true,
        "has_img_twitter": true,
        "has_img_facebook": false
    },
    {
        "name": null,
        "unified": "002A-FE0F-20E3",
        "non_qualified": "002A-20E3",
        "docomo": null,
        "au": null,
        "softbank": null,
        "google": null,
        "image": "002a-fe0f-20e3.png",
        "sheet_x": 0,
        "sheet_y": 1,
        "short_name": "keycap_star",
        "short_names": [
            "keycap_star"
        ],
        "text": null,
        "texts": null,
        "category": "Symbols",
        "sort_order": 133,
        "added_in": "0.0",
        "has_img_apple": true,
        "has_img_google": true,
        "has_img_twitter": true,
        "has_img_facebook": false
    },
    ...
]

链接在这里:https ://www.npmjs.com/package/emoji-datasource 。我尝试了以下但没有奏效。

textView.text = String(Character.toChars(0x002AFE0F20E3))

我想向用户展示 Android 设备上可用的所有表情符号。

标签: androidemojiemoticons

解决方案


哦,我解决了。只需在 json 文件google名代码中使用。


推荐阅读