Android Open Source - Fabby-Chat Fb Chat Connection






From Project

Back to project page Fabby-Chat.

License

The source code is released under:

MIT License

If you think the Android project Fabby-Chat listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.fabbychat;
/*from  ww w.ja  v  a 2  s . co m*/
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.SASLAuthentication;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.provider.ProviderManager;

import com.fabbychat.sasl.SASLFacebookMechanism;


public class FbChatConnection {
  
  private static XMPPConnection conn;
  
  public static XMPPConnection getConnection() {
    if (conn == null) {
      ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp",
        new org.jivesoftware.smackx.provider.VCardProvider());
          // register Facebook SASL mechanism
          SASLAuthentication.registerSASLMechanism(
            SASLFacebookMechanism.NAME,
                SASLFacebookMechanism.class);
          SASLAuthentication.supportSASLMechanism(
            SASLFacebookMechanism.NAME, 0);

          // create a connection
          ConnectionConfiguration config = 
            new ConnectionConfiguration("chat.facebook.com", 5222);
            conn = new XMPPConnection(config);
            // by default, reconnection is allowed; is this okay?
    }
    return conn;
  }

}




Java Source Code List

com.fabbychat.Application.java
com.fabbychat.ChatDialog.java
com.fabbychat.ChatDialogs.java
com.fabbychat.Contacts.java
com.fabbychat.FbAvatarProducer.java
com.fabbychat.FbChatConnection.java
com.fabbychat.FbChatService.java
com.fabbychat.Login.java
com.fabbychat.adapters.ChatContentAdapter.java
com.fabbychat.adapters.FbContactAdapter.java
com.fabbychat.models.FbContact.java
com.fabbychat.sasl.SASLFacebookMechanism.java
com.fabbychat.utils.DrawableManager.java
com.fabbychat.utils.DrawableProducer.java
com.fabbychat.utils.URLDrawableProducer.java