相关疑难解决方法(0)

使用asmack for android在XMPP数据包的Message标签中添加自定义属性?

我要收到的消息包.

  <message to="39@domainname.com/smack" chat_id="73392" 
           custom_packet="true" user_id="44" manager_id="39" time_stamp="0" website_id="0" 
           visitor_name="John" end_time="False" xml:lang="en-us" type="groupchat" 
           from="room73392@conference.domainname.com/39">
           <body>Hello</body> 
           <x xmlns="http://jabber.org/protocol/muc#user"> 
           <status xmlns="" code="0"/>   
           </x></message>
Run Code Online (Sandbox Code Playgroud)

我收到的消息包.

<message to="44@domainname.com/Smack" 
    from="room73407@conference.domainname.com/Visitor1171" type="groupchat">
    <body>Hello</body>
    <delay xmlns="urn:xmpp:delay"></delay>
    <x xmlns="jabber:x:delay" stamp="20120917T05:57:19" 
    from="4732abb5@domainname.com/4732abb5">
    </x></message>
Run Code Online (Sandbox Code Playgroud)

我有一个smack的源代码,这是包类.任何人都可以帮我制作自定义数据包.任何帮助修改源代码表示赞赏.

代码:

public abstract class Packet {

protected static final String DEFAULT_LANGUAGE =
        java.util.Locale.getDefault().getLanguage().toLowerCase();

private static String DEFAULT_XML_NS = null;

/**
 * Constant used as packetID to indicate that a packet has no id. To indicate that a packet
 * has no id set this constant …
Run Code Online (Sandbox Code Playgroud)

java android xmpp smack xmppframework

3
推荐指数
1
解决办法
9928
查看次数

标签 统计

android ×1

java ×1

smack ×1

xmpp ×1

xmppframework ×1