asmack

(a)Smack returns “service-unavailable (503)” error at login()

混江龙づ霸主 提交于 2019-12-07 05:09:38
问题 I'm trying to implement a simple jabber messenger on Android using asmack library. Here's the code: public boolean login() { if (connection != null && connection.isConnected()) { Log.i("XMPP", connection.getHost()); try { connection.login(USERNAME, PASSWORD); } catch (XMPPException e) { e.printStackTrace(); return false; } return true; } return false; } Exception I get after connection.login() (connection looks fine): service-unavailable(503) at org.jivesoftware.smack.NonSASLAuthentication

Check if a user exist on server in XMPP with (a)smack

你。 提交于 2019-12-07 02:51:47
问题 I'm working on a chat application using asmack as a library and on android platform. Is there is any way that before adding friend in Roster can I check that friend exist on server or not? 回答1: I Found the answer : UserSearchManager search = new UserSearchManager(mXMPPConnection); Form searchForm = search .getSearchForm("search." + mXMPPConnection.getServiceName()); Form answerForm = searchForm.createAnswerForm(); answerForm.setAnswer("Username", true); answerForm.setAnswer("search", user);

SImple Asmack program not working

无人久伴 提交于 2019-12-06 14:53:26
Simplest possible code: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); SmackAndroid.init(this); // Create a connection to the jabber.org server. XMPPTCPConnection conn1 = new XMPPTCPConnection("xmpp-hosting.de"); try { conn1.connect(); } catch (SmackException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (XMPPException e) { // TODO Auto-generated catch block e.printStackTrace(); } Log.d(TAG, "Connected

NoSuchAlgorithmException when using aSmack 0.8.3 for XMPP chat application

回眸只為那壹抹淺笑 提交于 2019-12-06 09:40:33
I have included the logcat output. Please help me resolve this issue. 08-09 11:06:32.762: WARN/NetworkManagementSocketTagger(883): setKernelCountSet(10012, 0) failed with errno -2 08-09 11:06:32.856: WARN/System.err(1567): java.security.KeyStoreException: ava.security.NoSuchAlgorithmException: KeyStore jks implementation not found 08-09 11:06:32.856: WARN/System.err(1567): at java.security.KeyStore.getInstance(KeyStore.java:119) 08-09 11:06:32.856: WARN/System.err(1567): at org.jivesoftware.smack.ServerTrustManager.(ServerTrustManager.java:70) 08-09 11:06:32.856: WARN/System.err(1567): at org

How to parse a CustomIQ in ASMACK

空扰寡人 提交于 2019-12-06 07:48:41
I am using ASMACK library fo my application. I received the following IQ from my server. <iq id='bind_2' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid username='xx' fullname='yy'>xx@aa.bb.cc.dd/Resource</jid></bind></iq> For parsing this IQ, I added the IQProvider while setting XmppConnection configuration by using ProviderManager class as ProviderManager.getInstance().addIQProvider("bind", "urn:ietf:params:xml:ns:xmpp-bind", new CustomIQProvider()); And my CustomIQProvider class is public class CustomIQProvider implements IQProvider { public static final String NAME_SPACE

Retrieving offline messages using asmack

ⅰ亾dé卋堺 提交于 2019-12-06 06:54:38
问题 I'm new to asmack and openfire, looked a lot for a working answer to this but couldn't find it anywhere. How do I retrieve offline messages on Logging into my account on asmack? I've used the following code: configure(ProviderManager.getInstance()); //configuring providers before creating a connection ConnectionConfiguration connConfig = new ConnectionConfiguration(HOST, PORT); connConfig.setSendPresence(false); connection = new XMPPConnection (connConfig); try { connection.connect(); } catch

Delivery receipt requests not working for XMPP Android (aSmack)

感情迁移 提交于 2019-12-06 06:24:44
问题 I'm using OpenFire with aSmack. I can't seem to get DeliveryReceipts working. I do the following when I create a connection: //create connection connection.login(username, password); DeliveryReceiptManager.getInstanceFor(connection).enableAutoReceipts(); DeliveryReceiptManager.getInstanceFor(connection).addReceiptReceivedListener(new ReceiptReceivedListener() { @Override public void onReceiptReceived(String arg0, String arg1, String arg2) { Log.v("app", arg0 + ", " + arg1 + ", " + arg2); } })

How to create Group in aSmack xmpp in android ?

北城以北 提交于 2019-12-06 06:13:11
I am getting class cast exception while creating muc in android. E/AndroidRuntime(31002): Caused by: java.lang.ClassCastException: org.jivesoftware.smack.packet.DefaultPacketExtension E/AndroidRuntime(31002): at org.jivesoftware.smackx.muc.MultiUserChat.getMUCUserExtension(MultiUserChat.java:2000) E/AndroidRuntime(31002): at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:364) You can create user Group by , public boolean createGroup(XMPPConnection connection,String groupName) { if (connection == null) return false; try { connection.getRoster().createGroup(groupName); Log.v

aSmack as a service

泄露秘密 提交于 2019-12-05 11:37:01
Basically I have a Main class running the entire project. The code is working perfectly although once the App is unfocused it becomes inactive. I was wondering how I would go about making it a service. One that would startup at boot. The app will be a one way message system for notifications. I.E. Desktop Client -> Openfire Server -> Android XMPP Service -> Storage (DB) -> Android GUI for display As I've said, the Code is working (Connect, Login, Receive) but isn't a service. I could use the BEEM source but it's too featured and interlaced. I'm after a lightweight service. The code: public

(a)Smack returns “service-unavailable (503)” error at login()

若如初见. 提交于 2019-12-05 10:08:40
I'm trying to implement a simple jabber messenger on Android using asmack library. Here's the code: public boolean login() { if (connection != null && connection.isConnected()) { Log.i("XMPP", connection.getHost()); try { connection.login(USERNAME, PASSWORD); } catch (XMPPException e) { e.printStackTrace(); return false; } return true; } return false; } Exception I get after connection.login() (connection looks fine): service-unavailable(503) at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication.java:77) at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection