Link formats
| Action | Link |
|---|---|
| Call | tel:+15551234567 |
| SMS | sms:+15551234567?body=Hello |
mailto:hi@example.com?subject=Order&body=Hello | |
| WhatsApp chat | https://wa.me/15551234567?text=Hello |
| Directions | https://maps.google.com/?q=12+Harbour+Street or geo:0,0?q=12+Harbour+Street |
| Share text | navigator.share({ text, url }) where supported |
Phone numbers go in international format. For wa.me, use digits only — no plus sign, spaces or dashes. Encode message text with encodeURIComponent().
How the hand-off works
A WebView can only display web pages. When a link uses a scheme it can't show (tel:, mailto:, geo:…), a well-built app shell catches it and asks Android to open the matching app. https://wa.me and Maps links are normal web addresses that Android hands to the WhatsApp or Maps app when installed.
External websites
Links to other websites may open inside your app or in the phone's browser, depending on the shell and its settings. For links you definitely want outside the app — payment pages, social profiles, long articles — use target="_blank", which most shells treat as "open externally". Test the behaviour you need after building.
Testing checklist
- Tap every call, email, WhatsApp and map button on a real phone.
- Try a phone without WhatsApp installed —
wa.meshould fall back to a web page. - Check that pressing Back after the hand-off returns to your app.
The restaurant menu and product catalogue blueprints include working examples.
Build links safely in JavaScript
function waLink(number, message) {
const digits = number.replace(/\D/g, ''); // "+1 (555) 010-4567" → "15550104567"
return 'https://wa.me/' + digits + '?text=' + encodeURIComponent(message);
}
function mailLink(to, subject, body) {
return 'mailto:' + to + '?subject=' + encodeURIComponent(subject) +
'&body=' + encodeURIComponent(body);
}
Always encode message text — an unencoded & or # cuts the message short.
Make contact buttons obvious
- Use a full-width button with a clear verb: "Call to book", "Order on WhatsApp", "Get directions".
- Show the number or address as text too, so users can copy it.
- Put the most important action within thumb reach, near the bottom of the screen.
The product catalogue blueprint builds a WhatsApp order message with quantities and a total — open its live preview and add an item to see the link it creates.
Questions
Do tel: links work in an Android WebView app?
Yes, when the app shell hands non-web links to Android. Test on a phone after building.
What is the WhatsApp link format?
https://wa.me/ followed by the number in international format with digits only, then ?text= and URL-encoded message text.
How do I make a link open in the browser instead of the app?
Use target="_blank"; most WebView shells open those links externally. Confirm on a phone.