I think I need an Android app to this: I want to dial a number from a website like [a href="tel://0776547654"] This works, but it only transfers the number to the dialing app of the smartphone, it does not dial the number, which is exactly what I need. If that is not possible, I need an app, that registers with a new protocol for ex. 'directcall://' instead of tel:// and the app dials the number immediately instead of just transferring it. Is it really necessary to make an app to achive what I want?
3 Answers
The tel URI does not provide a possibility to automatically dial the number, without user interaction. See RFC 3966 for reference:
Web clients and similar tools MUST NOT use the "tel" URI to place telephone calls without the explicit consent of the user of that client. Placing calls automatically without appropriate user confirmation may incur a number of risks...
Therefore yes, you will need to implement your own app that does not comply with the standard, if you want to achieve such behavior.

- 1
- 1

- 194
- 2
- 6
-
Thanks, I highly appreciate your time. In my soon-to-be app, will I have a problem registering a new protocol of my own( directcall://[number] ) ? Or can I more easily subscribe to [tel:] or [callto:] to be achieve my goal? – mousefighter Jul 18 '20 at 21:31
-
I think most browsers will open tel: with the standard dialer app and I recommend to not try to change this behavior as it breaks user expectations for all tel: URIs, not just those on your website. Therefore, it's probably easier to create your own prefix and add it to your AndroidManifest.xml, as described here: https://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-scheme-on-android – TobiWestside Jul 19 '20 at 12:05
it only transfers the number to the dialing app of the smartphone
The behavior of a URL will depend on the browser. There are dozens of browsers for Android, and their behavior may vary.
it does not dial the number
That requires the CALL_PHONE
permission. Few browser developers will request that, as it is a dangerous
permission.
I need an app, that registers with a new protocol for ex. 'directcall://' instead of tel:// and the app dials the number immediately instead of just transferring it
You are certainly welcome to write such an app, convince people to install it, and then convince those people to also grant your app the CALL_PHONE
permission.
Is it really necessary to make an app to achive what I want?
You could try various Web browsers for Android and see if one offers some sort of direct-call option.

- 986,068
- 189
- 2,389
- 2,491
-
Thanks a million for your attention. I might find a browser that does direct-call, but if I need my users to install something specific, it might as well be my own app. I also need hang up and a URL call upon incoming call accepted. So I think my biggest challenge will be for play store to accept my submission, being very simple, and I dont know if there is a category for it?.......utilities .? – mousefighter Jul 18 '20 at 21:32
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:1234567890"));
startActivity(intent);
and in manifest you need
<uses-permission android:name="android.permission.CALL_PHONE" />
You need these in app if you decide to make an app!
And you need to explicitly allow permission to call from app info in mobile or write a code that requests for permission. but it is suggested that you don't use direct call, instead use ACTION_DAIL that will be a safer and recommended move!
And same for the website also, It is recommended that you don't use directcall://. As it is considered as dangerous to use.

- 390
- 2
- 14
-
Hi there. directcall:// is my own suggestion of a name, anything wrong with that? I think you mean it is unsafe, if there is no chance for the user to see the number before dialing, right? – mousefighter Jul 18 '20 at 21:30
-
What I am saying is if you want to use direct call, you can use it for sure. I gave you the code for android and for web you must be having it already, but it is not considered safe for users as user will expect that when he click on call button he should get to phone keypad with the number and not directly call. This is considered as bad user experience! I hope you would understand my point! – Rajnish Sharma Jul 19 '20 at 06:15
-
yes yes, I understand your point, but understandably you dont know what MY users expect. They want the direct call, they need it. My software is a CRM system where they call around 100 numbers every day. You see now why they want it and really need it? I wonder why you want to decide for me what my users want. – mousefighter Jul 19 '20 at 18:08
-
oh by the way, thank you for the code, I didnt have it and I will need it. – mousefighter Jul 19 '20 at 18:10
-
No problem! You can give an upvote for that, it will be appreciated! – Rajnish Sharma Jul 20 '20 at 05:32
-
I would if I could, my reputation is not high enough to give votes :-( – mousefighter Jul 20 '20 at 15:33
-
LOL you don't need reputation for that! but if you don't want to...then its other case! – Rajnish Sharma Jul 20 '20 at 15:40