smack

Smack 4 throws “SSLHandshakeException: ValidatorException: SunCertPathBuilderException” on connect

▼魔方 西西 提交于 2019-12-06 07:05:44
问题 For integration testing of my xmpp stack I set up a vysper server (0.7) on localhost. Now I want to connect to the server using smack-core and smack-tcp in version 4.0.2. Problem: Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Since the smack 4 api has changed a lot, the examples found so far can not be

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

How to create an account from Smack 4.1

不羁岁月 提交于 2019-12-06 04:12:03
问题 I'm trying to create an account from Smack for Android on jabber.at. Here is my code : XMPPTCPConnectionConfiguration conf= XMPPTCPConnectionConfiguration.builder() .setServiceName("jabber.at") .build(); XMPPTCPConnection connection = new XMPPTCPConnection(conf); connection.addConnectionListener(xmppConnectionListener); connection.connect(); AccountManager accountManager = AccountManager.getInstance(connection); Map<String, String> map = new HashMap<String, String>(); map.put("username", usr)

How to handle add request in smack API

笑着哭i 提交于 2019-12-06 03:53:11
问题 I use Smack API to write my Google talk Client . Now i need to handle add request for this . I set SubscriptionMode to manual & now I have to registering a listener for presence packets but i don't know how !! can any body help ? 回答1: I have not tried it yet, but I guess the below should work. If using the manual mode, a PacketListener should be registered that listens for Presence packets that have a type of Presence.Type.subscribe . First set the roster: Roster roster = connection.getRoster

Send XMPP (Smack) Message

时间秒杀一切 提交于 2019-12-06 03:47:43
Ok, the problem should be trivial but I can't get to the bottom of it. I have two users A & B Their JID's for this example will be A@123 and B@123 where 123 is the IP of the server. I'm sending a message from A->B using the following code: chat = chatmanager.createChat(username, new MessageListener() { public void processMessage(Chat chat, Message message) {}}); String sendUsername = username + "@123"; Message msgObj = new Message(sendUsername, Message.Type.chat); msgObj.setBody(message); chat.sendMessage(msgObj); I've hardcoded the IP so that I'm 100% sure that I attach the "@123" at the end

Connect to Google Talk using smack

╄→гoц情女王★ 提交于 2019-12-06 00:48:14
问题 I want to develop a Java application which connects to Google Talk and allows a user to chat with it's friends. I am using smack API and the fallowing code: ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com",5222,"gmail.com"); SASLAuthentication.supportSASLMechanism("PLAIN", 0); XMPPConnection connection = new XMPPConnection(config); try { connection.connect(); } catch (XMPPException e) { e.printStackTrace(); } try { connection.login("username", "password"); }

Trying to connect to XMPP server with aSmack on Android gets me “no dns resolver active”

家住魔仙堡 提交于 2019-12-05 23:20:08
I made this as simple as I can in code. I am using asmack library for android in version 8-0.8.3. My code: package info.zajacmp3.servercommunication; import org.jivesoftware.smack.Connection; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; import android.app.Service; import android.content.Intent; import android.os.IBinder; public class XmppService extends Service{ public void xmppService() throws XMPPException { Connection conn1 = new XMPPConnection("jabber.org"); conn1.connect(); } @Override public void onCreate(){ //TODO:actions to perform when

Could Not Connect XMPP Server with smack : EOF Exception when implementing GCM XMPP-based App Server

耗尽温柔 提交于 2019-12-05 18:37:29
java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag <stream:stream> from line 1, parser stopped on END_TAG seen ...</mechanisms></stream:features>... @1:344 at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3035) at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046) at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144) at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:279) at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44) at org.jivesoftware.smack

filetransfer in android through xmpp?

﹥>﹥吖頭↗ 提交于 2019-12-05 17:22:43
I am just trying to transfer a file through xmpp.I am using asmack lib.I am getting exception below. E/AndroidRuntime( 332): FATAL EXCEPTION: main E/AndroidRuntime( 332): java.lang.NullPointerException E/AndroidRuntime( 332): at org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager.enableService(Socks5BytestreamManager.java:704) E/AndroidRuntime( 332): at org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager.activate(Socks5BytestreamManager.java:696) E/AndroidRuntime( 332): at org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager.getBytestreamManager

Sending Notification to user when user is offline in android using XMPP

我与影子孤独终老i 提交于 2019-12-05 14:15:53
I implemented an Android chat application using Smack client with XMPP server. Everything works fine when the user is online, now when the user is offline (the app is not in running state). I would like to push notification using GCM. Is there a way to achieve that, and is there a way that we can manage our server itself to take care of that? You can send push notification any time the user is online or not but the device has internet.You have all devices device tokens so when you send a message to a particular user, use his device token and send push notification. I'm facing this problem too