1 / 12

A Beginner’s Guide to XMPP

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

neci
Télécharger la présentation

A Beginner’s Guide to XMPP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Beginner’s Guide to XMPP SohamSengupta 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 It can send Client information Text and Binary Messaging Augmentable 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 Smack is an Open Source XMPP (Jabber) client library for instant messaging and presence. A pure Java library 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. We learn in next slides how to use Smack and make a simple Java application client for XMPP

  6. Smack: Getting started • Pre-requites: • Java SE 1.4 or above, SDK, language basics and concept • An active Internet connection • At least two Google accounts • The Jabber Smack API Download Site • Step-1 • Have the 2 jar files, • Samck.jar • Smackx.jar that come with the API in your build path (CLASSPATH) • We make sure that the two Google id can chat with each other, i.e. they are friend to each other • 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 • 5222: default Port for XMPP (used by most of the providers) • 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 aConnectionConfiguration 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 Chat type message Recipient ID Text Message Add text XMPPConnection 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

More Related