redsolution/xabber-android — pull request #248 by davidgfnet (2013-09-15 10:57:59+00:00)
Title: Add WhatsApp protocol support in Xabber

Hello Александр!

Here it goes. Let me explain what I did to add the protocol:

- I modified UI to add the option at create account. There's a bug which adds an empty row in the protocol list (dunno why!)
- I modified the basic connection files to remove XMPPConnection class to Connection. This allows us to abstract the connection type (so we have WA and XMPP). I had to modify some files but the change is pretty straightforward
- I added the WA protocol class (which are a port of libpurple implementation)
- I created WAConnection which is the WA counterpart for XMPPConnection. It manages the socket by itself (the proxied connection is not properly handled, modifications needed here) using two threads instead the PacketWriter/Reader classes.
- Added the WAContacts class, which creates a SQLite table to store WA contacts (cause they don't get stored in the server!). Here I'd need you to review the DB stuff to add migration functions and all that stuff. Maybe we could just do phone contact integration and allow the user to import all the contacts present in the phone contact list.

As final notes. Everything is done by emulating XMPP protocol. When I want Xabber to update the UI I just create some XMPP Packet and send it to the packet listeners. It works great for chats, conferences, vcards...

If you need any extra clarification feel free to ask (you already have my email)

David