I need to create an application to send messages from my computer to the android devices.
The message has to be send to all the devices installed my app.
If possible to create the app pl z give me ideas.
You need to use Google Cloud Messaging Service. Google Cloud Messaging GCM is a free service that helps developers to send notifications to their Android application. GCM connection servers take messages from a 3rd-party application server (written by you) and send them to a GCM-enabled Android application (the "client app," also written by you) running on a device.
This is Google Official site for you. This is sample tutorial site for you.
Related
I read about Google Cloud Messaging at http://developer.android.com/google/gcm/gcm.html.
It supports Third Party Application server to Android application push notification.
I am wondering whether it is possible to implement the same thing push/receive notification from an Android app on one mobile to the same Android app on another mobile using Google Cloud Messaging.
If not, is there any other free service available similar to Google Cloud Messaging?
An Android device can send a GCM message to another Android device. All it needs is the API Key (of the Google API Project ID that the app uses to register to GCM) an the Registration ID of the other device. Using these parameters it can send a GCM message to another device via an HTTP request.
Usually applications that use GCM require a 3rd party server in order to store the Registration IDs of all registered devices. If your app has a different way to let devices share their Registration IDs with each other without requiring a server, you don't need the server.
As far as I'm aware, there has to be a server in the middle to send the push notifications (Android -> Personal Server -> GCM Server -> Android)
So the Android device sending the notification would send some data to a script on the server (using a HTTP GET/POST), and that script would then send the push notifications to all the devices that you wanted it to
Following the example Code from google (GCM Client Example), you can build an app to get a registration ID for your device, but sending messages without a server wouldn't work in my opinion. I didn't tried by now, but what about using the Google Backend Starter, or (what I tried) using a Backend as a Service Provider like apiOmat if you can't afford or don't want to set up a server.
I want to send some info messages to my users or disable my Android application remotely.
I want to know if it is possible to send message (Not SMS) to my android application from my server. It yes how can I do that?
The former Android Cloud to Device Messaging (C2DM) (now Google Cloud Messaging for Android) is a service that helps developers send data from servers to their applications on Android devices.
In the past there was Cloud 2 Device Messaging Frameword C2DM. It is superseded by Google Cloud Messaging for Android.
You can also use xmpp for that
Documention Found
xmpp.org/
I am developing android application that would receive data from server any time.i have searched in google to get some information.
1)android cloud to device messaging(C2DM).
2)persistent TCP/IP connection.
how to implement C2DM function and other one how to register C2DM?.please explain detail and send me sample application
C2DM is deprecated and you can use GCM for your requirement
Google Cloud Messaging for Android (GCM) is a service that helps developers send data from servers to their Android applications on Android devices. This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device
This document describes how to write an Android application and the server-side logic, using the helper libraries (client and server) provided by GCM.
Check these links,
http://developer.android.com/guide/google/gcm/gs.html
http://developer.android.com/guide/google/gcm/demo.html
http://www.basic4ppc.com/forum/basic4android-getting-started-tutorials/19226-android-push-notification-gcm-framework-tutorial.html
http://fundroiding.wordpress.com/2012/06/29/google-cloud-messaging-for-android-gcm-simple-tutorial/
for client side app you can find the code here
https://github.com/marknutter/GCM-Cordova
c2dm is deprecated.
https://developers.google.com/android/c2dm
Maybe you'd better start with GCM
best regards
I was just looking at the new Google Cloud Messaging (GCM) and I was wondering if it is possible to use GCM for Instant Messaging on your Android application?
I saw you can send data, like a message, from a server, but is it also possible to send from one device to another one?
And how would this work?
Some example code would be really helpful..
Tnx!
The official docs on Google Cloud Messaging for Android does mention that GCM can be used to develop an instant messaging app.
...or it could be a message containing up to 4kb of payload data (so
apps like instant messaging can consume the message directly).
So we went ahead and created an instant messaging app using GCM. The server-side is powered by Google App Engine. You can read the complete tutorial here. Create an Instant Messaging app using Google Cloud Messaging (GCM)
So it is possible to use GCM for Instant Messaging on Android, to answer your question. However, reliability of GCM compared to XMPP for IM is another topic.
Just my two cents:
I think you should not use GCM for delivering IM. You should have a dedicated server where your Android IM apps will connect to, using a persistent socket connection. Your server will know who is online or not and therefore can present an 'online list' to all the apps.
GCM can come into play, while users are offline or not running your app. A GCM message can be sent to them to indicate 'XXXX wants to chat'. They can then launch your app and automatically connects to a chat session.
Google has said that the delivery of GCM messages are not guaranteed. This reason alone is not a good idea to rely on them for Instant Messaging.
Try pub nub - it is pretty easy to implement - send Im from one mobile to another - simply fire up the web page (see link) in the browser , and chat between pc, mobile - and works - with 'no server'. Code is for javascript but they also have java. Chat app using jquerymobile web app framework
You might want to check out how a server sends a message to the GCM Service. It is possible to use php on Server side so it should be possible to adapt that to a POST request directly out of your application. However, to communicate you need the registered ids of the devices you want to send data to. Means you will need something to store and get them. Best solution would be your own (web) server which stores all ids and handles the Message sending.
I would like to know how the android market initiates the remote download through their website. I'm guessing there is some sort of push notification system. I want to know if it's possible to do the same thing using a different web interface.
The only possibility I see is to use the C2D (Cloud to Device) messaging API provided by Google. In that way you could send an install intent to the device. However that would always open the market locally on the device from which the user can then install the app.
Obviously Google can bypass these "limitations" :)
They use Android Cloud to Device Messaging (C2DM). They allow anyone with a server of their own to implement this service.
From the site:
Android Cloud to Device Messaging (C2DM) is a service that helps developers send data from servers to their applications on Android devices. The service provides a simple, lightweight mechanism that servers can use to tell mobile applications to contact the server directly, to fetch updated application or user data. The C2DM service handles all aspects of queueing of messages and delivery to the target application running on the target device.