Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I make a phone call from HTML on Android?

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.

like image 521
Kevin Avatar asked May 05 '10 14:05

Kevin


People also ask

How do I make a phone call using HTML?

“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.

Can I make a phone call from my Android?

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.

What is call HTML?

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.


2 Answers

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

like image 185
systempuntoout Avatar answered Oct 09 '22 23:10

systempuntoout


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.

like image 34
Martyn Avatar answered Oct 09 '22 23:10

Martyn