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?




>



Other Threads

1. Is automatic calling possible with android?

Hi,
This is my first message to community, may sound bit stupid but bear
with me as I am new to developer's list.

I want to make an application using android which does the following:

Starting Step:
Asks user to use audio file or text(English)

1. Picks a phone number at random(or based on certain query) from
database,I read that android uses sqlite
2. Makes a call to this number and plays the selected sound file OR
the entered message using Text to speech.
3. When call finishes Update the database
4. Repeats the process till application is open

I am new to Android Developer's Community.So Please tell me if it is
possible or not to make such an application and also tell me how much
time and effort will it take?Will it be easy or tough for a beginner?

Regards
Smarth

-- 

2. Pengen py EVO dan Incredible tp kantong pas2an? masuk deh hehehe

Sekitar berapa harganya bos?

2010/7/1 Vincent Wongso <vincew...@gmail.com>

> 

3. Mirink Yogya 3 Juli 2010 jam 20:00 di Kafe Jendela (gmaps: -7.758659,110.395795)

4. OOT: Pembantaian terstruktur Jerman......

5. open other apk from my activity

6. Mirink Yogya 3 Juli 2010 jam 20:00 di Kafe Jendela (gmaps: -7.758659,110.395795)

7. Video Render application using Native SurfaceFlinger APIs