It shows how it could look like when two XMPP contacts are chatting with each other and having real-time text enabled. Enjoy!
Roughly speaking you have to create a new outbound real-time message and just update its text while typing:
When done typing, commit the message (which will send the current message as normal chat message):
On the receiver side, you can listen for it like this (and e.g. display it to a Label).