Reject a phone call in Android Java - android

Is there an easy way to reject a phone call in my application?
I am writing an application and I want it to reject an incoming phone call automatically.
Is there a way to do it without making the application the default call application?
Thank you.
I am writing a new application and I am a newbie so I don't know exactly where to start.
I already have something that detects the phone call and gives me the calling number. It was easy but I don't know how to reject that call.
Help. and thank you.

Related

Can my android app end the call programmatically?

I want to make an app that forcibly ends a call by recognizing a specific word when I am on a call.
So, So there are a few questions.
Can the app detect that it is on the phone and end the call if it is on the phone?
Which API should I use?
Is it possible to activate the voice recognition function while on a call?
When I searched, there was a lot of question to hang up the incoming call. But i want to hanu up on a call.
You can use TelephonyManager#getCallState to detect if phone is in call and use TelecomManager#endCall to end active call.

Twilio - how to open activity when calling web to phone

I have implemented the Twilio in my app and have made it so that web to web calls can be made and also web to phone calls. The only thing is that if I call Voice.call() with my user's phone number, it'll call him but the call will not open my activity on his device. The phone call UI will be the default decide's UI for incoming calls. If I, on the other hand, use the user's defined identity on his device, it'll go nicely via my activity.
Any ideas on how I can make the web to phone call using a phone number and redirect the call via my activity?
I have been unable to find any documentation in this regard.
Cheers!
Twilio developer evangelist here.
It's not the job of the Twilio SDK to intercept phone calls made directly to the device. However, since Android is flexible enough to replace the default phone application, you can do this yourself.
I am not an Android developer however, but a quick search around lead me to this tutorial on using a BroadcastReceiver to run your own code when an incoming phone call occurs. This StackOverflow answer might help you get started too.
Hope that helps.

Is it possible to make a call from code, and then send keypress events to the dialler?

OK I want to be able test internal phone systems in an automated fashion using an Android app, the requirements are asking for an app which can initiate a call programatically. If this is possible then when the call starts they wish to be able to send key presses, like imagine the phone menu says "press 5 to get to the X menu".. can we send that keypress from code? This way the whole system could be tested with a series of waits, and keypresses sent to the dialler.
I'm not sure how to find out if this is actually possible.. I saw PROCESS_OUTGOING_CALLS, but I havent been able to find any resources or examples on doing this, does anyone have any information? I actually got in touch with a freelancer who ended up saying it was definitely not possible (he's pretty good and he simply said 'pressing dialpad during call was impossible'), but my client is telling me apps already exist to do this, so any tips would be helpful!..
You can definitely make a call from code. See:
How to make a phone call programmatically?
You can invoke key presses from code as well:
Invoke keypress event in android?
As for doing it during a call, I haven't tried this, But you can try it using the methods from the links. Good luck!

Replace default Screen of android incoming and outgoing calls

I am working on android. when a calls comes in, I want to replace the default android call screen with a new screen that has answer and deny call options. How can I do that? Need some help. Any help appreciated.
Do I have to use a toast message for this?
I do have the incoming and outgoing classes.
As far as my understanding goes it is not possible to replace the call screen with an App that is installed over the Marketplace.
To do this you would at least require root permissions. Maybe you also need to reconfigure the Android Version installed on the phone.

Is it possible to run web service on the android phone?

I just want to know is it possible to write an app (maybe a service on the background) on the android whose function works like a web service which means that when another app sends a request to the localhost and specific port, the app could give a reply and execute some functionalities? Is it possible? Anybody has some ideas about that?
It's certainly possible. Check this for example: http://code.google.com/p/i-jetty/

Categories

Resources