Victoria C
Victoria C

Reputation: 37

Addition of custom emoticons on Soft Keyboard

I am very new to app development, I have developed a softkeyboard from an existing source, I have referred to the SDK softkeyboard sample but there isnt any help there on adding emoticons.

I want to add my own emoticons to the softkeyboard, how do I go about accomplishing this? From what I have researched I've only found how to create the actual soft keyboard itself but I have found nothing on how to create a custom one (with addition of your own emoticons). any advice, blogposts or references pertaining to how to add custom emoticons to a softkeyboard will be greatly appreciated..Thanks!

Upvotes: 0

Views: 1251

Answers (1)

lrAndroid
lrAndroid

Reputation: 2854

Add a keyboard layout in XML, similar to qwerty.xml, symbols.xml, etc., replacing the keys with keys that use your emoticon icons (android:keyIcon="@drawable/smiley_icon", for example) and that output that text for the emoticon (android:keyOutputText=":-)", for example). Then add a keyboard, named something like mEmoticonKeyboard, to your SoftKeyboard class and instantiate it in the same way that mQwertyKeyboad, mSymbolsKeyboard, etc. are created.

To show this keyboard, add it to the keyboard rotation cycle on handleShift().

Upvotes: 1

Related Questions