Android Question How to Enable emoticons button in keyboard?

FrankBerra

Active Member
Licensed User
Longtime User
Hi all

On some socials when i click on the input text field the keyboard comes up with the Emoticon button in place of the enter button. (see attachment Keyboard01.jpg)
If i click the emoticon button all the system emoji appears and i can use them in chat. (see attachment Keyboard02.jpg)

How can i sobstitute the enter button with the Emoticons one in B4A?

Thanks in advance

 

sonicmayne

Member
Licensed User
Longtime User
This should work (it works on my Galaxy Player (Android 2.3.3) and Nexus 7 (Android 6.0.1), and on my Xperia Z (android 5.1.1) it makes the keyboard display the Finished button with 3 dots that when long tapped brings up the emoji selection):

B4X:
Sub ShowEmojiButton(EditText As EditText)
    EditText.InputType = 64
End Sub

Call it like:

B4X:
ShowEmojiButton(YourEditText)
 
Upvote 0

FrankBerra

Active Member
Licensed User
Longtime User
Yeah, now displays a "done" button but we are close to the solution

Here http://stackoverflow.com/questions/25167428/android-keyboard-with-emoji
someone says that works using the following syntax:
android:inputType="textMultiLine|textShortMessage"

As explained here: http://developer.android.com/reference/android/text/InputType.html
which int value corresponds to "textMultiLine|textShortMessage" ?
I tried to sum the values and it works for other inputtype proprieties but the emoji button won't show up...

(By the way Googling around i found that a long-press on the Return buttons pops up the Emoji button)
 
Upvote 0

sonicmayne

Member
Licensed User
Longtime User
In my tests this:

B4X:
Sub ShowEmojiButton(EditText As EditText)
    EditText.InputType = Bit.Or(64 , 131072)
    EditText.SingleLine = False
End Sub

has the exact same results as before (that is emoji button on my Nexus 7 and Galaxy Player, new line button on Xperia Z), except the user can enter multiple lines.

What device and version of Android are you testing this on?
 
Upvote 0

FrankBerra

Active Member
Licensed User
Longtime User
Well i am using Nexus 5 (Android 6.0.1) and Samsung Galaxy S2 (Android 4.1.2) and in both cases the Emoji button won't show up as default option using your codes. (by the way I can access to emoticons by long pressing the return button)
I am wondering how the other social where able to show the emoji button as default option instead the return button....uuhmmm

In any case thanks for pointing me in the right direction with InputType
 
Upvote 0

sonicmayne

Member
Licensed User
Longtime User
It's very strange because on my Galaxy Player and Nexus 7 I get the emoji button, but on my Xperia Z I get the new line button which when long pressed brings up the emoticon selector.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…