receive notification for outgoing call by application

Put your problem here if it does not fit any of the other categories.

receive notification for outgoing call by application

Postby kartik_trivedi » Thu Jul 02, 2009 7:40 am

I was reading PhoneStateListerner and TelephonyManager's but i came to know that i can only know the state of the incoming call. Is it true ? I want notification when the receiver receive the call from opposite side. So can some one tell me how can i do it ?
Sun Certified Java Developer
Forum Nokia Champion
kartik_trivedi
Developer
Developer
 
Posts: 28
Joined: Tue Jan 20, 2009 7:19 am

Top

I don't think so.

Postby codevalley » Tue Jul 07, 2009 6:40 pm

You can get notification for phonestate changes like
TelephonyManager.CALL_STATE_OFFHOOK-> When call taken/ or call placed.
TelephonyManager.CALL_STATE_IDLE-> idle state, after call finished, before call started
TelephonyManager.CALL_STATE_RINGING -> when you receive an incoming call.

With this you can identify all scenarios like incoming call/missed call/ outgoing call etc.
http://thecodevalley.com
Your daily byte of technology.
codevalley
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sun Jul 05, 2009 5:37 am
Location: India

Re: I don't think so.

Postby kartik_trivedi » Wed Jul 08, 2009 5:08 am

codevalley wrote:You can get notification for phonestate changes like
TelephonyManager.CALL_STATE_OFFHOOK-> When call taken/ or call placed.
TelephonyManager.CALL_STATE_IDLE-> idle state, after call finished, before call started
TelephonyManager.CALL_STATE_RINGING -> when you receive an incoming call.

With this you can identify all scenarios like incoming call/missed call/ outgoing call etc.


Thanks for your reply. Actually TelephonyManager.CALL_STATE_OFFHOOK is working for incoming call but not working for outgoing call. I can give you my code if you want to test. And let me know if you have tested any code and which is working for outgoing call.
Sun Certified Java Developer
Forum Nokia Champion
kartik_trivedi
Developer
Developer
 
Posts: 28
Joined: Tue Jan 20, 2009 7:19 am

Postby pose » Wed Jul 08, 2009 2:58 pm

You could use a BroadcastReceiver for reacting to outgoing calls.

Register the the BroadcastReceiver with the correct filter:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.                 IntentFilter filter = new IntentFilter();
  3.  
  4.                 filter.addAction(android.content.Intent.ACTION_NEW_OUTGOING_CALL);
  5.  
  6.                 registerReceiver(mOutgoingCallReceiver, filter);
  7.  
  8.  
Parsed in 0.029 seconds, using GeSHi 1.0.8.4

Handle the broadcasts for outgoing calls:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         private BroadcastReceiver mOutgoingCallReceiver = new BroadcastReceiver() {
  2.  
  3.  
  4.  
  5.                 @Override
  6.  
  7.                 public void onReceive(Context context, Intent intent) {
  8.  
  9.                         mOutgoingNumber = PhoneUtil.checkAndFormatNumber(intent
  10.  
  11.                                         .getStringExtra(Intent.EXTRA_PHONE_NUMBER));
  12.  
  13.                 }
  14.  
  15.         };
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
pose
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Jul 08, 2009 9:29 am

Postby kartik_trivedi » Wed Jul 08, 2009 3:39 pm

pose wrote:You could use a BroadcastReceiver for reacting to outgoing calls.

Register the the BroadcastReceiver with the correct filter:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 IntentFilter filter = new IntentFilter();
  2.                 filter.addAction(android.content.Intent.ACTION_NEW_OUTGOING_CALL);
  3.                 registerReceiver(mOutgoingCallReceiver, filter);
  4.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4

Handle the broadcasts for outgoing calls:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         private BroadcastReceiver mOutgoingCallReceiver = new BroadcastReceiver() {
  2.  
  3.                 @Override
  4.                 public void onReceive(Context context, Intent intent) {
  5.                         mOutgoingNumber = PhoneUtil.checkAndFormatNumber(intent
  6.                                         .getStringExtra(Intent.EXTRA_PHONE_NUMBER));
  7.                 }
  8.         };
Parsed in 0.034 seconds, using GeSHi 1.0.8.4



Thanks for your reply..

But by the above code i will be nnotified when the call starts i want notification when outgoing call becomes active in other words when outgoing call picked up by other side. So can i do that thing by any broadcast ?
Sun Certified Java Developer
Forum Nokia Champion
kartik_trivedi
Developer
Developer
 
Posts: 28
Joined: Tue Jan 20, 2009 7:19 am

Postby jojolafrite » Mon Nov 09, 2009 11:50 am

Hi,
I would like to get the Phone Label (i.e. Type of phone call : Home, Work ...) of the contact being called.
Is is possible ? If so how to achieve this ? If not possible, I would also like to get the name of the caller, in order to achieve find the label of this contact phone number using cursors abd Contacts.People.Phones.LABEL Uri.
Thanks
jojolafrite
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Nov 09, 2009 11:45 am

Top

Postby Quelle » Mon Mar 22, 2010 11:13 am

kartik_trivedi wrote:
pose wrote:

Thanks for your reply..

But by the above code i will be nnotified when the call starts i want notification when outgoing call becomes active in other words when outgoing call picked up by other side. So can i do that thing by any broadcast ?


Me too!
Quelle
Developer
Developer
 
Posts: 34
Joined: Thu Mar 11, 2010 10:53 am

Re: receive notification for outgoing call by application

Postby gaurav.jain » Mon Jun 21, 2010 8:35 am

I want notification when outgoing call becomes active in other words when outgoing call picked up by other side.
Please suggest on this, if there is any possible way to get the outgoing call picked up info.


Thanks,
Gaurav
gaurav.jain
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Jun 21, 2010 8:30 am

Re: receive notification for outgoing call by application

Postby Chitra » Wed Jun 23, 2010 6:17 am

yeah correct... We have only three states.... By using these we can't identify outgoing call is picked or not.....me also waiting for this solution...... Plz help us....
Thanks,
Chitra
User avatar
Chitra
Master Developer
Master Developer
 
Posts: 213
Joined: Mon Mar 01, 2010 7:59 am
Location: Bangalore

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 14 guests