Digit dial during phone call - Android - android

Is it possible to dial a digit during a phone call via code?
After having started a phone call by an app of course.
For example:
String uri = "tel:999999999";
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(uri));
startActivity(intent);
And now I want to dial some numbers during the call, is it even possible?

Related

How to WhatsApp Call without saving number manually

I am trying to write a code to whatsapp call a mobile number, without saving it to the phonebook.
I have written the code as:
Intent callIntent = new Intent("android.intent.action.MAIN");
callIntent.setComponent(new ComponentName("com.whatsapp", "com.whatsapp.Conversation"));
callIntent.putExtra("jid", "19876543210#s.whatsapp.net");//phone number without "+" prefix
callIntent.putExtra(Intent.EXTRA_TEXT, "voip-call");
callIntent.putExtra("call", true);
callIntent.setAction(Intent.ACTION_CALL);
callIntent.setPackage("com.whatsapp");
startActivity(callIntent);
But it is not working.
Any sort of help would be beneficial for my learning.

Call number in England with no international-prefix on a phone with a German Sim

At the moment I receive a phone number from a the backend and use this in an intent so the user can call the number.
Intent callIntent = new Intent(Intent.ACTION_DIAL);
TaxiItemView taxiItemView = (TaxiItemView) view;
callIntent.setData(Uri.parse("tel:" + taxiItemView.getPhoneNumber()));
startActivity(callIntent);
I don't receive an international-pre-fix so what would happen in this case? If a user is in a different country than the sim in the phone, and then they dial a number without the international pre-fix. Does the phone take the prefix of the country it is in or does it use the pre-fix of the simcard?
Do I need to append the correct pre-fix on this number to ensure the correct number is called?

Android Action_Call intent

Am developing functionality in which i wanted to Intent.ACTION_DIAL.
Below is the code which i have tried so far.
Intent callIntent = new Intent(Intent.ACTION_DIAL);
String str = "tel:xxxxxxxxxx"; callIntent.setData(Uri.parse(str));
context.startActivity(callIntent);
However facing below two problems
1) if i tried to retrieve the imei number using "tel:#06#" then it will open the device dialer with '' only. "#06#" is not appearing there.
2) It asks the user to press call button. I dont want user to press the call button. is there any API which will allow me to directly execute "tel"*#06# kind of code from application itself.
EDITED:
I have tried below answer. its invoking dialer with "*#06#" but not showing the IMEI number of the device. if i press the same from device dialer and it showing IMEI number instantly.
All i want is to show the IMEI kind of codes from Application.
Intent callIntent = new Intent(Intent.ACTION_CALL);
String encodedHash = Uri.encode("#");
String ussd = encodedHash + "06" + encodedHash;
startActivityForResult(new Intent("android.intent.action.CALL",
Uri.parse("tel:" + ussd)), 1);
and give this permission in android menifest
<uses-permission android:name="android.permission.CALL_PHONE" />

How open function call phone but don't set phone number default

I want open function call phone of android but don't set phone number default as
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:09340125465"));
startActivity(callIntent);
I want to open call phone and after input phone number.
Hope you me. Thanks.
Use this code:
Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:"));
startActivity(callIntent);

Calling a USSD number without opening the phone app in Android

I am trying to call a USSD number from my application like this:
Uri u = Uri.fromParts("tel", "*110#", "");
Intent i = new Intent(Intent.ACTION_CALL, u);
startActivity(i);
This makes the phone app launch and call the number.
What I want is to call the USSD number without opening the phone app or atlease open it up in the background.
If the user is doing something, then he should not be disturbed. Only a notification must be generated.
any suggestions?
it is possible now since android O(api 26) with sendUssdRequest() check the docs https://developer.android.com/reference/android/telephony/TelephonyManager.html#sendUssdRequest(java.lang.String,%20android.telephony.TelephonyManager.UssdResponseCallback,%20android.os.Handler)

Categories

Resources