Frage

I am trying the basics of setting up XMPP communication between android phones using aSmack. I have managed to register an account from my app and send messages to a Jabber-ID that I'm logged into on my PC. The issue is replies from my PC client don't seem to be getting received, the processMessage() in my MessageListener doesn't seem to be being called.

       try{connection.login("kmomochesstest", "password1");}
       catch(Exception e){Log.e("connection","Account login error: " + e.toString());}
       chat = connection.getChatManager().createChat("chesstestpc@macjabber.de", new MessageListener() {

             public void processMessage(Chat chat, Message message) {
                 try{System.out.println(message.getBody());}
             catch(Exception e){Log.e("connection","Message send error: " + e.toString());}
       });
       try{chat.sendMessage("Test Message from Activity");Log.d("connection","Just sent Message ");}
        catch(Exception e){Log.e("connection","Message send error: " + e.toString());}

At this point I'm trying to print to the console but I've tried printing to the Log and just echoing back to my PC with chat.sendMessage(message.getBody()). Nothing seems to register an incoming message. This seems to be the format on every how-to I've found online.

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top