Instant Messaging Demo Client And XMPP Component For Delphi XE6 Firemonkey On Android And IOS

Delphi XE6 Firemonkey Jabber XMPP Instant Message Client Component DemoInstant messaging apps like Whatsapp, Kik Messenger, and Snapchat are hot right now and there are some existing instant messaging protocols that could be used to build your own Delphi XE6 Firemonkey instant messaging app. The XMPP (formerly Jabber) protocol is an open instant messaging protocol. There are various client components out there in Delphi for Windows using the VCL but I was unable to find one that would work on mobile. On the server side there are various open source XMPP servers but the one I found that seems really good is called OpenFire. The OpenFire server runs on Windows and Linux (and probably others as it is built in Java). There are various different plugins available for it including an HTTP REST API which allows you to make HTTP requests to the admin side to control actions like adding new users, friending users, and more. I hired an expert developer on oDesk to create a XMPP component to run cross platform on Android, IOS, Windows, and OSX in Delphi XE6 Firemonkey. The developer build a working instant message demo client and a working XMPP protocol component with Firemonkey and I am making them available. It does use the OXML library for Delphi which is also cross platform to handle the XML protocol that XMPP is based on. Sockets are handled by the Indy component suite. The demo client runs on Windows, Mac, IOS, and Android and should compile without too much trouble in Delphi XE5, Delphi XE6, and AppMethod. I have not tested the component or demo on any other server besides OpenFire.

Download the Delphi XE6 Firemonkey XMPP (Jabber) Component and Demo Client for Android, IOS, Windows, and OSX.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Instant Messaging Demo Client And XMPP Component For Delphi XE6 Firemonkey On Android And IOS by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Tokyo Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.

37 Responses to Instant Messaging Demo Client And XMPP Component For Delphi XE6 Firemonkey On Android And IOS

  1. Alberto Meyer says:

    Thanks a lot. Looking for it in a long time.

  2. Abdi Pranoto says:

    hi, i need help for this Source code,
    i installed on my device, but i can receive the message conversation, somebody help me, i need this…..

    • Admin says:

      Does it work on Win32 for you? Debug and get it working on Win32 and then try on your device. IOS or Android?

      • rio says:

        on win32 i can receive a message, but when i run it on android i can not receive a message yet, is there any something wrong?i use IP address not hostname/domain name.

  3. Joanan says:

    Well, i don’t found a total free xmpp component to VCL. Them I cheged your code from fmx to VCL and works well. But i woud like to create a user and i dont see the method to do this. Do you know how i can do this?

  4. Bianca says:

    Awesome tutorial ! Very nice.
    Is there any example on multi person chat / chat room ?

    thank you.

  5. sinyo says:

    i try use FiremonkeyXMPPClient, and i run application it ok.
    but i click “CONNECT” error TJabberSocket.Initialize.
    help me please……..

    • Admin says:

      What platform? Are your internet permissions set?

      • sinyo says:

        I use the platform: PC Windows 8 and Delphi XE6
        and I also use OpenFire and MySQL

        I set permissions internet on files AndroidManifest.template.xml as follows: “”

        In addition:
        on my Delphi code sets:
        1.
        procedure TFormConnect.FormCreate(Sender: TObject);
        begin
        GJabberClient.JabberServer := ‘localhost’; // put your server domain in here
        GJabberClient.JabberPort := 5222;
        GJabberClient.OnLogged := OnLoggedProc;
        GJabberClient.OnGettingContacts := OnGettingContactsProc;
        end;

        2.
        procedure TFormConnect.btnConnectClick(Sender: TObject);
        begin
        GJabberClient.Login := edUsername.Text;
        GJabberClient.Password := edPassword.Text;
        GJabberClient.JResource := ‘openfire’; //
        GJabberClient.InitializeSocket;
        if not GJabberClient.Connected then
        begin
        Showmessage(‘Cannot connect to server !’);
        Exit;
        end;
        GJabberClient.DoLogon;;
        end;

      • afernandez says:

        Hi, First thanks a lot for your software.

        I have a openfire server, on a windows server in Amazon, and connect with Spark (on my computer) without problem.

        I try to use test application FMXJabber on Win32 (delphi XE7)
        but always the same error ocurred: Authentification failed !!

        Thanks in advanced.

    • Tran says:

      Did you set JabberServer yet? See frmConnect, line 64:

      GJabberClient.JabberServer := ”; // put your server domain in here

  6. sinyo says:

    thanks for the info and the response
    I have set: GJabberClient.JabberServer: = ‘192.168.1.11’

    1. If I use Target Platform (Android), and I click connect appeared error “Error # 111 socket Connection refused”

    2. But if the target platform (win 32) and I click connect successfully.
    a. but if i send a message, the message does not get to the destination
    b. but if i receive messages okay and succes

    • Tran says:

      I did not try to use it on mobile device(s) yet (Going to) but from my tests to run Windows clients and server on separate computers I found that using IP address won’t work but using computer’s name of the server will. I would suggest you to do so, plus to allow connection to TCP port 5222 on the server computer’s firewall setup. Hopefully this helps.

      • afernandez says:

        Hi, First thanks a lot for your software.

        I have a openfire server, on a windows server in Amazon, and connect with Spark (on my computer) without problem.

        I try to use test application FMXJabber on Win32 (delphi XE7)
        but always the same error ocurred: Authentification failed !!

        Thanks in advanced.

  7. afernandez says:

    Hi, First thanks a lot for your software.

    I have a openfire server, on a windows server in Amazon, and connect with Spark (on my computer) without problem.

    I try to use test application FMXJabber on Win32 (delphi XE7)
    but always the same error ocurred: Authentification failed !!

    Thanks in advanced.

    • Raehong Yoo says:

      I have same Error.

      In C# xmppClient case, ‘JabberClient’ class have ‘PlaintextAuth’ property.

      set PlaintextAuth = true;

      it works well

      but I can’t find that property at the fmx xmppclient.

  8. Serkan says:

    i was tried it with DelphiXE7 with Windows and on android Tablet.
    i want connect to Nimbuz. when i click connect button its nothing to do..
    Why ? its cant connect Nimbuuz? what should i do for connect nimbuzz ?

  9. Peter says:

    Hello!I have a question.

    How does use SSL in this Instant Messaging Demo Client ?

  10. Pingback: Build A Messenger Layout Like Whatsapp Using Delphi XE5 Firemonkey On Android And IOS | Delphi XE5 XE6 XE7 XE8 Firemonkey, Delphi Android, Delphi IOS

  11. giuseppe says:

    Hi, Admin
    I try to use this example project with openfire server.
    I use xe7 Delphi in Windows and Android platform.
    I’m be able to login/send/recive message from my xmmp client delphi and another client(es spark), but when I send administrative message from openfire console, Delphi demo not woking correctly and not recive message.
    Thank you for help me.

  12. Luiz Roque says:

    Hi, Admin

    I’ve tried to use the project in Android, but it is not working, when I enter the username and password and press the button connect, nothing happens and if I press it again, comes out with the exception:
    [TJabberClient.Initialize]:
    [TJabberSocket.Initialize]: Already connected.

    I tried to use the hostname as the IP from the server machine.
    On Windows It works when I set the hostname as the name of the server, however if I use the IP from the server, the same happen as Android, the exception showed up.

    Any help would be appreciate, I need this quick.

  13. Marco Moema says:

    Hi, Admin!
    Thank you very much for this smart solution!
    It works very well!
    I wonder if anyone has implemented the chat room resource. I mean, create, delete, join chat rooms etc.
    I think this will nice, because you could send messages to a group of friends, for example.

    Best regards

  14. Richard Slater says:

    Hello! enjoyed this example, I have a cloud server running openfire. Making the compilation of this example for windows everything works fine, I can receive and send mesagens, however when compiling for android can only send and can not receive anything.
    What change can I do to fix this ??
    Thanks in advance.

    • Admin says:

      That is an odd one. Not sure what the fix for that would be. Use the debugger to track it down would be my only suggestion so far.

  15. anderson figueiredo says:

    estou tendo problemas quando tento instalar ele no ex 10 berlin, sabe como posso resolver?

  16. anderson says:

    alguém tem alguma documentação desse objeto?

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Convert INI Files To JSON And Back With XSuperObject In Delphi XE6 Firemonkey On Android And IOS

One of the useful settings storage components that comes with Delphi XE6 Firemonkey is TIniFile (and TMemIniFile). The format of...

Close