I would like to make app in android in which i wand to send some message to server and also want to get notification from server if there is any updates via C2DM in android.
How to send message to the third party server. (Third-party server like php)and inputs are necessary to send message to the third-party server. and how to send response Third-party server to C2DM and get notification from C2DM to Android device?
Well that's like asking "How do I write an Android application?" and expect to get a full answer.
I suggest you start with reading this:
http://code.google.com/intl/sv-SE/android/c2dm/index.html
Then download the Chrome To Phone source code see how they implement the C2DM solution. It is fairly complicated but if you know how to make http POSTs from your Android application and your server you will succeed.
Related
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.
I'm making an Android application and I want to get notifications like in WhatsApp – as the message comes. If any updates are made on the server then a notification should come to the user so he can check the application. Any help would be appreciated.
Firstly you need to integrate GCM with your system, so application need to get sender_id from google and put it to your server. Then if you want to invoke notification on your app you need to send message using this sender_id.
Here you can find nice tutorial. If you will have any question just give me a word.
I hope it would help you
You need to use Google Cloud Messaging. With it you can send information from a server to an Android device. The Android device will be waiting for messages from the server instead of polling the server at timed intervals.
I do not know much about REST servers notifications, so how can I get server's notification\event on my Android app? One way I can suppose is send request to server and wait until response which is delayed, but this decision seems me wrong. Any suggestions? Thanks.
You have all the documentation in Android developers.
One way to do what you want is called Push Notifications and is doing throw Google Cloud Messaging (GCM).
It involves using Google APIs, to code some classes in your Android App, and to code other stuff in your server part.
By the end, you should be able to send a simple message to a device and show a notification.
http://developer.android.com/google/gcm/index.html
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
I am creating a chat application on android using GCM. I'm already able do receive messages from the cloud and to send them manually through a PHP script using cURL. I can simple make an HTTPRequest to this script everytime a user send a message but I would like to know if there's a way to remove this script thus making the android app directly send the message to the cloud. If this is possible I also would like to know if it is the "right" way to do it or if the HTTPRequest is as good as it.
Thanks in advance.
Not really. GCM is not meant to replace your entire infrastructure, just the push channel from your servers to the clients.
That said, there is this concept of Upstream Messaging (from device to Google's servers) but Google's servers then contact your servers (via XMPP of all things) to let you decide what to do next.
You cannot do device-to-device over GCM.