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.
Related
We are building a full chat system with Laravel (Back-end) and mobile applications (iOS and Android). It is a completely one to one chat system.
Chat can be between mobile to mobile client
Chat can be between a mobile client and admin on the web panel (laravel)
We want all the data on our server so that admin can access the data anytime. For example, admin should be able to see the chat/conversation between two users.
System will support text messages, sending files/images, share location etc.
We have looked for some options like Pusher but it gets a bit too expensive when you have a lot of users.
What would you guys suggest? I would love your advice.
Thank you.
You have 2 options here:
Implement by yourself
In your case you need the following:
Install some XMPP server in your cloud. It could be something like Ejabberd, Prosody, Tigase, Openfire
On client side - use XMPP libs to connect to XMPP server and to send/receive messages. For iOS it's XMPPFramework, for Android - Smack
On Web/Web panel - use StropheJS
for any service tasks - there are also XMPP libs for PHP
Use some messaging SaaS platforms
Except Pusher, there are also lot's of diff messaging platforms e.g Twillio, Layer, ConnectyCube, Applozic etc.
I used ConnectyCube some time ago, they support Messaging, Video Calling and Push Notifications functionality for iOS, Android and Web. They also have some ready code samples available, so can some some time on start. Pricing is a competitive one. So it can be done in the following way:
iOS Chat SDK https://developers.connectycube.com/ios/messaging
Android Chat SDK https://developers.connectycube.com/android/messaging
Javascript/Web Chat SDK https://developers.connectycube.com/js/messaging
Hope it will be helpful for you
I know how to implement GCM in my App but I don't know how to build a server able to send notification to ALL the users.
I need something quite simple (just sending notification), could you advise me any services and tutorial in order to set up the server?
I wish something not to complex, because everything that I will need from my app is receiving whether simply notifications to display or to tell the app that some new data is available for downloading.
Thank you!!
Prerequisite for GCM Application
Google API Server Key
GCM RegId of the Android Device to communicate via GCM
If you get clear concept about GCM, please visit here
If you want to use java for server side then visit my answer.
Related Links:
Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
Android Warriors
If you're using PHP, you could use this approach to send GCM message to your client refer this
You could setup your own local server on PHP using AMPP. refer this
Probably, the simplest way is to add a cloud endpoint module refer this. Then, write a simple service refer this that sends the messages. Finally, let Android Studio deploy it.
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
Is there any way to login into a GCM server and receive messages from a Desktop Windows C++ application? I want to be able to login into my GCM server using some kind of C++ GCM client.
Thanks in advance,
GCM Client
SEE ALSO
Getting Started GCM Server A GCM client is a GCM-enabled app that runs
on an Android device. To write your client code, we recommend that you
use the new GoogleCloudMessaging APIs. The client helper library that
was offered in previous versions of GCM still works, but it has been
superseded by the more efficient GoogleCloudMessaging APIs.
A full GCM implementation requires both a client implementation and a
server-side implementation. For a step-by-step guide to creating a
complete sample implementation that includes both client and server,
see Getting Started.
I think it is designed for android device.
Probably you can hack and install a whole android somewhere but, buy is easier in this way:
Write an Android client as google expect to a cheap phone (20$) When you receive message send it over wifi to your desktop Apache server via HTTP POST, and problem solved, simple :)
I have a project to develop an application that implements push technology. I can save the message to a database when I add some message, but my problem is that I can't send (broadcast) the message to the client and I can't implement the client accepting the message (accept broadcast message).
I'm using Spring, Hibernate, and Tomcat for the server, and I've built the client on Android.
I have tried all the links in this question, but I'm still confused about how to implement the source code.
For GCM, an explanation is available here.
For this you need to get an API key for your project from the API console.
Also, you need the Google Cloud Messaging for Android Library which will be available in your Android SDK/extras directory.
And if you are looking for both client & server side examples with explanations, they are explained nicely on this blog.