### Build Smack on Linux Source: https://github.com/igniterealtime/smack/blob/master/DEVELOPING.md Clone the Smack repository and build using Gradle. Assumes Git and Gradle are installed. ```bash git clone git@github.com:igniterealtime/Smack.git cd Smack gradle assemble ``` -------------------------------- ### Minimal Smack Configuration for XMPP over TCP Source: https://github.com/igniterealtime/smack/wiki/Smack-4.4-Readme-and-Upgrade-Guide Use this configuration for a basic Smack setup over TCP. Ensure to exclude 'xpp3' modules. ```groovy dependencies { implementation "org.igniterealtime.smack:smack-android:4.4.0" implementation "org.igniterealtime.smack:smack-tcp:4.4.0" } configurations { all*.exclude group: 'xpp3', module: 'xpp3' all*.exclude group: 'xpp3', module: 'xpp3_min' } ``` -------------------------------- ### Access Account Manager Source: https://github.com/igniterealtime/smack/wiki/Smack-4.0-Readme-and-Upgrade-Guide Demonstrates how to get an instance of the AccountManager in Smack 4.0. ```java AccountManager.getInstance(XMPPConnection) ``` -------------------------------- ### Smack Unit Testing Setup Source: https://github.com/igniterealtime/smack/wiki/Guidelines-for-Smack-Developers-and-Contributors Extend SmackTestCase to create unit tests for Smack. This provides a pre-configured execution context for tests involving XMPP connections. ```java public class ExampleTest extends SmackTestCase { public ExampleTest(String arg0) { super(arg0); } public void testSomething() { Connection initiator = getConnection(0); Connection target = getConnection(1); // send some packets between connections ... // verify ... } } ``` -------------------------------- ### Minimal Smack configuration for Android with TCP using Gradle Source: https://github.com/igniterealtime/smack/wiki/Smack-4.3-Readme-and-Upgrade-Guide Configure a minimal Smack setup for Android projects using Gradle, including the core Android and TCP modules. Excludes the xpp3 module. ```groovy 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' } ``` -------------------------------- ### Java Brace Style Example Source: https://github.com/igniterealtime/smack/wiki/Guidelines-for-Smack-Developers-and-Contributors Illustrates the Smack convention for brace placement: opening braces on the same line as the declaration and closing braces on a new, indented line. Also shows that all code blocks must be enclosed by braces. ```java void bar(List v) { for (int i = 0; i < 10; i++) { v.add(new Integer(i)); } } ``` -------------------------------- ### Test Smack Build Script Compilation Source: https://github.com/igniterealtime/smack/blob/master/resources/README.html Invoke the build tool to compile the Smack source code. This confirms your Gradle setup is correct. ```bash gradle build ``` -------------------------------- ### Java Code Indentation Example Source: https://github.com/igniterealtime/smack/wiki/Guidelines-for-Smack-Developers-and-Contributors Demonstrates the recommended 4-space indentation for Java code in Smack, including class, member, method, enum, and annotation declarations. ```java /** * Indentation */ class Example { int[] myArray = { 1, 2, 3, 4, 5, 6 }; int theInt = 1; String someString = "Hello"; double aDouble = 3.0; void foo(int a, int b, int c, int d, int e, int f) { switch (a) { case 0: Other.doFoo(); break; default: Other.doBaz(); } } void bar(List v) { for (int i = 0; i < 10; i++) { v.add(new Integer(i)); } } } enum MyEnum { UNDEFINED(0) { void foo() { } } } @interface MyAnnotation { int count() default 1; } ``` -------------------------------- ### Fetching Maven Artifacts for Android Ant Project Source: https://github.com/igniterealtime/smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide Use this command with the artifacts.csv file to download and install necessary Smack artifacts into your Android Ant project. ```bash getMavenArtifactsNg.py -f artifacts.csv -p ``` -------------------------------- ### Java New Line Conventions Example Source: https://github.com/igniterealtime/smack/wiki/Guidelines-for-Smack-Developers-and-Contributors Shows the Smack convention of placing new lines before 'do-while', 'try-catch', 'try-finally', and 'else if' statements, and also for 'if' statements containing a single statement. ```java /** * If...else */ class Example { void bar() { do { // do something } while (true); try { // do something } catch (Exception e) { // exception handling } finally { // cleanup } } void foo2() { if (true) { return; } if (true) { return; } else if (false) { return; } else { return; } } void foo(int state) { if (true) { return; } if (true) { return; } else if (false) { return; ``` -------------------------------- ### Gradle Dependencies for Android Minimal TCP Source: https://github.com/igniterealtime/smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide Configure Gradle for Android projects with a minimal Smack setup for XMPP over TCP. Requires a snapshot repository. ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } mavenCentral() } dependencies { compile "org.igniterealtime.smack:smack-android:4.2.0" compile "org.igniterealtime.smack:smack-tcp:4.2.0" } ``` -------------------------------- ### Build Smack on Windows Source: https://github.com/igniterealtime/smack/blob/master/DEVELOPING.md Enable case-sensitivity for a specific directory using fsutil and then clone the repository and build using Gradle. Requires Windows 10 v1803 or higher. ```batch fsutil.exe file SetCaseSensitiveInfo C:\git\Smack enable cd \git\Smack git clone git@github.com:igniterealtime/Smack.git cd Smack gradle assemble ``` -------------------------------- ### Display All Smack Projects Source: https://github.com/igniterealtime/smack/blob/master/resources/README.html Shows a list of all Smack projects along with their descriptions. ```bash gradle projects ``` -------------------------------- ### Smack Configuration with Experimental Extensions Source: https://github.com/igniterealtime/smack/wiki/Smack-4.4-Readme-and-Upgrade-Guide Configure Smack to include experimental extensions for features like XEP-0280. Excludes 'xpp3' modules. ```groovy dependencies { implementation "org.igniterealtime.smack:smack-android-extensions:4.4.0" implementation "org.igniterealtime.smack:smack-experimental:4.4.0" implementation "org.igniterealtime.smack:smack-tcp:4.4.0" } configurations { all*.exclude group: 'xpp3', module: 'xpp3' all*.exclude group: 'xpp3', module: 'xpp3_min' } ``` -------------------------------- ### Build Smack on macOS Source: https://github.com/igniterealtime/smack/blob/master/DEVELOPING.md Create a case-sensitive APFS volume and then clone the repository and build using Gradle. This is necessary because macOS is case-insensitive by default. ```bash cd /Volumes/Smack git clone git@github.com:igniterealtime/Smack.git cd Smack gradle assemble ``` -------------------------------- ### Parse XMPP Stanza Extension Element Source: https://github.com/igniterealtime/smack/blob/master/DEVELOPING.md Example of a Java provider for parsing a custom XMPP stanza extension element. It demonstrates attribute and sub-element parsing using XmlPullParser. ```java public MyExtension parse(XmlPullParser parser, int initialDepth) { MyElement myElement = null; MyInfo myInfo = null; String attrFoo = parser.getAttributeValue("", "attrFoo"); outerloop: while(true) { XmlPullParser.Event event = parser.next(); switch (event) { case START_ELEMENT: String name = parser.getName(); switch(name) { case "myElement": myElement = new MyElement(parser.nextText()); break; case "myInfo"; boolenan alpha = ParserUtils.getBooleanAttribute(parser, "alpha"); int delta = ParserUtils.getIntegerAttribute(parser, "delta"); myInfo = new MyInfo(alpha, delta); break; } break; case END_ELEMENT: if (parser.getDepth() == initialDepth) { break outerloop; } break; default: break; } } return new MyExtension(attrFoo, myElement, myInfo); } ``` -------------------------------- ### Configure Maven Central for Smack Snapshots Source: https://github.com/igniterealtime/smack/wiki/How-to-use-Smack-snapshots Add the Sonatype snapshots repository to your build configuration to access Smack snapshot artifacts. ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } } smackVersion = '4.2.2-SNAPSHOT' ``` -------------------------------- ### Artifact Definition for MavenToAndroidAnt Script Source: https://github.com/igniterealtime/smack/wiki/Smack-4.3-Readme-and-Upgrade-Guide This CSV file defines the artifacts and their versions required for Smack 4.3 and its dependencies. It's used with the MavenToAndroidAnt script to fetch and install these artifacts into an Android Ant project. ```csv 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 ``` -------------------------------- ### Smack Configuration with Experimental Extensions (Gradle) Source: https://github.com/igniterealtime/smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide Add these dependencies to your Gradle build file to include Smack with experimental extensions for XEP-0280, XEP-0352, XEP-0332, and XEP-0335. ```groovy dependencies { compile "org.igniterealtime.smack:smack-android-extensions:4.2.0" compile "org.igniterealtime.smack:smack-experimental:4.2.0" compile "org.igniterealtime.smack:smack-tcp:4.2.0" } ``` -------------------------------- ### Send a Text Message with Smack Source: https://github.com/igniterealtime/smack/blob/master/resources/javadoc-overview.html This snippet demonstrates how to establish a connection, log in, build and send a simple text message, and then disconnect. Ensure you have the necessary Smack modules and connection details. ```java AbstractXMPPConnection connection = new XMPPTCPConnection("mtucker", "password", "jabber.org"); connection.connect().login(); Message message = connection.getStanzaFactory() .buildMessageStanza() .to("jsmith@igniterealtime.org") .setBody("Howdy! How are you?") .build(); connection.sendStanza(message); connection.disconnect(); ``` -------------------------------- ### Smack Configuration with Experimental Extensions Source: https://github.com/igniterealtime/smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide Configure Smack with experimental extensions for advanced XMPP features like XEP-0280, XEP-0352, XEP-0332, and XEP-0335. ```groovy dependencies { compile "org.igniterealtime.smack:smack-android-extensions:4.1.0" compile "org.igniterealtime.smack:smack-experimental:4.1.0" compile "org.igniterealtime.smack:smack-tcp:4.1.0" } ``` -------------------------------- ### Commit, Tag, and Publish Smack Release Source: https://github.com/igniterealtime/smack/wiki/Release-Checklist Use this command to commit changes, tag the release, and publish the build artifacts. Ensure all pre-release checks are completed before execution. ```bash export SMACK_VERSION=$(cat version) git commit -a -m "Smack ${SMACK_VERSION}" \ && git tag -s "${SMACK_VERSION}" -m "Smack ${SMACK_VERSION}" \ && gradle --no-parallel publish install ``` -------------------------------- ### Create Follow-up Commit After Release Source: https://github.com/igniterealtime/smack/wiki/Release-Checklist After a successful release, update the version file and create a new commit for subsequent development. This prepares the project for the next iteration. ```bash export SMACK_VERSION=$(cat version) git commit -a -m "Smack $SMACK_VERSION" ``` -------------------------------- ### Move Provider and Package Classes Source: https://github.com/igniterealtime/smack/wiki/Smack-4.0-Readme-and-Upgrade-Guide Commands to update package references for provider and package classes after migrating to Smack 4.0. ```bash find -type f -name "*.java" |xargs sed -i 's;smackx.ServiceDiscoveryManager;smackx.disco.ServiceDiscoveryManager;' ``` ```bash find -type f -name "*.java" |xargs sed -i 's;smackx.packet.VCard;smackx.vcardtemp.packet.VCard;' ``` -------------------------------- ### Smack configuration for Android with extensions and TCP using Gradle Source: https://github.com/igniterealtime/smack/wiki/Smack-4.3-Readme-and-Upgrade-Guide Configure Smack for Android projects using Gradle, including the extensions and TCP modules. Excludes the xpp3 module. ```groovy 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' } ``` -------------------------------- ### Gradle Dependencies for Android with Extensions Source: https://github.com/igniterealtime/smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide Configure Gradle for Android projects, including Smack extensions for XMPP over TCP. Requires a snapshot repository. ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } mavenCentral() } dependencies { compile "org.igniterealtime.smack:smack-android-extensions:4.2.0" compile "org.igniterealtime.smack:smack-tcp:4.2.0" } ``` -------------------------------- ### Smack Configuration with Smack-Extensions for XMPP over TCP Source: https://github.com/igniterealtime/smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide Include this configuration to enable XMPP over TCP with standard extensions. ```groovy dependencies { compile "org.igniterealtime.smack:smack-android-extensions:4.1.0" compile "org.igniterealtime.smack:smack-tcp:4.1.0" } ``` -------------------------------- ### Gradle Dependencies for Android with Extensions Source: https://github.com/igniterealtime/smack/wiki/Smack-4.4-Readme-and-Upgrade-Guide Configure Gradle for Android projects using Smack extensions and XMPP over TCP. Includes dependency exclusions for xpp3. ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } mavenCentral() } dependencies { implementation "org.igniterealtime.smack:smack-android-extensions:4.4.0" implementation "org.igniterealtime.smack:smack-tcp:4.4.0" } configurations { all*.exclude group: 'xpp3', module: 'xpp3' all*.exclude group: 'xpp3', module: 'xpp3_min' } ``` -------------------------------- ### Gradle Repositories for Smack 4.1 (Android) Source: https://github.com/igniterealtime/smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide Configure repositories for Smack 4.1 Android projects using Gradle. Includes Sonatype snapshots and Maven Central. ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } mavenCentral() } ``` -------------------------------- ### License Header for Files Source: https://github.com/igniterealtime/smack/wiki/Guidelines-for-Smack-Developers-and-Contributors Provides the standard Apache License 2.0 header required at the beginning of each file in the Smack project. ```java /** * * Copyright XXXX Your Name * * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ ``` -------------------------------- ### Android Smack Initialization Source: https://github.com/igniterealtime/smack/wiki/Smack-4.4-Readme-and-Upgrade-Guide Initialize Smack for Android projects. This must be called once. ```java AndroidSmackInitializer.initialize(Context); ``` -------------------------------- ### Set Password for MUC Enter Configuration Source: https://github.com/igniterealtime/smack/wiki/MUC-API-Redesign Provide the password if the MUC requires authentication. This should be a String representing the password. ```java builder.setPassword(String) ``` -------------------------------- ### Smack 4.3 Dependencies with Experimental Extensions Source: https://github.com/igniterealtime/smack/wiki/Smack-4.3-Readme-and-Upgrade-Guide Add these dependencies to your build.gradle file to include Smack 4.3 with experimental extensions like XEP-0280, XEP-0352, XEP-0332, and XEP-0335. Excludes xpp3 to avoid conflicts. ```groovy 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' } ``` -------------------------------- ### Exception Handling: Wrapping Exceptions Source: https://github.com/igniterealtime/smack/wiki/Guidelines-for-Smack-Developers-and-Contributors Demonstrates how to wrap caught exceptions into a SmackException when the method does not declare specific subtypes of XMPPException. ```java try { ... } catch (TimeoutException e) { throw new SmackException("something went wrong", e); } ``` -------------------------------- ### Implement static from(Stanza) for ExtensionElement Source: https://github.com/igniterealtime/smack/blob/master/DEVELOPING.md Every ExtensionElement class must implement a static from() method to retrieve the extension from a given Stanza. Specify the parameter type if the extension is only found in a particular stanza type. ```java public static RSMSet from(Stanza) { return packet.getExtension(ELEMENT, NAMESPACE); } ``` -------------------------------- ### Control Flow: Early Return Pattern Source: https://github.com/igniterealtime/smack/wiki/Guidelines-for-Smack-Developers-and-Contributors Shows how to use an early return statement to simplify conditional logic, avoiding deeply nested blocks. ```java public void ... { ... if (!condition) { return; } // long block of code } ``` -------------------------------- ### Minimal Smack Configuration for XMPP over TCP Source: https://github.com/igniterealtime/smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide This minimal configuration is for basic XMPP over TCP functionality. ```groovy dependencies { compile "org.igniterealtime.smack:smack-android:4.1.0" compile "org.igniterealtime.smack:smack-tcp:4.1.0" } ``` -------------------------------- ### Generate Javadocs for Smack Source Code Source: https://github.com/igniterealtime/smack/blob/master/resources/README.html Generates JavaDocs for all Smack source code and saves them in the build/javadoc directory. ```bash gradle javadocAll ``` -------------------------------- ### Include Smack 4.3 for Java 7+ with Gradle Source: https://github.com/igniterealtime/smack/wiki/Smack-4.3-Readme-and-Upgrade-Guide Declare Smack 4.3 dependencies for JVM projects targeting Java 7 or higher using Gradle. Includes core, TCP, IM, and extensions artifacts. ```groovy 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" } ``` -------------------------------- ### Generate Eclipse Configuration Files Source: https://github.com/igniterealtime/smack/blob/master/resources/README.html Generates Eclipse configuration files for all projects. It is recommended to also call the 'build' target when generating these files. ```bash gradle eclipse ``` -------------------------------- ### Gradle Dependencies for Java 7 Projects Source: https://github.com/igniterealtime/smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide Declare Smack 4.2 dependencies for projects targeting Java 7 using Gradle. Includes core, TCP, IM, and extensions artifacts. ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } mavenCentral() } dependencies { compile "org.igniterealtime.smack:smack-java7:4.2.0" // Optional for XMPPTCPConnection compile "org.igniterealtime.smack:smack-tcp:4.2.0" // Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …) compile "org.igniterealtime.smack:smack-im:4.2.0" // Optional for XMPP extensions support compile "org.igniterealtime.smack:smack-extensions:4.2.0" } ``` -------------------------------- ### Gradle Dependencies for Smack 4.1 (Java 7) Source: https://github.com/igniterealtime/smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide Declare Smack 4.1 dependencies for Java 7 projects using Gradle. Includes core, TCP, IM, and extensions artifacts. ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } mavenCentral() } dependencies { compile "org.igniterealtime.smack:smack-java7:4.1.0" // Optional for XMPPTCPConnection compile "org.igniterealtime.smack:smack-tcp:4.1.0" // Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …) compile "org.igniterealtime.smack:smack-im:4.1.0" // Optional for XMPP extensions support compile "org.igniterealtime.smack:smack-extensions:4.1.0" } ``` -------------------------------- ### Gradle Dependencies for Java 8 Projects Source: https://github.com/igniterealtime/smack/wiki/Smack-4.4-Readme-and-Upgrade-Guide Declare Smack Java 8 dependencies using Gradle. Includes optional dependencies for XMPP over TCP, IM support, and extensions. ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } mavenCentral() } dependencies { implementation "org.igniterealtime.smack:smack-java8:4.4.0" // Optional for XMPPTCPConnection implementation "org.igniterealtime.smack:smack-tcp:4.4.0" // Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …) implementation "org.igniterealtime.smack:smack-im:4.4.0" // Optional for XMPP extensions support implementation "org.igniterealtime.smack:smack-extensions:4.4.0" } ``` -------------------------------- ### Configure Ignite Realtime Maven Repository for Unique Snapshots Source: https://github.com/igniterealtime/smack/wiki/How-to-use-Smack-snapshots Add the Ignite Realtime Maven Repository to your build configuration for unique snapshot artifacts. ```groovy repositories { maven { url 'http://igniterealtime.org/repo/' } } ``` -------------------------------- ### Update AccountManager Import for Smack 4.1 Source: https://github.com/igniterealtime/smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide The AccountManager class has moved to smackx. Use this sed command to update your source code imports. ```bash find . -type f -name '*.java' |xargs sed -i 's/import org.jivesoftware.smack.AccountManager;/import org.jivesoftware.smackx.iqregister.AccountManager;/' ``` -------------------------------- ### Include Smack 4.3 for Java 7+ with Maven Source: https://github.com/igniterealtime/smack/wiki/Smack-4.3-Readme-and-Upgrade-Guide Declare Smack 4.3 dependencies for JVM projects targeting Java 7 or higher using Maven. Includes core, TCP, IM, and extensions artifacts. ```xml org.igniterealtime.smack smack-java7 4.3.0 org.igniterealtime.smack smack-tcp 4.3.0 org.igniterealtime.smack smack-im 4.3.0 org.igniterealtime.smack smack-extensions 4.3.0 ``` -------------------------------- ### Include Smack 4.3 for Java 7+ with Ivy Source: https://github.com/igniterealtime/smack/wiki/Smack-4.3-Readme-and-Upgrade-Guide Declare Smack 4.3 dependencies for JVM projects targeting Java 7 or higher using Ivy. Includes core, TCP, and extensions artifacts. ```xml ``` -------------------------------- ### Maven Dependencies for Smack 4.1 (Java 7) Source: https://github.com/igniterealtime/smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide Declare Smack 4.1 dependencies for Java 7 projects using Maven. Includes core, TCP, IM, and extensions artifacts. ```xml org.igniterealtime.smack smack-java7 4.1.0 org.igniterealtime.smack smack-tcp 4.1.0 org.igniterealtime.smack smack-im 4.1.0 org.igniterealtime.smack smack-extensions 4.1.0 ``` -------------------------------- ### Set Nickname for MUC Enter Configuration Source: https://github.com/igniterealtime/smack/wiki/MUC-API-Redesign Use this to set the desired nickname when entering a MUC. Ensure the nickname is a valid Resourcepart. ```java builder.setNickname(Resourcepart) ``` -------------------------------- ### Maven Dependencies for Java 7 Projects Source: https://github.com/igniterealtime/smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide Declare Smack 4.2 dependencies for projects targeting Java 7 using Maven. Includes core, TCP, IM, and extensions artifacts. ```xml org.igniterealtime.smack smack-java7 4.2.0 org.igniterealtime.smack smack-tcp 4.2.0 org.igniterealtime.smack smack-im 4.2.0 org.igniterealtime.smack smack-extensions 4.2.0 ``` -------------------------------- ### Java Code Commenting Styles Source: https://github.com/igniterealtime/smack/wiki/Guidelines-for-Smack-Developers-and-Contributors Demonstrates the use of documentation comments (/** ... */) for classes, methods, and public fields, and implementation comments (/* ... */ and // ... ) for non-public fields and internal code. ```java /** * Class Example */ public class Example { /** * Foo constant */ public static final String THE_FOO = "FOO"; /* foo */ private String foo; /** * Constructor */ public Example() { // some initialization code } /** * This method does something */ public int doThings() { /* * heavy documentation about lots of * stuff done in this method */ ... if (condition) { return 1; // trailing comment 1 } else { return -1; // trailing comment -1 } } } ``` -------------------------------- ### Artifact Definition for MavenToAndroidAnt Script Source: https://github.com/igniterealtime/smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide This CSV file defines the artifacts and their versions required for integrating Smack into an Android Ant project using the MavenToAndroidAnt script. ```text smackVersion=4.2.0 jxmppVersion=0.5.0 minidnsVersion=0.2.1 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 de.measite.minidns,minidns-core,$minidnsVersion,4677EF84C286721DA33C09C98D2028BA8AF1E192 de.measite.minidns,minidns-iterative-resolver,$minidnsVersion,4677EF84C286721DA33C09C98D2028BA8AF1E192 de.measite.minidns,minidns-dnssec,$minidnsVersion,4677EF84C286721DA33C09C98D2028BA8AF1E192 de.measite.minidns,minidns-hla,$minidnsVersion,4677EF84C286721DA33C09C98D2028BA8AF1E192 ``` -------------------------------- ### Maven Dependencies for Java 8 Projects Source: https://github.com/igniterealtime/smack/wiki/Smack-4.4-Readme-and-Upgrade-Guide Declare Smack Java 8 dependencies using Maven. Includes optional dependencies for XMPP over TCP, IM support, and extensions. ```xml org.igniterealtime.smack smack-java8 4.4.0 org.igniterealtime.smack smack-tcp 4.4.0 org.igniterealtime.smack smack-im 4.4.0 org.igniterealtime.smack smack-extensions 4.4.0 ``` -------------------------------- ### Ivy Dependencies for Smack 4.1 (Java 7) Source: https://github.com/igniterealtime/smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide Declare Smack 4.1 dependencies for Java 7 projects using Ivy. Includes core, TCP, and extensions artifacts. ```xml ``` -------------------------------- ### Variable Naming Conventions Source: https://github.com/igniterealtime/smack/wiki/Guidelines-for-Smack-Developers-and-Contributors Illustrates common short variable names for primitive types and iterators used in loops or conditions. ```java int i; String s; File f; float f; double d; Iterator<...> it ``` -------------------------------- ### Ivy Dependencies for Java 7 Projects Source: https://github.com/igniterealtime/smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide Declare Smack 4.2 dependencies for projects targeting Java 7 using Ivy. Includes core, TCP, and extensions artifacts. ```xml ``` -------------------------------- ### Set Presence for MUC Enter Configuration Source: https://github.com/igniterealtime/smack/wiki/MUC-API-Redesign Specify a custom Presence object to use when joining the MUC. This allows for non-default presence states like 'away' or 'xa'. ```java builder.setPresence(Presence) ``` -------------------------------- ### Ivy Dependencies for Java 8 Projects Source: https://github.com/igniterealtime/smack/wiki/Smack-4.4-Readme-and-Upgrade-Guide Declare Smack Java 8 dependencies using Ivy. Includes optional dependencies for XMPP over TCP and extensions. ```xml ```