tags:

views:

46

answers:

1

I would like to intercept outgoing calls and pass them to a VOIP application. I see that the Google Voice application has a feature for displaying a question before each call is actually initiated. It provides the user with the choice:

  • Initiate call via Google Voice
  • Initiate call via standard call

I would like a way to do something similar with my application (so that not all calls have to be routed through it). At the moment, I can intercept CALL events via a BroadcastReceiver, however, these are not allowed to open dialogs (thus making it possible to display the choice).

What is the best way of achieving this goal?

A: 

Your application should listen for the intent : NEW_OUTGOING_CALL

Check here: http://developer.android.com/reference/android/content/Intent.html#ACTION_NEW_OUTGOING_CALL

And once you receive the intent in a BroadcaseReceiver, call your activity through it with your activity class intent which in turn displays the dialog.

Deepank Gupta