Hi used chatstates ejabberd protocol for typing status. please read this doc might be helpful you XEP-0085: Chat State Notifications
For android side you need to implement following code
Message msg= (Message) stanza;
// below ChatStateExtension for Compossing message.
ChatStateExtension state = (ChatStateExtension)msg.getExtension("http://jabber.org/protocol/chatstates");//jabber:x:event
// if state (ChatStateExtension) !=null and is composing then call listener method if not error.
if(state!=null) {
Log.d(AppConstants.ELEMENT,"ChatStateExtension : " + state.toXML());
if (state.getElementName().equals("composing")) {
if (msg.getType().equals(Message.Type.error)) {
return;
}
if (iCallBackForTypingListener != null) {
DelayInformation timestamp = (DelayInformation) msg.getExtension("delay", "urn:xmpp:delay");
if (timestamp == null)
timestamp = (DelayInformation) msg.getExtension("x", "jabber:x:delay");
if (timestamp != null && timestamp.getReason().equalsIgnoreCase("Offline Storage")){ //return if delay info is Offline Storage
return;
}
//update your typing listener
iCallBackForTypingListener.onTypingStanza(fromJID, typingSender);
}
// xmpp.updateChatState(fromJID, state.getElementName(), sender);
return;
} else if (state.getElementName().equals("paused")) {
return;
}