QuickBlox Developers (API docs, code samples, SDK)

Android XMPP Chat Sample

From QuickBlox Developers (API docs, code samples, SDK)
Jump to: navigation, search

Android XMPP chat sample allows to chatting between two people.

Contents

Dive into the code

Project homepage on GIT — https://github.com/QuickBlox/quickblox-android-sdk/tree/master/sample-chat

Download ZIP - https://github.com/QuickBlox/quickblox-android-sdk/archive/master.zip

How it's made

QuickBlox provides server infrastructure (auth mechanism and chat server chat.quickblox.com) for chat implementation on mobile platforms. See Chat section for more detailed information.

To start using chat in mobile application you should

Important! Note, that user can be used in the chat if it has been authenticated at least once after registration.

  • implement chat logic using any XMPP client library for Android

We recommend to use ASMACK (SMACK library for Android). There are following implementations:

Getting chat login

Use QBChat service to get chat login based QBUser object.

Short chat login

Use short chat login (QBChat.getChatLoginShort(QBUser user)) to login through XMPPConnection instance.

Short chat login looks like (<qb_user_id>-<qb_app_id>), e.g.

17744-1028

Full chat login

Use full chat login (QBChat.getChatLoginFull(QBUser user)) to add your companion to new chat.

Full chat login looks like (<qb_user_id>-<qb_app_id>@chat.quickblox.com), e.g.

17792-1028@chat.quickblox.com

Look through simple example of basic chat features implementation in MyChatController.java class.

See also

Comments

Feel free to comment on this page using the form below.

blog comments powered by Disqus
Go up