1

I am developing an Android App that communicates with a server. How can I send a notification from my server to my Android App without the use of C2DM? Are Sockets a good solution? What are other alternatives?

st0le
  • 33,375
  • 8
  • 89
  • 89
einstein007
  • 61
  • 1
  • 2
  • 7
  • This link might throw some light http://tokudu.com/2010/how-to-implement-push-notifications-for-android/ – 18bytes May 02 '12 at 09:13

3 Answers3

0

I'd suggest you to develop a webservice preferably with JSON which is easy to handle. This server client architecture will hellp you to send and receive any kind of data (ranges from raw text to images or even video)

Check out C# webservices. That are very easy to start than the PHP services IMHO.

Anil Jadhav
  • 2,128
  • 1
  • 17
  • 31
Jay Mayu
  • 17,023
  • 32
  • 114
  • 148
0

Depends on what you want to do.

have you thought on how does the server identifies the client to send the message ? In this case the android phone ?

With http you would need the client to "request" this notification.

The closest thing to an actual notification would be to have a socket connection, which the client would connect to the server. But then would require an existent connection between the two. If this is ok for what you are doing, then go ahead if you really want to avoid C2DM.

But, using C2DM allows your server to send notification to devices without a need for a request or direct connection from the client. The only thing you need to do is pass the identification of the device to your third-party server given when you authenticate with google's C2DM. After that, you just push notification data to C2DM and google delivers the notification for you.

ehanoc
  • 2,187
  • 18
  • 23
0

I've used MQTT for providing push notifications on Android and it's proved to be a good, reliable, low power solution.

Some links to support my case / get you started:

http://mqtt.org/

Power Profiling: MQTT on Android

Basic Steps for Using MQTT in android

Community
  • 1
  • 1
stephendnicholas
  • 1,810
  • 14
  • 15