Using XMPP and Openfire Server in Windows Phone 8

Implementing Extensible Messaging and Presence Protocol (XMPP) in Windows phone 8 is really a tough experience. Because, there is no third party library which is for free (there are some libraries which are highly expensive).


Project was required with WP8 chat application using Openfire server. After many days of exploration, we found a library which works well in WP8 (** WP8- Windows phone 8) but it lacks documentation and support. I started trial and error with this library. Please find the library link below


  •          VS 2012 Express for Mobile Edition/ VS2012 Windows Phone SDK installed or Higher.
  •          Basic Knowledge of XAML,C#
  •          Openfire server installed.

Let’s get going

  1. Open VS2012 -> New project -> Select Windows Phone Template -> Select Default application -> Name it as required (here named it as WP8Xmpp) -> Select target OS version – 8.0 



2. Use the DLL which is already built (you can find those in the attached sample application).

(Or use the library link mentioned above download the highlighted files and build in separate application and get the dll).


3. Refer those library phone.socketserver.dll and phone.xmpp.dll


4. Login panel UI is shown below


5.In MainPage.xaml.cs create some properties as shown below.


6. Look at the sample attached and

(Note :- While passing server name its very difficult to judge instead of IPaddress .

But I learnt using trial and error method is that for emulator user server name and for device use server IP Address)

7. There are two main events during connection ObjXmppCon_OnAsyncConnectFinished and xMPPClient_OnStateChanged

First asyncConnectFinished should be executed , there I am setting a flag IsXmppSuccess

Soon after, followed by statechanged event there is a flag like below mentioned 

Enum XMPP State

8.  If XMPPState is ready then => server and credentials are correct.

     If XMPPState is AuthenticationFailed => Credentials are wrong.

     I am just navigating to other form Output.xaml if the XMPPState is Ready.


If there are any issues, I will try to solve them in above mentioned sample. Find the sample solution here

Contact me : nanda.kishore@ecanarys.com


Please find related DLL here



How to add Overlay in Windows phone 8

Windows Phone is windows mobile operating system from Microsoft.In my project, there was a requireme...

Read More >


Post a Comment

  • Recent
  • Popular
  • Tag
  • The Ansible Architecture

    Ansible is an open source, IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. In thi...
  • Subversion (Centralized Version Control System)

    Version control system is a repository of files, often the files for the source code of computer programs with monitored access. They are essential for any form of distributed, collaborative developme...
  • Volume management in Kubernetes

    Since pods created in k8s are ephemeral, we are able to get the data as long as pods are alive, but if pods are terminated data stored in it completely lost and it cannot be get back, for that we need...
  • LDAP Integration with Sonatype Nexus

    Sonatype Nexus supports the Repository Manager integration with various active directory systems for authentication, such as Microsoft Exchange / Active Directory, OpenLDAP, ApacheDS, and others. In o...
Monthly Archive

Contact Us
  • *
  • *