Background
- 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
- 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
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
Update
Please find related DLL here