I'm trying to build an application for Android using this library: https://github.com/koush/AndroidAsync and I was trying to receive a callback value from the server like this but the app crashes:
client.emit("callbackTry", new Acknowledge() { @Override public void acknowledge(JSONArray arg0) { Log.e(TAG,"acknowledge: "+ arg0); } });
I leave you the server-side:
socket.on('callbackTry', function (callback) { console.log(callback); var hello = "Hello"; callback(hello); });
How can I return the data back to the client?
I found a solution myself which consists on changing emit method to emitEvent. Hope it really help someone else too.