To make a phone call via HTML on an iPhone I create an <A/>
tag with an href formatted as: <a href='tel:123-555-1212'>Dial Me</a>
.
Is there an equivelant for HTML on Android?
CLARIFICATION - using the format href='tele:123-555-1212' does indeed work on on android. I was testing the app within a native Java wrapper on the device. It does not appear as if we can make a call from a web application hosted in a Native Wrapper.
“Tel: 123-456-7890 “creates the HTML phone number. The number within the quotes is the number it will call. The number within the >< tags is the visual portion and it can be anything you want it to be including the phone number, a line of text such as “Click to Call” or “Call Now”, or any other call to action you want.
You can make phone calls from the Phone app and other apps or widgets that show your contacts. Wherever you see a phone number, you can usually tap it to dial. You may be able to tap underlined phone numbers in Google Chrome to copy the number to the dialpad.
The HTML <a> element (or anchor element), along with its href attribute, creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL. […] Offering phone links is helpful for users viewing web documents and laptops connected to phones.
Yes you can; it works on Android too:
tel: phone_number
Calls the entered phone number. Valid telephone numbers as defined in the IETF RFC 3966 are accepted. Valid examples include the following:* tel:2125551212 * tel: (212) 555 1212
The Android browser uses the Phone app to handle the “tel” scheme, as defined by RFC 3966.
Clicking a link like:
<a href="tel:2125551212">2125551212</a>
on Android will bring up the Phone app and pre-enter the digits for 2125551212 without autodialing.
Have a look to RFC3966
I have just written an app which can make a call from a web page - I don't know if this is any use to you, but I include anyway:
in your onCreate you'll need to use a webview and assign a WebViewClient, as below:
browser = (WebView) findViewById(R.id.webkit); browser.setWebViewClient(new InternalWebViewClient());
then handle the click on a phone number like this:
private class InternalWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.indexOf("tel:") > -1) { startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse(url))); return true; } else { return false; } } }
Let me know if you need more pointers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With