-1

I wanted to send a notification to android client from the server(php), which will be displayed to the user through notification bar. How can I do this! please provide a good tutorial on this Thanks :)

yourdroid
  • 147
  • 1
  • 5
  • 14
  • possible duplicate of :http://stackoverflow.com/questions/4584649/sending-notification-few-data-from-php-server-side-app-to-android-client-side – Nibha Jain Mar 13 '12 at 07:07

3 Answers3

2

From the 26th of June, 2012 Google has deprecated C2DM in favour of Google Cloud Messaging for Android (GCM).

All the docs and info relating to GCM can be found at http://developer.android.com/guide/google/gcm/index.html including details on how to migrate from C2DM to GCM.

stephenmuss
  • 2,445
  • 2
  • 20
  • 29
1

The solution I can think of is to use Cloud to Device Messaging (C2DM), the Android equivalent push notifications.

For that you will have to:

  1. Register for C2DM.
  2. Register your device to C2DM.
  3. A registration ID is returned through a broadcast. (Server should track this device registration ID)
  4. Get an authentication token for your server.
  5. Server shall use the authentication token and the device registration ID to send messages to your device
  6. Setup your device to receive broadcast messages from C2DM and create a notification to show up in your notifications bar.

The above steps are just an overview, I personally learned C2DM using this tutorial and suggest you do the same. Try running the code he has provided.

musSharApp
  • 21
  • 1
0

the easiest way to get push notification from server is to use c2dm server. Using c2dm server you can push message to any android device. The best tutorial for c2dm is,

http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html

you can get detailed information regarding c2dm over here.

And you can check this post to register application server with c2dm and to send message from server to android device via c2dm server, C2DM implementation PHP code

Community
  • 1
  • 1
Chirag_CID
  • 2,224
  • 1
  • 24
  • 33