smack

Smack 4.1.0 android Roster not displaying

↘锁芯ラ 提交于 2019-12-11 02:45:51
问题 I am trying to display all available contacts even though it is not displaying it Code: Roster roster = Roster.getInstanceFor(connection); Collection<RosterEntry> entries = roster.getEntries(); System.out.println("ENTRIEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESS"); int roster_counter = 0; for (RosterEntry entry : entries) { roster_counter++; try { System.out.println("Here is Roster " + Integer.toString(roster_counter) + ": " + entry); }catch (Exception e){ System.out.println(

Cannot send message to openfire server

末鹿安然 提交于 2019-12-11 02:22:23
问题 I am unable to send a message to a XMPP client on an openfire server using SMACK API. I m not sure where i am going wrong. I tested the same code on gtalk and it works fine. public class SenderTest { public static void main(String args[]) { ConnectionConfiguration connConfig = new ConnectionConfiguration("localhost", 5222); connConfig.setSASLAuthenticationEnabled(false); XMPPConnection connection = new XMPPConnection(connConfig); try { connection.connect(); System.out.println("Connected to "

ejabberd connection using Smack in android giving connection timed out error

。_饼干妹妹 提交于 2019-12-11 01:07:33
问题 Hello we have downloaded the ejabberd from this. domain is localhost and we have set the xmppDomain as my computer's ip address. I have used the following code for connection public static final String XMPP_DOMAIN = "localhost"; public static final String XMPP_HOST = "10.0.2.2";//kept for emaulator //public static final String XMPP_HOST = "192.168.1.152"; //ip of my pc public static final int XMPP_PORT = 5222; public static final String XMPP_RESOURCE = "xmppdemo"; public static final boolean

facing problem using smack on android

為{幸葍}努か 提交于 2019-12-10 19:47:57
问题 I have a button in Android Application. When the button is clicked following code is invoked: TestSmack a = new TestSmack(); a.login("abc@gmai.com","password"); I have a TestSmack class.....in the constructor of this class i wrote public TestSmack () { ConnectionConfiguration connConfig = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com"); connection = new XMPPConnection(connConfig); } where XMPPConnection connection is a global variable. And in the login method I try to

GCM using smack library NoResponseException: No response received within reply timeout

蹲街弑〆低调 提交于 2019-12-10 18:44:27
问题 I am new to gcm and I tried to connect to Cloud Connection Server(XMPP) of GCM using Smack API. It was alright at the start, My code: uid = "123456789"; apiKey = "A**************B"; XMPPTCPConnectionConfiguration.Builder config; config.setSocketFactory(SSLSocketFactory.getDefault()); config = XMPPTCPConnectionConfiguration.builder(); config.setUsernameAndPassword(uid,apiKey); config.setServiceName("gcm.googleapis.com"); config.setHost("gcm.googleapis.com"); config.setPort(5235); config

smack presence listener in multi user chat

空扰寡人 提交于 2019-12-10 18:25:19
问题 smack presence listener in multi user chat not getting called. Used Smack Api to login and then added roster.addRosterListener(mRoasterListener); but could not get any success to listen when presence of other user of the chat room changes. I tried following code to get the presence listener to work : connection.login(loginUser, passwordUser); MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection); muc = manager.getMultiUserChat(roomID + "@" +context.getString(R.string

how to differentiate received messages between users using smack and java?

守給你的承諾、 提交于 2019-12-10 17:14:48
问题 I am using servlets to send & receive chat messages to facebook using smack . In that user's "A" & "B" are chating with user "C". If user "C" send's message only to "A" ,that message also received by "B". How to differenciate the messages between users? finally my problem is ,to whom the message is cmg from facebook. By using below code to get messages: public void processMessage(Chat chat, Message message) { if ((message != null) && (message.getBody() != null)) { System.out.println(chat

smack api get all public rooms on openfire server

时光怂恿深爱的人放手 提交于 2019-12-10 15:54:26
问题 I am using the XMPP smack api to connect to an Openfire server. I am trying to query the server to return all public rooms available without knowing this names of the rooms in advance. The goal of this is so that my client can display a list of all public rooms available and join them accordingly. The Smack Extensions Documentation provides several examples of returning room information from the server however none of them seem to fit my need. One example requires you to know the name of the

How to Integrate FCM with Ejabberd?

瘦欲@ 提交于 2019-12-10 15:39:34
问题 Environment: Ejabberd Version : 16.04 Smack-android-4.1.0 I have created an Android chat application with a XMPP server. However due to Google play permission issue I had to narrow down the feature from app which supported receiving incoming message notifications when the app is in the background. As an alternative I received the following suggestion from GooglePlay Review Team. Once you’ve removed this permission, you might consider using Firebase Cloud Messaging (FCM) if your app’s message

Enable stream management xmpp connection smack 4.1

时光毁灭记忆、已成空白 提交于 2019-12-10 11:26:35
问题 I tried enabling stream management(XEP-0198) by this piece of code XMPPTCPConnectionConfiguration connConfig = XMPPTCPConnectionConfiguration.builder().setHost(HOST) .setPort(PORT).setDebuggerEnabled(true).setSecurityMode(SecurityMode.disabled) .setUsernameAndPassword(USERNAME, PASSWORD).setServiceName(SERVICE).build(); XMPPTCPConnectionconnection = new XMPPTCPConnection(connConfig); connection.setPacketReplyTimeout(TIME_OUT); connection.connect(); connection.login(); connection