SlideShare a Scribd company logo
A Beginner’s Guide to XMPP 
Soham 
Sengupta 
CEO, Tech IT Easy Lab of Pervasive VM Computing 
+91 9830740684 (sohamsengupta@yahoo.com)
XMPP : what and why? 
 Existing Web Technologies have 2 broad categories 
 Pull (Example HTTP where connection is initiated by Client and 
initial communication is unidirectional (HTTP Request) 
 Push (Where communication is initiated by clients but connection 
is bi-directional, and keeps alive till disconnection or log-out ) 
 Need and utility of (Server) Push: 
 Real time Messaging (IM) like Google Talk, Facebook chat etc 
 Delicate and urgent information like Stocks quotes that need be 
initiated to clients 
 Real time Location tracking 
 News feeds 
 Cricket scores
XMPP a Push Protocol 
 Extensible Messaging and Presence Protocol 
In G-talk you find if the other 
end is typing, entered message 
or her status like busy, idle, 
away etc
Jabber 
 Jabber may refer to: 
 The original name of the Extensible Messaging and 
Presence Protocol (XMPP), the open technology for 
instant messaging and presence. 
 Jabber.org, the public, free instant messaging and 
presence service based on the XMPP protocol. 
 Jabber XCP, a commercial product which is an 
implementation of the XMPP protocol. Acquired 
by Cisco Systems in 2008.
Smack 
1. Smack is an Open Source XMPP (Jabber) client 
library for instant messaging and presence. 
2. A pure Java library 
3. It can be embedded into your applications to create 
anything from a full XMPP client to simple XMPP 
integrations such as sending notification messages 
and presence-enabling devices. 
4. We learn in next slides how to use Smack and 
make a simple Java application client for XMPP
Smack: Getting started 
1. Pre-requites: 
a) Java SE 1.4 or above, SDK, language basics and concept 
b) An active Internet connection 
c) At least two Google accounts 
d) The Jabber Smack API Download Site 
2. Step-1 
a) Have the 2 jar files, 
i. Samck.jar 
ii. Smackx.jar 
that come with the API in your build path (CLASSPATH) 
a) We make sure that the two Google id can chat with each other, 
i.e. they are friend to each other 
b) We make sure we are connected to Internet
Smack Tutorials 
 Some useful terms: 
 Roster 
 A list, especially of names : Dictionary meaning 
 While we chat we refer to our Friends in chat list as Roster 
 Connect to an XMPP Server 
1. 5222: default Port for XMPP (used by most of the providers) 
2. We connect to talk.google.com with our google (gmail) id and 
password
Code Snippets to Connect 
XMPPConnection  The Java type that represents an XMPP connection 
 It needs a ConnectionConfiguration object to set up 
 The configuration object needs host, port and service name 
 connection.connect() connects to the server & no authentication (login) done 
 connection.login(user,password) succeeds on an Active Network if user and 
pasword are valid, else fails
Connection set up continued… 
XMPP Server Port Number User ID Password 
My password not 
shown here
Send a Text Message 
XMPPConnection 
Text Message 
Chat type 
message 
Recipient ID 
Add text 
Output console and 
browser notification
Listen For An Incoming Message 
Output
References You can study 
http://www.igniterealtime.org/projects/smack/ 
http://xmpp.org/about-xmpp/technology-overview/ 
https://peepcode.com/products/xmpp

More Related Content

PPT
Core java day1
PPTX
Protocol buffers
PPTX
Protocol Buffer.ppt
PPTX
Chapter 2.4
PPT
Ch01 basic-java-programs
PPT
Unit 8 Java
PDF
Augmenting and structuring user queries to support efficient free-form code s...
PPTX
Reverse-engineering: Using GDB on Linux
Core java day1
Protocol buffers
Protocol Buffer.ppt
Chapter 2.4
Ch01 basic-java-programs
Unit 8 Java
Augmenting and structuring user queries to support efficient free-form code s...
Reverse-engineering: Using GDB on Linux

What's hot (20)

PPT
Python session.11 By Shanmugam
PPT
Taking User Input in Java
PDF
FaCoY – A Code-to-Code Search Engine
PDF
Java programming basics
PPT
Threads c sharp
PPTX
Multithreading in java
PPTX
Threading in C#
PDF
Java Threads
PDF
Socket Programming In Python
PPTX
advanced java ppt
PPTX
Introduction to Python Programming
PPT
Threads And Synchronization in C#
PPTX
Java - Processing input and output
PDF
Os Saintandre
PDF
Secure Communications with Jabber
PPTX
Java solution
PDF
Java Concurrency by Example
PDF
NDC London 2014: Erlang Patterns Matching Business Needs
PDF
Programming in Java: Organising Your Code
PPTX
Multithreading in java
Python session.11 By Shanmugam
Taking User Input in Java
FaCoY – A Code-to-Code Search Engine
Java programming basics
Threads c sharp
Multithreading in java
Threading in C#
Java Threads
Socket Programming In Python
advanced java ppt
Introduction to Python Programming
Threads And Synchronization in C#
Java - Processing input and output
Os Saintandre
Secure Communications with Jabber
Java solution
Java Concurrency by Example
NDC London 2014: Erlang Patterns Matching Business Needs
Programming in Java: Organising Your Code
Multithreading in java
Ad

Similar to Xmpp and java (20)

PDF
Xmpp intro 2014
PPTX
XMPP-IoT Protocol designed mainly to send mesages
PDF
XMPP Intro - The camp2012
PDF
Powering your website with realtime data
ZIP
XMPP In Real Time
PPTX
XMPP and SIP Presence Protocols for Messaging and Session Control.pptx
PDF
XMPP - Introduction And LAS Implementation (Presentation)
PDF
Performance Evaluation of XMPP on the Web
PDF
Microblogging via XMPP
PPTX
SAPO Messenger Meets Web 2.0
PPTX
XMPP PROTOCOL IN IoT AND ITS APPLICATIONS.pptx
PDF
XMPP Intro 1101 - 2008
ZIP
XMPP 101
PDF
XMPP Standards Update
PDF
Chat app case study - xmpp vs SIP
PPT
Xmpp presentation
PDF
WTF is XMPP?
PDF
X realtime xmp-ptut-pdf
PDF
Messaging With Erlang And Jabber
ODP
Xmpp intro 2014
XMPP-IoT Protocol designed mainly to send mesages
XMPP Intro - The camp2012
Powering your website with realtime data
XMPP In Real Time
XMPP and SIP Presence Protocols for Messaging and Session Control.pptx
XMPP - Introduction And LAS Implementation (Presentation)
Performance Evaluation of XMPP on the Web
Microblogging via XMPP
SAPO Messenger Meets Web 2.0
XMPP PROTOCOL IN IoT AND ITS APPLICATIONS.pptx
XMPP Intro 1101 - 2008
XMPP 101
XMPP Standards Update
Chat app case study - xmpp vs SIP
Xmpp presentation
WTF is XMPP?
X realtime xmp-ptut-pdf
Messaging With Erlang And Jabber
Ad

More from Soham Sengupta (20)

PPTX
Spring method-level-secuirty
PPTX
Spring security mvc-1
PDF
JavaScript event handling assignment
PDF
Networking assignment 2
PDF
Networking assignment 1
PPT
Sohams cryptography basics
PPT
Network programming1
PPT
JSR-82 Bluetooth tutorial
PPT
Core java day2
PPT
Core java day4
PPT
Core java day5
PPT
Exceptions
PPSX
Java.lang.object
PPTX
Soham web security
PPTX
Html tables and_javascript
PPT
Html javascript
PPT
Java script
PPS
Sohamsg ajax
PPT
Spring method-level-secuirty
Spring security mvc-1
JavaScript event handling assignment
Networking assignment 2
Networking assignment 1
Sohams cryptography basics
Network programming1
JSR-82 Bluetooth tutorial
Core java day2
Core java day4
Core java day5
Exceptions
Java.lang.object
Soham web security
Html tables and_javascript
Html javascript
Java script
Sohamsg ajax

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
Teaching material agriculture food technology
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
cuic standard and advanced reporting.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Modernizing your data center with Dell and AMD
PPTX
A Presentation on Artificial Intelligence
PDF
Approach and Philosophy of On baking technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
KodekX | Application Modernization Development
PDF
Electronic commerce courselecture one. Pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Building Integrated photovoltaic BIPV_UPV.pdf
Teaching material agriculture food technology
NewMind AI Monthly Chronicles - July 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
cuic standard and advanced reporting.pdf
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
Modernizing your data center with Dell and AMD
A Presentation on Artificial Intelligence
Approach and Philosophy of On baking technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KodekX | Application Modernization Development
Electronic commerce courselecture one. Pdf
Empathic Computing: Creating Shared Understanding
Bridging biosciences and deep learning for revolutionary discoveries: a compr...

Xmpp and java

  • 1. A Beginner’s Guide to XMPP Soham Sengupta CEO, Tech IT Easy Lab of Pervasive VM Computing +91 9830740684 (sohamsengupta@yahoo.com)
  • 2. XMPP : what and why?  Existing Web Technologies have 2 broad categories  Pull (Example HTTP where connection is initiated by Client and initial communication is unidirectional (HTTP Request)  Push (Where communication is initiated by clients but connection is bi-directional, and keeps alive till disconnection or log-out )  Need and utility of (Server) Push:  Real time Messaging (IM) like Google Talk, Facebook chat etc  Delicate and urgent information like Stocks quotes that need be initiated to clients  Real time Location tracking  News feeds  Cricket scores
  • 3. XMPP a Push Protocol  Extensible Messaging and Presence Protocol In G-talk you find if the other end is typing, entered message or her status like busy, idle, away etc
  • 4. Jabber  Jabber may refer to:  The original name of the Extensible Messaging and Presence Protocol (XMPP), the open technology for instant messaging and presence.  Jabber.org, the public, free instant messaging and presence service based on the XMPP protocol.  Jabber XCP, a commercial product which is an implementation of the XMPP protocol. Acquired by Cisco Systems in 2008.
  • 5. Smack 1. Smack is an Open Source XMPP (Jabber) client library for instant messaging and presence. 2. A pure Java library 3. It can be embedded into your applications to create anything from a full XMPP client to simple XMPP integrations such as sending notification messages and presence-enabling devices. 4. We learn in next slides how to use Smack and make a simple Java application client for XMPP
  • 6. Smack: Getting started 1. Pre-requites: a) Java SE 1.4 or above, SDK, language basics and concept b) An active Internet connection c) At least two Google accounts d) The Jabber Smack API Download Site 2. Step-1 a) Have the 2 jar files, i. Samck.jar ii. Smackx.jar that come with the API in your build path (CLASSPATH) a) We make sure that the two Google id can chat with each other, i.e. they are friend to each other b) We make sure we are connected to Internet
  • 7. Smack Tutorials  Some useful terms:  Roster  A list, especially of names : Dictionary meaning  While we chat we refer to our Friends in chat list as Roster  Connect to an XMPP Server 1. 5222: default Port for XMPP (used by most of the providers) 2. We connect to talk.google.com with our google (gmail) id and password
  • 8. Code Snippets to Connect XMPPConnection  The Java type that represents an XMPP connection  It needs a ConnectionConfiguration object to set up  The configuration object needs host, port and service name  connection.connect() connects to the server & no authentication (login) done  connection.login(user,password) succeeds on an Active Network if user and pasword are valid, else fails
  • 9. Connection set up continued… XMPP Server Port Number User ID Password My password not shown here
  • 10. Send a Text Message XMPPConnection Text Message Chat type message Recipient ID Add text Output console and browser notification
  • 11. Listen For An Incoming Message Output
  • 12. References You can study http://www.igniterealtime.org/projects/smack/ http://xmpp.org/about-xmpp/technology-overview/ https://peepcode.com/products/xmpp