GCM XMPP on Appengine? - android

Google just announced a new api for GCM to IO13 that using the xmpp protocol. Is it possible to use this api with appengine? It does not look like it would work with appengine's XMPP support, but perhaps with the new Sockets api. Can this be done from a frontend, backend, or both?

This is not possible with current GAE XMPP support. The problem is user/server addressing: GAE XMPP API sends messages to users defined by email addresses. It then performs a DNS lookup for the XMPP server SRV record (e.g. dig srv _xmpp-server._tcp.gmail.com +short to look up the XMPP servers for #gmail.com addresses). This is not how GCM CCS works - you have to connect to fixed server.
OTOH, you could use Outgoing Socket API and then implement XMPP protocol.

Google Cloud Messaging Team told me:
'Google App Engine does not currently support connections to CCS.'
I was looking at the source code of the simple python-xmpp,
it looks pretty easy to port to App Engine, it only need python dns,
there is no other third-party library requirement.

Only XMPP endpoints GCM Cloud Connection Server needs XMPP support when you want to stream your message. If AppEngine doesn't support XMPP, you can use older GCM HTTP messaging instead. Only HTTP POST requests are needed to send message to your device.

Related

XMPP GCM Android implementation guidance

I have been working on GCM xmpp implementation for my chat functionality, but about a week, I am not getting online help to start with , I have got this XMPP GCM Android tutorial, but I see xmpp is not fully implemented, and upon seeing their code, it is very unclear to understand the functionality
firstly. my current structure is
Android client app for chat functionality.
java backend, app server jboss hosted in openshift cloud platform.
and according to this google gcm-xmpp image.. I see client interacts directly to gcm, which I get confused, intern gcm connects app server.
as per my implementation, I get gcm regid from gcm and send http request to app server which intern send notifications to client devices through gcm. this is reverse of what we see with gcm flow diagram
secondly, since I have already set up app server Jboss, which can handle http request for my client request other than chat functionality. now I need to implement xmpp for handling asynchronous, bidirectional, upstream messaging with another servers like openfire or ejabberd which supports xmpp.
currently I am in state where I don't know how to start with xmpp, I have got above queries, in the hope getting some directions to start with.

How Can An App Communicate With a Server and reflect updates immediatly?

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

google gcm xmpp server with http client

I have a Java based app server and a cordova client. I want to use GCM with the existing cordova gcm plugin code which uses HTTP to communicate with GCM, and use XMPP for GCM communication in my server to make it more efficient. can this be done? I am asking because I get ACKs on my server but no messages arrive to the client.
Thanks.
Found the problem, it was in the client side. The answer is yes, it does work.

GCM client for Desktop

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 :)

how to use GCM in android

I propose a new question:
I think the communication between android and server by sockets is difficult
I speak with my friends it proposes me a solution: use the GCM
month then give an idea or example uses this concept
I found this book:
http://www.academia.edu/2200380/SENDING_SECURE_DATA_BETWEEN_AN_ANDROID_MOBILE_APPLICATION_AND_A_NETWORK_GROUND_STATION
And the question is, how to use gcm between server and Android?
Communication between android and server is I believe not applicable with GCM, GCM is intended to be a server to client pushing service, for example your wish to tell your client there is some data updates you need to fetch. So your server will push a message to client, using GCM.
For client to server communication, the easiest IMO would be using some Http server or web services. As for securing you can always go for SSL.

Categories

Resources