1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4J Library XMPP/JABBER - Best protocol to IM for B4J

Discussion in 'B4J Libraries & Classes' started by Alberto Iglesias, Mar 21, 2015.

  1. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    [​IMG]

    XMPP/JABBER - Best protocol to Instant Messengers for B4J

    This library was made based on XMPP Protocol

    Installation instructions:
    - Copy the .xml and .jar(s) files to your custom libraries folder
    - Select in your REFERENCED LIBRARIES

    [​IMG]



    Version history:
    V1.0.0 (First public release - Donationware):
    - Initial version

    XMPP
    Author:
    Alberto Iglesias - alberto@visualnet.inf.br
    Version: 1
    • XMPP
      Events:
      • deliverycomplete (Message As String)
      • messageArrived (Message As String)
      • onConnect ()
      • onDisconnect ()
      • onDisconnect (Status as boolean As )
      • onInitialized ()
      • onLogin ()
      Fields:
      • Host As String
        Name or IP of the Jabber/XMPP Server
      • Port As Int
        Port of the Jabber/XMPP Server
      Methods:
      • About As String
        About the developer
      • Connect
        Connect to the Jabber/XMPP Server
      • CreateChat (userJID As String)
        Create Chat with the JIB User
      • Disconnect
        Disconnect from Jabber/XMPP Server
      • GetHost As String
        Returns the host name of the server where the XMPP server is running
      • GetRoster As List
        Get Roster List
      • GetUser As String
        Get the connection current user
      • Initialize (eventname As String)
        Initializing XMPP Object
      • IsConnected As Boolean
        Get a connection status
      • IsSecureConnection As Boolean
        Check if the connection is secure
      • Login (Username As String, Password As String)
        Login into to the Jabber/XMPP Server
      • SendMessage (message As String)
        Send a message into the chat
      • Version As String
        Get the Library Version
      Permissions:
      • android.permission.ACCESS_WIFI_STATE
      • android.permission.INTERNET

    [​IMG]


    [​IMG]

    [​IMG]

    You can try your APP using web client in https://jwchat.org/

    Look this video:



    References:
    http://xmpp.org/
    https://jwchat.org/

    * This version is fully functional, the only one difference is when sending a message the text "Donationware" is delivery with your message.
    Please consider a simple €10 donation and I send to you the Library without "Donationware" text in a sendmessage method.


    [​IMG]
     

    Attached Files:

    Last edited: Mar 21, 2015
  2. lymey

    lymey Active Member Licensed User

    Hi Alberto!
    I am trying to run your example program and am getting the following in the Log:

    Then when I try and login to the server:

    Then When I try and send a message:

    I have the libraries copied to the referenced libaries directory.

    What have I missed?

    Thanks for your help, if I can get this and the Android library working they will be very helpful!
     
  3. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    Hey Lymey,

    For me it´s working, look:

    [​IMG]

    I suggest you create your own user and password in any jabber server to try, but you can try with my test user:

    Check If .h .xml and .jar is in library folder and asmack-android-19-0.8.10.jar too


    Server:jabber.chaotic.de
    User: visualfriend
    Pwd: MyJabber2015
     
  4. lymey

    lymey Active Member Licensed User

    Hi Alberto,
    I haven't tried the basic For Android version yet - the problem I am having is with B4J
     
  5. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    Yes, no problem too, look my screenshot: (I just take right now)

    I recommend you update your JVM, I think is this the problem....

    In the test I do now, I use the same user/password I do in the B4A example.....

    [​IMG]
     
  6. lymey

    lymey Active Member Licensed User

    Hi Alberto,
    I am using jdk1.8.0_45\bin\javac.exe, I was using 1.7 before also.
    I still get all the same warning messages, but I can at least have a chat using the example app and Pidgin, and Process One's One Team client.
    is there a plan to send and receive files?
    May thanks
    Paul
     
  7. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    I don't have plans to send/receive files in this protocol, maybe in the MQTT..
     
  8. lymey

    lymey Active Member Licensed User

    That would be a shame,
    I think having send/receive file functionality would make this an even more useful (and commercial) library.
    I would be happy to donate more if it had that capability!
    :)
     
  9. tigrot

    tigrot Well-Known Member Licensed User

    Hi Alberto,
    I was testing your test APP on a W10 PC and get these errors:
    Code:
    Waiting for debugger to connect...
    Program started.
    [objXmpp_onInitialized]
    MQTT About = XMPP Library - By Alberto Iglesias (alberto@visualnet.inf.br)
    MQTT Version = 
    1.0.0 ** DONATIONWARE **
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.provider.UrlProviderFileInitializer initialize
    INFORMAZIONI: Loading providers 
    for file [classpath:META-INF/core.providers]
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.provider.ExtensionInitializer] specified 
    in smack-config.xml could not be loaded:
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.ServiceDiscoveryManager] specified 
    in smack-config.xml could not be loaded:
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.XHTMLManager] specified 
    in smack-config.xml could not be loaded:
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.muc.MultiUserChat] specified 
    in smack-config.xml could not be loaded:
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager] specified 
    in smack-config.xml could not be loaded:
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager] specified 
    in smack-config.xml could not be loaded:
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.filetransfer.FileTransferManager] specified 
    in smack-config.xml could not be loaded:
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.LastActivityManager] specified 
    in smack-config.xml could not be loaded:
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.commands.AdHocCommandManager] specified 
    in smack-config.xml could not be loaded:
    apr 
    062017 1:00:21 PM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    AVVERTENZA: A startup class [org.jivesoftware.smackx.ping.PingManager] specified 
    in smack-config.xml could not be loaded:
    Any idea?

    Ciao
    Mauro
     
  10. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    Hello tigrot,

    I saw maybe something is missing like java dependencies in this machine. It´s not the problem with b4j library, I´m using in windows 10 too.

    https://community.igniterealtime.org/thread/47774

    Try to update java machines or upgrade to the last one.

    And check the permissions when install this dependencies.


    best regards,

    Alberto Iglesias
     
  11. birnesoft

    birnesoft Active Member Licensed User

    Hello Alberto,
    I have the same problem on a W10 PC, B4J 5.9, jdk1.8.0_66
    Any idea?
    Björn

    Code:
    Waiting for debugger to connect...
    Program started.
    [objXmpp_onInitialized]
    MQTT About = XMPP Library - By Alberto Iglesias (alberto@visualnet.inf.br)
    MQTT Version = 
    1.0.0
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.provider.UrlProviderFileInitializer initialize
    INFORMATION: Loading providers 
    for file [classpath:META-INF/core.providers]
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.provider.ExtensionInitializer] specified 
    in smack-config.xml could not be loaded:
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.ServiceDiscoveryManager] specified 
    in smack-config.xml could not be loaded:
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.XHTMLManager] specified 
    in smack-config.xml could not be loaded:
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.muc.MultiUserChat] specified 
    in smack-config.xml could not be loaded:
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager] specified 
    in smack-config.xml could not be loaded:
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager] specified 
    in smack-config.xml could not be loaded:
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.filetransfer.FileTransferManager] specified 
    in smack-config.xml could not be loaded:
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.LastActivityManager] specified 
    in smack-config.xml could not be loaded:
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.commands.AdHocCommandManager] specified 
    in smack-config.xml could not be loaded:
    Okt 
    192017 10:22:24 AM org.jivesoftware.smack.SmackConfiguration parseClassToLoad
    WARNUNG: A startup class [org.jivesoftware.smackx.ping.PingManager] specified 
    in smack-config.xml could not be loaded:
     
  12. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    I will try to reproduce with this version of JDK, because in my notebook is working fine. Maybe some dependecies from the smack component....
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice