105

Does anybody have an example or a tutorial for a Android application like WhatsApp? I want to understand how WhatsApp works and how it is programmed.

I want to see an example that uses a message-chat-system with "online"-status and "read the message"-information.

I used Google but I found nothing. Maybe someone has a tip.

Thanks.

Cyäegha
  • 4,191
  • 2
  • 20
  • 36
user1878413
  • 1,813
  • 4
  • 18
  • 24
  • 5
    most of the chatting softwares use [XMPP](http://xmpp.org/xmpp-software/clients/) well I can't say what Whatsapp is using but for a starter that should help you app running. – AurA Jun 06 '13 at 06:04
  • 3
    http://code.google.com/p/simple-android-instant-messaging-application/ – Arun C Jun 06 '13 at 06:06
  • 4
    WhatsApp used a modified XMPP service, as far as i know – Dodge Jun 06 '13 at 06:12
  • 1
    Here is a tutorial on [creating a chat application for Android](http://www.appsrox.com/android/tutorials/instachat/) using GCM and GAE. It's a simple example of a chat application in general. – appsroxcom Jul 25 '13 at 17:29
  • Following are links for good articles on XMPP based protocol based instant chat. - http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/ - http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/ Also there is a [jchat4android](http://code.google.com/p/jchat4android/) which is Chat Application for ANDROID SDK using Jade Agent Framework. It provide location also. – Chintan Rathod Jun 06 '13 at 06:13
  • 3
    [Telegram](https://telegram.org/) is an open source Whatsapp alternative. – Hello World Sep 21 '14 at 02:44
  • Whatsapp is real-time messaging application which makes use of ejabbered (XMPP) server. It's facilitates instant message transfer between two or many users at any given second. ERLANG is the programming language used for quickly adapting to instant updates and hot fixes. For storing multimedia files, the app uses an exclusive web server YAWS. A detailed explanation about whatsapp, click here http://blog.contus.com/how-whatsapp-works-technically-and-how-to-build-an-app-similar-to-it/ –  Dec 11 '15 at 09:05
  • here is an open source sdk with chat, group chat, typing status, read status and other whatsapp features https://github.com/AppLozic/Applozic-Android-SDK – Devashish Mamgain May 11 '16 at 17:03
  • This tutorial using Twilio IP Messaging for Android would be a good way to test and learn some basic functionality: https://www.twilio.com/docs/tutorials/walkthrough/ip-chat/android/java – Megan Speir Aug 31 '16 at 19:49
  • I created an unofficial client myself, it's still working. – gi097 Jan 01 '17 at 15:58

2 Answers2

51

If you are looking to create an instant messenger for Android, this code should get you started somewhere.

Excerpt from the source :

This is a simple IM application runs on Android, application makes http request to a server, implemented in php and mysql, to authenticate, to register and to get the other friends' status and data, then it communicates with other applications in other devices by socket interface.

EDIT : Just found this! Maybe it's not related to WhatsApp. But you can use the source to understand how chat applications are programmed.

There is a website called Scringo. These awesome people provide their own SDK which you can integrate in your existing application to exploit cool features like radaring, chatting, feedback, etc. So if you are looking to integrate chat in application, you could just use their SDK. And did I say the best part? It's free!

*UPDATE : * Scringo services will be closed down on 15 February, 2015.

Swayam
  • 16,294
  • 14
  • 64
  • 102
  • Scringo looks like great. The Problem here is, when i will start the scringo example on android, i become java.lang.RuntimeException: Unable to start activity ComponentInfo{com.scringo.scringosample/com.scringo.scringosample.MainActivity}: android.view.InflateException: Binary XML file line #36: Error inflating class com.scringo.ScringoLeftActivationButton – user1878413 Jun 06 '13 at 08:17
  • 2
    The thing is I would need to see your code to figure out what's going wrong. How about making a new post specific to the error that you are getting and then attaching your code along with it ? That way you will get more help, even from others. :) – Swayam Jun 06 '13 at 08:23
  • @Swayam the sample instant messanger doesn't seems to be stable, when you send another user a request, it doesn't update the screen at all. – require_once Feb 22 '14 at 04:27
  • Is it so? I would need to check again, because as far as I can remember, things were good the last time I tried. – Swayam Feb 22 '14 at 08:13
  • @Swayam yes it works, just to make sure this is pure p2p right? as each android has its own server/client and they keep the number of nodes connected on each app.. –  Feb 27 '14 at 02:31
  • @Swayam Thanks for sharing information about scringo +10 for that – Aamirkhan Aug 08 '14 at 09:53
  • @Aamir : You are welcome! :) Glad it was of help! – Swayam Aug 08 '14 at 09:57
  • Scringo is indeed free and good to start with. Unfortunately they don't scale very good for large crowd. A lot of lag.. Too bad. They do a great job. – DroidBender Oct 28 '14 at 22:23
  • @DroidBender : Thanks for your insights. So, if you have any other better alternative, please do share. :) – Swayam Oct 29 '14 at 09:59
  • @Swayam - Do we have library in Android like https://github.com/jessesquires/JSQMessagesViewController in iOS for Messages UI. – Appoorva Faldu Mar 16 '15 at 07:16
  • Well, the most straightforward way would be to use 9 patch images as the background and most of the things would be done in itself. But if you are really looking for libraries, you can have a look at http://warting.github.io/AndroidChatBubbles/ – Swayam Mar 16 '15 at 08:21
  • Scringo have shut down their operations : Look for similar resources PubNub , XMPP etc – Taimoor Ali Dec 22 '15 at 10:40
  • ***cries cries*** – arqam Aug 31 '16 at 07:08
18

Check out yowsup
https://github.com/tgalal/yowsup

Yowsup is a python library that allows you to do all the previous in your own app. Yowsup allows you to login and use the Whatsapp service and provides you with all capabilities of an official Whatsapp client, allowing you to create a full-fledged custom Whatsapp client.

A solid example of Yowsup's usage is Wazapp. Wazapp is full featured Whatsapp client that is being used by hundreds of thousands of people around the world. Yowsup is born out of the Wazapp project. Before becoming a separate project, it was only the engine powering Wazapp. Now that it matured enough, it was separated into a separate project, allowing anyone to build their own Whatsapp client on top of it. Having such a popular client as Wazapp, built on Yowsup, helped bring the project into a much advanced, stable and mature level, and ensures its continuous development and maintaince.

Yowsup also comes with a cross platform command-line frontend called yowsup-cli. yowsup-cli allows you to jump into connecting and using Whatsapp service directly from command line.

Matthias
  • 7,432
  • 6
  • 55
  • 88
blganesh101
  • 3,647
  • 1
  • 24
  • 44