• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to check incoming message ?

 
Apt Gopal
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have created a Service in android to check the incoming message .I want show the notification to the user at the time of new incoming message.And to view the body of the incoming message in the class.

That means how to pass the message body from Service to the Active class

Please any one help me
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what Intents are for - they tie the various parts of an application (or multiple applications) together.
 
Apt Gopal
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer

I didn't understand please explain me clearly.because i am new to android development
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start here: http://developer.android.com/guide/topics/intents/intents-filters.html

Intents are such an integral part of the Android architecture that you need a solid understanding of them. If that article isn't sufficient, I'd advise to get one of the introductory Android books (such as the ones listed in the AndroidFaq).
 
Apt Gopal
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer

Thanks for your great help

But my application is want to always run in the background if a new message is received means i want to read the message and i want to do some action based on the body of the incoming message that means i want to pass the message body to another class .Please tell me how to do that

Thanks and regards
Aptgopal
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's like I said: that's what Intents are for. It's not possible to explain this concept fully in a forum like this; that's why I linked to the developer guide.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is what you can do -

There is a Intent that is broadcast when a new message arrives(check documentation of Intent class); write a BroadcastReceiver that listens to this Intent. From the onReceive method of this BroadcastReceiver start your service that would do things in background.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this tutorial out; an oldie but a goodie: React on incoming/outgoing SMS
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic