wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 41068
    
  43
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to subscribe to events in Android Phone?
 
Similar Threads
Connecting to FM Radio using Samsung Galaxy
how install in Eclipse(Java/Android) emulator for Tablet PC Android
thesis with android
Downloading Android
deploying app to android phone without signing?