Skip to content

Smack 4.3 Readme and Upgrade Guide

Florian Schmaus edited this page Aug 7, 2018 · 7 revisions

The full list of fixed issue and improvements can be found in the Ignite's JIRA.

Notable changes and important new features

Minimum required Android SDK level raised to 9 (Gingerbread).

API Changes

  • Renamed XMPPError to StanzaError
  • toXml() now takes a String argument
  • Changed type of FormField values from String to CharSequence

Warning: This list may not be complete

Further API additions/changes/removals and improvements

Including Smack 4.3 into your project

Smack 4.3 provides two artifacts as entry points that you can refer to when including Smack in your project: smack-java7 and smack-android. A typical Smack setup may also want to declare additional dependencies on smack-tcp, smack-extensions and smack-experimental

Projects that target a JVM supporting Java7

With Gradle

repositories {
  maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots'
  }
  mavenCentral()
}
dependencies {
   compile "org.igniterealtime.smack:smack-java7:4.3.0"
   // Optional for XMPPTCPConnection
   compile "org.igniterealtime.smack:smack-tcp:4.3.0"
   // Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …)
   compile "org.igniterealtime.smack:smack-im:4.3.0"
   // Optional for XMPP extensions support
   compile "org.igniterealtime.smack:smack-extensions:4.3.0"
}

With Maven

<dependency>
        <groupId>org.igniterealtime.smack</groupId>
        <artifactId>smack-java7</artifactId>
        <version>4.3.0</version>
</dependency>
<dependency>
        <groupId>org.igniterealtime.smack</groupId>
        <artifactId>smack-tcp</artifactId>
        <version>4.3.0</version>
</dependency>
<dependency>
        <groupId>org.igniterealtime.smack</groupId>
        <artifactId>smack-im</artifactId>
        <version>4.3.0</version>
</dependency>
<dependency>
        <groupId>org.igniterealtime.smack</groupId>
        <artifactId>smack-extensions</artifactId>
        <version>4.3.0</version>
</dependency>

With Ivy

<dependency org="org.igniterealtime.smack" name="smack-java7" rev="4.3.0"/>
<dependency org="org.igniterealtime.smack" name="smack-tcp" rev="4.3.0"/>
<dependency org="org.igniterealtime.smack" name="smack-extensions" rev="4.3.0"/>

Projects that target Android

With Gradle

repositories {
  maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots'
  }
  mavenCentral()
}

Smack configuration with smack-extensions for XMPP over TCP

dependencies {
  compile "org.igniterealtime.smack:smack-android-extensions:4.3.0"
  compile "org.igniterealtime.smack:smack-tcp:4.3.0"
}

configurations {
	all*.exclude group: 'xpp3', module: 'xpp3'
}

Minimal Smack configuration for XMPP over TCP

dependencies {
  compile "org.igniterealtime.smack:smack-android:4.3.0"
  compile "org.igniterealtime.smack:smack-tcp:4.3.0"
}

configurations {
	all*.exclude group: 'xpp3', module: 'xpp3'
}

Smack configuration with experimental extensions (XEP-0280, XEP-0352, XEP-0332, XEP-0335)

dependencies {
  compile "org.igniterealtime.smack:smack-android-extensions:4.3.0"
  compile "org.igniterealtime.smack:smack-experimental:4.3.0"
  compile "org.igniterealtime.smack:smack-tcp:4.3.0"
}

configurations {
	all*.exclude group: 'xpp3', module: 'xpp3'
}

Using Eclipse's Android Development Tools (ADT) Ant based build

We recommend using the MavenToAndroidAnt Python3 script to fetch the required artifacts from maven central. Use the following artifact definition file

smackVersion=4.3.0
jxmppVersion=0.6.2
minidnsVersion=0.3.2
bouncycastleVersion=1.59
org.igniterealtime.smack,smack-android,$smackVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.igniterealtime.smack,smack-android-extensions,$smackVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.igniterealtime.smack,smack-core,$smackVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.igniterealtime.smack,smack-im,$smackVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.igniterealtime.smack,smack-tcp,$smackVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.igniterealtime.smack,smack-extensions,$smackVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.igniterealtime.smack,smack-experimental,$smackVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.igniterealtime.smack,smack-resolver-minidns,$smackVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.igniterealtime.smack,smack-sasl-provided,$smackVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.jxmpp,jxmpp-core,$jxmppVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.jxmpp,jxmpp-util-cache,$jxmppVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.jxmpp,jxmpp-jid,$jxmppVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.minidns,minidns-core,$minidnsVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.minidns,minidns-client,$minidnsVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.minidns,minidns-android21,$minidnsVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.minidns,minidns-iterative-resolver,$minidnsVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.minidns,minidns-dnssec,$minidnsVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.minidns,minidns-hla,$minidnsVersion,1357B01865B2503C18453D208CAC2A9678548E35
org.bouncycastle,bcprov-jdk15on,$bouncycastleVersion,08F0AAB4D0C1A4BDDE340765B341DDB020FCB6AB

and save it as artifacts.csv. Now run

getMavenArtifactsNg.py -f artifacts.csv -p <projectdir>

to let the script download and install the artifacts into your Android Ant project.

What to do if there are any issues with this Smack version?

Please have a look at

https://github.com/igniterealtime/Smack/wiki/How-to-ask-for-help,-report-an-issue-and-possible-solve-the-problem-yourself

Please report bugs in the "Smack Developers" forum. The IRC channel #smack on freenode can be used to discuss Smack and to ask for help.

Clone this wiki locally