I am making an application in which I need to implement chat features. We have our own server from we get friends list from the server.
I need to send msg to that friends and get reply message from that friends. For this I think I have to send msg to server of that friend in which I have to chat.
But I am unable to understand how to get reply from the server of a chat message.
Please help
You can use different APIs to implement the chat feature. Here is the link for sample open source chat application which using Smack api.
http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/
see the sample application which is based XMPP protocol. You can configure your google account for testing.
You can implement the chat features either by using third party API like (Smack ,Asmack) or by implementing your client server logic. I will prefer you to use above API for implementing chat features in your application.
Related
I am trying to build an Chat app in which I can receive & send messages to my friends from/into Facebook Messenger using APIs.
Does Facebook provide such APIs to do so?
I tried to find the way, maybe we can do it using Webhook, but I think using webhook we only can send the message. Is there any android demo for this? Please share a link if you have any.
Please suggest what I can do to achieve this if you have any ideas.
Does Facebook provide such APIs to do so?
No.
There are no APIs for user-to-user communication via Messenger.
Only conversations between a user and a page can be handled via API.
I want to create a android application that allows to people to send a simple message to a contact.
I don't want to make a instant messaging app, but want the user to be able to send a small messages to another contact selected on the user list, using parse.
I would rather not use other services like Pubnub, because I have heard you can send messages using parse as a backend.
please could you provide a tutorial link or GitHub or just code to send message to contact.
here is the tutorial link for parse:
https://www.parse.com/tutorials/android-push-notifications
Also this is something you can implement yourself using a server and Google Cloud Messaging. It's not too difficult to do.
https://developers.google.com/cloud-messaging/
hi this is just for knowledge. i will try to explain as much as i can what is my question.
Usually i call on an Async Service every amount of time i.e updates on the server part for example are not reflected as soon as they change. whatsapp for example reflects the updates almost instantly. for example when a user is typing, it shows to the other user that he is typing.
In short what protocols do they use and how do they use it.
thank you.
What protocols do they use?
Application like Whats app,G-talk ,facebook etc they uses XMPP protocol for IM services.
What is XMPP?
The Extensible Messaging and Presence Protocol (XMPP) is an open
technology for real-time communication, using the Extensible Markup
Language (XML) as the base format for exchanging information. In
essence, XMPP provides a way to send small pieces of XML from one
entity to another in close to real time
As per latest version of specifications XMPP provides below services
Channel encryption [RFC3920]
Authentication [RFC3920]
Presence [RFC3921]
Contact lists [RFC3921]
One-to-one messaging [RFC3920]
Multi-party messaging [XEP-0045]
Notifications [XEP-0060]
Service discovery [XEP-0030]
Capabilities advertisement [XEP-0115]
Structured data forms [XEP-0004]
Workflow management [XEP-0050]
Peer-to-peer media sessions [XEP-0166]
This are the core services available in XMPP
Below are some Applications where XMPP can be used
Instant messaging
Groupchat
Gaming
Systems control
Geolocation
Middleware and cloud computing
Data syndication
Voice over IP (VoIP)
Identity services
Like HTTP XMPP also require server-client implementation
Below are some popular XMPP servers
Ejabberd
Openfire
Prosody
Tigase
You can find more information on xmpp server on this link
Different platform has their different XMPP client library you can more information on this link
If you want to implement XMPP client for android then you can use Smack 4.1 ,it is an open source XMPP client library written in java.
I have tried to list down basic feature of XMPP here but if you getting started with xmpp ,then there are lost of things to learn , free to ask any doubt regarding XMPP I will try my best .
Thank you
Note::
for the user who are still using aSmack should Upgrade to Smack 4.1 as aSmack has been deprecated!!
aSmack Deprecation Notice
aSmack to Smack Upgrade guide
You could implement the Google Cloud Messaging (GCM) service, as the GCM site says:
Google Cloud Messaging (GCM) for Android is a service that allows you
to send data from your server to your users' Android-powered device,
and also to receive messages from devices on the same connection...
This way you can inform from one client a status change, the backend then send the propper message to the desired clients and finally those clients app updates the status.
https://developer.android.com/google/gcm/index.html
Currently I am working on instant messaging chat application in which I need to implement third party chat server.
I am following this tutorial
Complete project available on Github here.
When I download this project it provides me with two project folders; the first is named GCMDemo and the second is GCM_CCS_application.
I import GCMDemo in eclipse; it provides me a GCM client for sending message and it's working fine.
But I don't know how to use GCM_CCS_application. This is a java application. GSM_CCS_application is not an android application; it is for server-side applications.
I have openfire server installed on my computer but don't know how to use openfire for this application. So please somebody tell me how to implement this server-side application.
Hope you have figured this out by now, if not read on.. Basically you DO NOT need Openfire for this purpose. Google's server will do the job of Openfire. Your server application and your android application are both "users" or clients of the Google's xmpp server. The applications can connect to the Google server using your project ID and API key. Hope this helps.
I'm new in android development. I'm trying to develop an app in which a user can send a request to another device running the same app and it should return a response/notification to the sending device.
I googled it and found that GoogleCloudMessaging can be used for that. But all the tutorials say that it can be used to send messages from server to apps. I need to know how the reverse can be done, ie send messages from app to server..
Please provide some tutorial.
Any help is appreciated.
Thanks..
If you want to send data to your server, you can use rest communication.
Here a tutorial
Step 1: Call a server side script*(REST api/ Webserices)* from your android application using HttpPost/HttpGet,
Step 2: Wait for response coming from server and use it.
Note: don't forget send all needful data for your request from your app to server by httppost.
Go through these link this will help you.
Get started with push notifications in Mobile Services.
Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
.
Google android doc on GCM,
Google Cloud Messaging GCM for Android and Push Notifications