stop android emulator call

Posted by Shahzad Younis on Stack Overflow See other posts from Stack Overflow or by Shahzad Younis
Published on 2011-04-20T07:17:05Z Indexed on 2011/06/27 16:22 UTC
Read the original article Hit count: 241

Filed under:
|

I am working on an Android application, having functionality like voicemail.

I am using BroadcastReceiver to get dialing events. I have to get the event "WHEN CALL IS UNANSWERED (not picked after few rings) FROM RECEIVER". I will do some actions on caller end against this event.

I am using AVD emulator, and

I do call from one instance to another instance and it calls perfectly, but the problem is: It continuously calls until I reject or accept the call. This way I cannot detect that "CALL IS UNANSWERED AFTER A NUMBER OF RINGS".

So I want the Caller emulator to drop the call after a number of rings (if unanswered) like a normal phone.

I can do it (drop the call after some time) by writing some code, but I need the natural functionality of phone in the emulator.

Can anyone please guide me? Is there any settings in the emulator? Or something else?

The code is shown below in case it helps:

public class MyPhoneReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) 
    {
        Bundle extras = intent.getExtras();
        if (extras != null) 
        {
            String state = "my call state = " + extras.getString(TelephonyManager.EXTRA_STATE);
            Log.w("DEBUG", state);
        }

    }

© Stack Overflow or respective owner

Related posts about android

Related posts about emulator