Can GCM be used as a two way communication? - java

Can GCM (Google Cloud Messaging) be used as a two way communication between the device and the server?
Please Help with the links.

Yes it can. That's what GCM CCS (Cloud Connection Server) is all about. It enables you to use GCM both both cloud to device and device to cloud messaging. The older version of GCM (the HTTP version) only supports messages from the server to the device (cloud to device).

Yes you can use XMPP and HTTP to complete what you are looking for. GCM offers both services. You can find a great starter tut here http://www.grokkingandroid.com/xmpp-server-google-cloud-messaging/
The google documentation isn't bad either. https://developer.android.com/google/gcm/server.html
The Smack API is what you will use to get XMPP working on the server side. You can find that here http://www.igniterealtime.org/projects/smack/
We also use Retrofit http://square.github.io/retrofit/ which is great for handing off objects via http.
Good luck, be sure to ask questions, figuring it all out in the beginning is a bit painful but worth it in the end. Also checkout RabitMQ http://www.rabbitmq.com/, it's similar to GCM

Related

How to make Push notification server for my android application?

How i can make my own push notification server for my android & ios application?
m not wanna to use GCM.
GCM and APN are the client side part of the infrastructure. You should still set up your own messaging server. That event-based server will then push messages to the clients via the proprietary infrastructure. I think applications should be respectful of their enironment, and using the push facilities of the platform is indeed a good thing for your users. Also, it should be even easier for you to implement, thanks to the standard setup and the working documentation.
Otherwise, just pick your favourite message queue middleware (Active, Zero, you name it) and integrate it directly with the native client for the supported platforms, without using GCM (or Apple push). But be warned that this will make your application less efficient, and you may face higher development costs to set up the background notification service.
Node.JS provide a module called SOCKET.IO. I use this in my android apps for live messaging. You can configure it on AWS, Digitalocean Or you can use Heroku.
Here is the good example of Socket.io with android http://nkzawa.tumblr.com/post/46850605422/connecting-to-a-socketio-server-from-android
Android chat app wit socketio
https://github.com/nkzawa/socket.io-android-chat

How to implement GCM CCS(XMPP) server on app engine?

I am Developing CCS server using XMPP,I followed all steps given on the developer.android website.This code(using java smack library) runs perfectly,as I am getting notification on my android mobile app.I have CCS service enabled on my App Engine Project.But when I tried to deploy it on App engine I am getting.
java.lang.NoClassDefFound Exception for
org/jivesoftware/Smack/XMPPException !!!!!!
after going through some websites (including this also)and developer.android site I found that
Note that Google App Engine does not support connections to CCS
My question is:
1>>.App Engine doesn't support java smack library or it don't support connection to ccs(xmpp)end point at all?
google has also provided XMPP service to App Engine
2>>.Is it possible to implement GCM CCS(XMPP) server using googles XMPP library?If it is possible please give some reference or tutorial.
I can really use some help with this questions,because I am so confused what do next!!!
thanks in advance!!!
It seems that GAE does not support connections to CCS. https://developer.android.com/google/gcm/server.html
This documentation gives a hint that it is possible. Also have a look into that post.

MDM Development

I am developing the MDM server in java for android devices. I found that we can able to establish communication between server to device with Google Cloud Messaging Server.
Is there any way for server communication to android device in java? Please provide any solution apart from GCM.
You have to implement your own way of doing this. You might look at MQTT for this.

Hosting an Application Server on App Engine?

I'm wondering if it is possible to host an Application Server on Google App Engine, I'm not planning to host a Web Application, but yes an App Server.
For example, hosting a Chat Server, that would Authenticate users log ins, register new users, establish a connection between two users running on clients developed to work with that Server.
If not, is there a similar service to GAE which I can use for that purpose.
Thanks a lot.
The XMPP and Channel APIs should let yo do it. If your client can make HTTP requests and your server can respond to them, then yes, you should be able to do it.
Yes this is possible.
Have a look at the Google Docs for an introduction to what the platform looks like and what APIs are available. And crucially what restrictions there are. For chat applications you might be interested in the Channel API.

How to implement Beluga or WhatsApp like messaging system in Android 2.1

I am trying to develop a message app within my android app. The message will be like whatsapp and beluga. I googled it and found C2DM Android 2.2 can send the push notifications to the device. However, this is not available on Android 2.1. Anyone knows how whatsapp send the notifications for 2.1 devices?
For Android: Whatsapp is build upon C2DM and when the app opens it opens an XMPP connection to their service to deliver the messages instantly. They also might use MQTT as a protocol to minimize battery usage. That's basically it.
Edit: I learned more, Facebook uses MQTT in their messaging app. Whatsapp is build upon XMPP with their own extensions. Their server side runs on top of ejabbard (XMPP implementation in erlang). http://www.ejabberd.im/
On pre 2.1 devices WhatsApp probably keeps a connection open to their XMPP servers in the background but this is not really good for battery life.
C2DM is replaced by GCM (google cloud messaging) now . you can use it for delivering the notifications to your app . For the exchange of message one should rely on protocols like xmpp (whatsapp), mqtt(facebook messenger), mtproto (telegram) etc.
if you are looking to familiarize yourself with GCM . try out this tutorial by appsrox - Create an Instant Messaging app using Google Cloud Messaging (GCM)
they are using GCM for the message delivery as well. it won't suit for production, but its an excellent resource for people who want to develop an instant messaging android app .
I don't know what exact technology is used in whatsapp. However, if i am to implement notifications where there is no support for push notifications from the OS, i can do two things:
Poll a remote server every X seconds and check for new notifications (this is the more expensive choice).
Run a background service, maintain a connection with a remote server, which will pump me any notifications that are to be received (sort of my like my own push notification implementation).

Categories

Resources