aspose file tools*
The moose likes Android and the fly likes How to subscribe to events in Android Phone? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "How to subscribe to events in Android Phone?" Watch "How to subscribe to events in Android Phone?" New topic
Author

How to subscribe to events in Android Phone?

Rakesh Jhamb
Ranch Hand

Joined: Jun 18, 2003
Posts: 154
Hi,

I am new to Android and exploring its API. I want to know how can I subscribe to events in Android phone, for example, when there is a phone call and we press Accept or Decline. How can I subscribe to such event, what do I need to learn for it. Or let us say user sends a SMS, how do I subscribe to such events.

SCJP2, SCWCD
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42277
    
  64
That's the realm of android.content.BroadcastReceivers. For incoming SMS, specifically, you'd handle "android.provider.Telephony.SMS_RECEIVED" intents; for incoming calls it'd be "android.intent.action.PHONE_STATE". Note that the app also needs to have the corresponding permissions, like "android.permission.READ_PHONE_STATE" and "android.permission.RECEIVE_SMS".


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to subscribe to events in Android Phone?