0

I started with a small chat app for the friend circle only, the client part is quite simple, there's even no login, each dude will get an app version where he's already logged in. I'm just not sure how to use a service to monitor incoming messages since I'm not that familiar with that topic. The basic idea is the same for as for any messenger: a permanently running service (starts on boot) connects to the server at a certain interval and checks if there are any messages for the user (if network is not available, the service retries several times). In case there are some, a notification is shown. I'm aware of how to create such notifications, but I'm not sure how to implement and register the service. I DO NOT expect you to write code for me, I would just appreciate if someone points out the things I MUST do to get the thing working. Thanks in advance

EDIT as far as I understood, the best solution is to implement the Google Cloud Messaging support within the application and then create a servlet responsible for pushing notifications using GCM? Can somebody comment on this conclusion..

Droidman
  • 11,485
  • 17
  • 93
  • 141
  • If you're able to, maybe GCM might be the way to do it. It'll \*push\* a "message" to your device when there's a new one to read. Generally speaking, you'll use less battery than if you were to "poll" a server for information "manually". :) – karllindmark Jan 07 '13 at 13:34

2 Answers2

1

You can use broadcast receiver to do that...

See this is the best example for what you are looking for @ http://www.anddev.org/recognize-react_on_incoming_sms-t295.html

Another great guide to send and receive message is describe in detail at this link.

http://mobiforge.com/developing/story/sms-messaging-android

Jigar Pandya
  • 6,004
  • 2
  • 27
  • 45
1

You should read this topic:

Push notyfication

In my opinion, the best way to create chat is use websocket ( socket.io or something else ) or socket with tcp/ip connection.

Community
  • 1
  • 1
Dawid Sajdak
  • 3,064
  • 2
  • 23
  • 37