开发者

Android Smack chat client

Hi freinds I an using Smack3.2.1.jar downloaded from following url

http://www.igniterealtime.org/downloads/index.jsp

I added jar to my buildpath But when I run the application I get the following Error log

10-12 13:11:59.464: ERROR/AndroidRuntime(1957): FATAL EXCEPTION: main
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): java.lang.VerifyError: org.jivesoftware.smack.sasl.SASLMechanism
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at java.lang.Class.getDeclaredConstructors(Native Method)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at java.lang.Class.getConstructor(Class.java:477)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:314)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at org.jivesoftware.smack.Connection.login(Connection.java:348)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at org.apache.android.xmpp.SettingsDialog.onClick(SettingsDialog.java:54)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at android.view.View.performClick(View.java:2408)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at android.view.View$PerformClick.run(View.java:8816)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at android.os.Handler.handleCallback(Handler.java:587)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at android.os.Handler.dispatchMessage(Handler.java:92)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at android.os.Looper.loop(Looper.java:123)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at android.app.ActivityThread.main(ActivityThread.java:4627)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at java.lang.reflect.Method.invokeNative(Native Method)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at java.lang.reflect.Method.invoke(Method.java:521)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at com.android.in开发者_StackOverflow社区ternal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957):     at dalvik.system.NativeStart.main(Native Method)

Can anyone help ...


Smack doesn't work on android out of the box, you may want to use aSmack (http://code.google.com/p/asmack/) which is a port of smack for Android.


Finally I got the Concrete implementation

Anyone who want to develop chat client then follow the steps mentioned below.

Go to link

http://www.beem-project.com/projects/beem/files

Download

asmack-android-7-source-beem.zip

Now modify this source as per your requirement.

You will find the lib asmack-android-7-beem.jar to obtain javadoc for this lib its same as javadoc for smack what i did is as follows.

Download source smack-3.2.1 from link below

http://www.igniterealtime.org/downloads/index.jsp

When you extract the jar you will get the folder named javadoc now just attach this folder to asmack-android-7-beem.jar by going to the properties of your project.

Hip Hip Hurray....


You can't use vanilla Smack prior Smack 4 on Android. Have a look at "Android and XMPP: Currently available solutions"


use dependencies inject this in your build.gradle

 compile 'org.igniterealtime.smack:smack-android:4.1.6'
    compile 'org.igniterealtime.smack:smack-tcp:4.1.6'
    compile 'org.igniterealtime.smack:smack-im:4.1.6'
    compile 'org.igniterealtime.smack:smack-extensions:4.1.6'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜