Cannot get list of public rooms from xmpp Server on Android?

前端 未结 2 1159
孤独总比滥情好
孤独总比滥情好 2021-01-01 05:56

Hello Everyone i am new to android and i am currently stuck on this. I have to return list of public rooms created on xmpp server. The problem i am having is that the code b

2条回答
  •  臣服心动
    2021-01-01 06:15

    I have found the Solution to the problem.

    The Android asmack library was using this in getHostedRooms(Connection connection, String serviceName) method

    ServiceDiscoveryManager discoManager =ServiceDiscoveryManager.getInstanceFor(connection);
    

    i replaced it with

    ServiceDiscoveryManager discoManager = new ServiceDiscoveryManager(connection);
    

    For those who are confused where this method is its in

    Package: org.jivesoftware.smackx.muc

    File: MultiUserChat.java

    After you have done this. We have to register all the providers in Android whose detail can be found here. These providers are automatically registered when are using JAVA's smack library (In java Development) but in Android we have to register them ourself.

提交回复
热议问题