How to keep a service running to listen for incoming and outgoing calls

by David_Fisher » Thu, 07 Oct 2010 06:40:34 GMT


Sponsored Links
 Hi, how should I create a service that would keep on running in the
Background and listen for incoming and outgoing calls? I don't want
the service to die at any point in time. I have created a Broadcast
Receiver in my service class that is set for
ACTION_PHONE_STATE_CHANGED action. In my BroadcastReceiver, I have set
up a PhoneStateListener that would listen for changes in phone states.
Is this the right approach? Thanks.
David

--



How to keep a service running to listen for incoming and outgoing calls

by Mark Murphy » Thu, 07 Oct 2010 06:56:11 GMT


 


That is redundant. ACTION_PHONE_STATE_CHANGED reports the same events
as the PhoneStateListener. Just use the ACTION_PHONE_STATE_CHANGED
BroadcastReceiver. You should not need a Service.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

_Android Programming Tutorials_ Version 3.0.1 Available!

--


Sponsored Links


How to keep a service running to listen for incoming and outgoing calls

by Kumar Bibek » Thu, 07 Oct 2010 13:52:02 GMT


 Yeah. This is fine I guess. Are you stuck somewhere?




>