Dial number without prompt - android

I'm trying to write a function for the Android platform that will allow me to call 911 without any sort of prompt.
I have already added the permission android.permission.CALL_PRIVILEGED. I just need a function that will dial 911 at the press of a button in my options menu.

According to the API, ACTION_CALL will do what you need but not to emergency numbers, while ACTION_DIAL will display a dialer with the dial prompt but allows to call emergency numbers.
I'm afraid there is no way to do what you want, for a good reason - to prevent misdials to emergency services. It's a precautionary measure.

Related

how to know the number clicked on the numeric keypad of the caller during a phone call (flutter, android or ios)

We are in the process of developing a fluttering mobile application.
Here is what we need:
We receive a phone call in our application.
I pick up the incoming call.
The caller will click on number 5.
I wanted to know which number button was clicked by the caller during the incoming call.
Is there a way to detect which button the caller clicked in flutter, android or ios.
I appreciate any positive response.
There's no API to do that in Android. Possibly you could use the microphone to listen for the DTMF sound (the beep of the key on the line), but its unlikely to pick it up. This just isn't supported. Also in Android you can replace the default dialer, so even if the default one had an API for this, there's no way to assure a replacement does.

Is it possible to dial numbers programatically on the dialer while on an active call..?

I have been recently working on an app which requires to respond to an Automatic attendant (virtual receptionist) which allows callers to be automatically transferred to an extension without the intervention of an operator/receptionist.
My requirement is such that to make a scheduled phone call to a particular number and to respond to the Automatic attendant instructions ("for sales, press 1, for service, press 2," etc)
Is it possible to achieve similar action that i could otherwise achieve by responding to the system manually by pressing an option (say 1 or 2 from above example) programmatically while the call is still active.
Any help is appreciated.
There's no way to do this. There isn't an API, and since the dialer is not part of the OS and can be any app, you can't count on anything working on all devices.
The best chance you have is to assume the dialer will accept USSD input (USSD is an ancient telephony protocol for sending data to phones). In the USSD language, a comma is a pause. SO if you want to dial a number, than 1 at the prompt you could ask it to dial "number,,,,1" and hope that the dialer accepts USSD input and that the pause is long enough to dial the 1 at the right time. But it will work on only a subset of all devices, and be fragile there.

Can I suppress Send SMS option when calling ACTION_DIAL intent

My team is developing an Android app that includes the ability to call and talk to customer support. We are calling an Intent with ACTION_DIAL, which brings up the dialer with the phone number pre-populated, as expected. In the device emulator, we also see links to Create a new Contact and Add to a Contact, which are fine, but we want to suppress the Send SMS link, since there is no way for us to read messages sent to that number. Ideally, I'd like to be able to pass a parameter or change a setting that disables SMS messaging for that one invocation, but I'm open to other solutions. Searches that I've done haven't turned up anything.
Thanks in advance,
Dan
No. There's no way of knowing what dialer is being launched for action dial- OEMs all have the option of using their own, or the user can even download one of their own. There's no way of knowing what options those dialers support, and definitely no way of configuring them. Even if there was, a dialer app could ignore the configuration. You may want to use ACTION_CALL instead, which requires additional permissions but will directly call without bringing up a prefilled dialer.

android bypass app chooser

I understand that Android does not allow you to call an emergency number (911) directly. So I have decided to use Intent.ACTION_DIAL instead to leave the app and have the number pre-dialed, ready to call. However, the app chooser appears when I hit my 'Dial 911' button, adding another unnecessary step to the process (the other option besides the Phone app is to scan the number using Lookout Security).
Is there anyway to bypass the app chooser by pre-defining the app to handle the Intent?
There are many possible dialers. You have no good way of determining a priori which is the "one true dialer" that the user wants to use. Moreover, the user should be able to click "Always" on the chooser and therefore only encounter this once.
If you want, you could allow the user to choose their dialer up front, perhaps as part of configuring your app. You can use PackageManager and queryIntentActivities() to find out what all supports ACTION_DIAL, presenting that to the user to choose from. You would remember the ComponentName of their choice, and add that ComponentName to the ACTION_DIAL Intent that you use "for realz" when the user presses the button in your app.

Bypass dialer to make a call with pre-defined phone number

I need to figure out how to harness the power of the CALL_PRIVILEGED Permission in my app.
The basic layout is that when I activate the code it just goes to the Dialer with the number preloaded.
How do i bypass the dialer and just make the call?
You want your app to make a direct call?
Take a look at Intent.ACTION_CALL (ACTION_DAIL will show the number before calling).
EDIT: ACTION_CALL won't call emergency numbers.
Actually this changed from version to version of Android, so it could be that it works with 2.1 but not with 4.0.
Wolfen

Categories

Resources