How to make a chat application in android? [closed]
Asked Answered
P

6

28

I would like to add chat functionality with online user in gmail in android. how to add chat feature in my own application in android?

I want to show an online user in google maps which is nearest to the area which I have selected and have the ability to chat with that online user

Pless answered 28/12, 2010 at 5:46 Comment(1)
Not a chat application, but maybe an SDK that can help is Scringo (scringo.com)Hey
S
17

To add chat to an Android application there are a number of options. I'll present the options ordered by the amount of development expertise that's required - from least to most.

Using a real-time backend service

There are a number of companies offering real-time backend services. These services would provide you with an SDK which allows your app to access their servers. Using the SDK you would be able to stream data between devices.

Here is a list of the most popular services:

Firebase

Google owned real-time database which uses WebSockets and MongoDB as it's core technology stack. The service allows you to save data in a no-SQL database and then register to receive real-time updates when that data changes. They also offer services for push notification and file storage. There is also a third party open source messaging framework available for iOS and Android.

Firebase have a library called GeoFire which allows you to make your apps location aware.

Pusher / PubNub

I've grouped these together because they are quite similar. They provide real-time streaming infrastructure and technology. You can establish channels between groups of devices and stream data between them. They don't provide any means to authenticate users so you would need an app server.

Quickblox

Quickblox is targeted specifically at the instant messaging market and they use an XMPP server on the backend. Since they use XMPP, this service has a lot of messaging features built in like privacy lists and typing indicators. They provide a reasonable but basic example messaging app.

Layer

Layer is half way between Quickblox and PubNub / Pusher. They offer a streaming platform which is targeted towards instant messaging. They have some messaging features like basic blocking but this isn't a full scale messaging implementation like Quickblox. They have a library of UI components that can be used to help build a complete app - Atlas.

If you use a backend as a service you will always have to build the chat client yourself. If you go with one of the more general purpose options like Firebase, you will also have to build your own messaging protocol.

These services will save you time when it comes to the real-time server implementation, server configuration and scaling.

XMPP

Another option is to host an XMPP server yourself. There are a number of open source XMPP servers available:

XMPP servers will provide you with a large amount of messaging functionality out of the box. They generally don't include any location awareness but this could be solved by configuring the server to host the user database on a separate server - that would allow you to add extra tables to handle the geolocation. An alternative would be to use presence to update relevant devices when a user's location changed by a certain amount.

To build the client I would recommend using Smack. Since XMPP is an open standard, your client should be able to work with third party XMPP servers and clients.

If you don't want to build the client yourself there are a number of open source projects (mostly under copy left licenses) which could act as a starting point. Xabber would be one example but you can find more by searching. Alternatively, you could use this a commercial open source project.

Building the server yourself

The final option is to build the messaging server yourself. This has the benefit that you could add the features you need and keep it reasonably simple. A good approach would be to use Symfony and the WebSocket Bundle for the real-time back end and Android WebSockets for the client. Using this approach you would have a lot of flexibility implementing the geo location functionality.

Soledadsolely answered 20/1, 2017 at 12:34 Comment(0)
L
6

I & my team, we are working on Backend as a Service platform called QuickBlox. We have great example how to integrate Map/Chat features to your application:

Simple Android Map/Chat application: https://quickblox.com/developers/Android_XMPP_Chat_Sample

Lareine answered 30/5, 2012 at 21:3 Comment(3)
it is free or payable quikbloxInfare
It's free for developersLareine
but for limited user am i right? means limited user can able to chat in group chat etc....Infare
A
3

We have been working very closely with the developer community and have developed Applozic Chat SDK which takes just 10 mins for integration. Give it a try: Applozic Sample code with open source sdk is available in Github: https://github.com/AppLozic/Applozic-Android-SDK

Apomixis answered 16/4, 2016 at 7:41 Comment(0)
D
2

I dont know about the about GMaps but for implementing chat you can try following link Xmpp

Date answered 28/12, 2010 at 6:56 Comment(1)
this is 2021. no one would ever use that interface.K2
A
0

Adding a chat functionality, you can use Firebase or XMPP.

For choosing the right option you may prefer this https://www.quora.com/Which-protocol-is-better-to-develop-a-chat-web-app-using-Firebase-XMPP-or-HTTP

OR

If you have strong knowledge of backend technologies, go ahead with your own. And the same time, there is also an instant solution available in the market that helps to integrate the additional functionality more easily.

Altigraph answered 22/11, 2017 at 13:6 Comment(0)
N
0

We provide a real time chat SDK solution called ChatCamp. You would be able to add chat functionality to your Android app quickly with the help of ChatCamp SDK. Here is the link to Android quick start guide - https://docs.chatcamp.io/docs/android-chat-quickstart. Also, it is possible to order the user list based on the distance from a particular location or you may show online users on top of Google Maps.

Needleful answered 3/1, 2018 at 16:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.