I am writing a like chat app. It seems that is not possible with b4a to insert any emoticon icon in a textview. I looked for it in the forum but.... Nothing. Is it really impossible to write an app like whatsapp with b4a?
Using the Canvas you can draw texts and bitmaps, then your custom view should be based on it (intercepting the key pressed and using MyCanvas.DrawText to write the correspondig character - Chr(KeyCode))
I'm afraid the only object that returns the KeyCode is the Activity, then you should use a global variable that points to the view that has the focus (or you should use some function through reflection, if it exists)
I tried something. It works not well but it will serve you as a starting point.
There are many changes to make:
a) avoid using literal values; replace them with pseudo constants;
b) managing placeholders for icons and relative length of the text;
c) managing deleted text;
d) create a custom view, otherwise it will work only with the views stated in the project.
We could use a map that contains the "structure" of the message; I mean that it could be contains letters, but also references to the icons.
The trouble is the repositioning of the cursor: the Touch event of the panel could be used, but I do not think that will be raised while the keyboard is on screen, then you should also create a custom keyboard.
Too complicated, but I don't have another idea!
If this can console you, here I can add this emoticon