Note that there are some explanatory texts on larger screens.

plurals
  1. POasmack - receiving custom XML messages ||
    primarykey
    data
    text
    <p>I've spend some time to add smack.providers in the android device, which is picked up by my application just fine. I've added the default iqProviders and extensionProviders, but I've also added my custom extensionProvider, which is the following:</p> <pre><code>&lt;extensionProvider&gt; &lt;elementName&gt;players&lt;/elementName&gt; &lt;namespace&gt;boxer:players&lt;/namespace&gt; &lt;className&gt;company.games.boxer.PlayerListProvider&lt;/className&gt; &lt;/extensionProvider&gt; </code></pre> <p>Let me also introduce the PlayerListProvider class, which is currently there just to see if it will get called (which it doesn't) - I'll implement it fully when I'll know it gets called, therefore at least that part of functionality works:</p> <pre><code>import java.util.List; import java.util.Map; import org.jivesoftware.smack.packet.PacketExtension; import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; import android.util.Log; @SuppressWarnings("deprecation") class PlayerListProvider extends EmbeddedExtensionProvider { protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map&lt;String,String&gt; attributeMap, List&lt;? extends PacketExtension&gt; content) { Log.w("***** AAAAAAAAAAAAAAAAAAAA *******", "0"); return new XMLPlayerList(); } } class XMLPlayerList implements PacketExtension { public String getElementName() { return "aaaaa"; } public String getNamespace() { return "aaaaa"; } public String toXML() { return "aaaaa"; } } </code></pre> <p>And I'm getting the following message when I run the client android app:</p> <pre><code>&lt;message to="eee@localhost" type="chat" id="9" from="admin@localhost"&gt; &lt;body&gt; &amp;lt;players xmlns="boxer:players" command="playerlist"&amp;gt; &amp;lt;player&amp;gt;test1&amp;lt;/player&amp;gt; &amp;lt;player&amp;gt;test2&amp;lt;/player&amp;gt; &amp;lt;/players&amp;gt; &lt;/body&gt; &lt;thread&gt;3P0i00&lt;/thread&gt; &lt;/message&gt; </code></pre> <p>My question now is, why isn't the PlayerListProvider (EmbeddedExtensionProvider) called upon receiving the message. The message contains the tag and has the namespace of boxer:player, as I specified in smack.providers.</p> <p>Any thoughts?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload