2

I wanna develope Push notification without C2DM. Then I googled and found out some ways to impelements Push notification.

  1. Polling - not a good solution
  2. SMS - costly solution
  3. Persistent Connection - acceptable solution

I know that many programmers implements push service using persistent connection, but I think it also costs too much. So I have a idea to implement push service by client-side ServerSocket. Is there any problem here? (e.g. Security or battery prob etc.) Updating IP address to server whenever client's network changes, when events occur, server establishes connection to android client.

Any comments will be appreciated!

khcpietro
  • 1,459
  • 2
  • 23
  • 42

2 Answers2

0

There are some disadvantages using TCP/IP (Socket) implementations.It is difficult to implement reliable service because when the memory in android client becomes low, Android OS will kill the service.So this can happen when your phone in sleep mode or any other situations.

But you can still achieve server side push to android via AndroidPushNotificationsDemo.There is a framework called mqtt. This framework has been put in https://github.com/tokudu/AndroidPushNotificationsDemo and you will get more information when you go through this\ link:

http://tokudu.com/2010/how-to-implement-push-notifications-for-android/

There is a similar posts about this on the following stackoverflow thread. Push Notifications in Android Platform

Community
  • 1
  • 1
UVM
  • 9,776
  • 6
  • 41
  • 66
  • Thx for your answer! However, is MQTT also using persistent TCP/IP connection? I just wonder whether it is a good idea to implement ServerSocket on android client. (Server will create socket to client when push events occurs) – khcpietro Apr 10 '12 at 06:47
  • Though I couldn't find disadvantage of using clientside ServerSocket, I had a inspiration from your link. I only thought solution in a bad way. I really thank you :) – khcpietro Apr 12 '12 at 02:58
0

I would like to add that your process - however small - will drain the battery. User might notice/suspekt that.. in that perspective C2DM is a very good solution

snitch182
  • 723
  • 11
  • 21
  • You mean clientside ServerSocket wastes more battery than persistent connection. I know C2DM is good solution, but under my environment(include cost, supporting prev 2.2), I should use my own solution :( Thanks anyway! – khcpietro Apr 12 '12 at 02:51