This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Android and the fly likes How to subscribe to events in Android Phone? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Mobile » Android
Reply 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: 35241
    
    7
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".


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to subscribe to events in Android Phone?
 
Similar Threads
Downloading Android
Connecting to FM Radio using Samsung Galaxy
thesis with android
deploying app to android phone without signing?
how install in Eclipse(Java/Android) emulator for Tablet PC Android