码迷,mamicode.com
首页 > 移动开发 > 详细

特殊的链接:打电话,短信,email;iPhone 和Android应用

时间:2017-09-09 10:53:58      阅读:489      评论:0      收藏:0      [点我收藏+]

标签:wordpress   xxxxx   例子   通过   word   number   国际   bst   class   

下面的这篇文章主要是说,网页中的链接如何写,可以激活电话的功能。

例如,页面中展示的是一个电话号码,当用户在手机浏览器里面点击这个电话号码的时候,手机会弹出拨号的面板,或者是短信程序会启动等。

1. 打电话

在android的浏览器中,如果电话号码是 XXX-XXX-XXXX的型式的话,用户点击的时候,拨号面板会激活,但是如果不是这一特定的格式,那么拨号功能是不会启动的。其实可以通过链接的方式激活拨号面板。

(1) IPhone的写法

  • [phone_number] 就是电话号码了
 <a href="callto:[phone_number]">phone_number</a>
  • 例子:
 <a href="callto:12345678">12345678</a>

(2) Android的写法

  • [phone_number] 就是电话号码了
 <a href="wtai://wp/mc;[phone_number]">phone_number</a>
  • 例子:
 <a href="wtai://wp/mc;12345678">12345678</a>

在电话号码前面可以加上 + (加号)表示国际号码。如:

 <a href="wtai://wp/mc;+12345678">+12345678</a>

2. 短信

如果是需要调用短信的接口,可以将链接写成下面的格式:

 sms:<phone_number>[,<phone-number>]*[?body=<message_body>]

例如:

 <a href="sms:12345678">给 12345678 发短信</a> <a href="sms:12345678?body=hello">给 12345678 发送内容为"hello"的短信</a> <a href="sms:12345678,98765432?body=hello">给12345678和98765432 发送内容为"hello"的短信</a>

3. Android Market

如果希望一个链接能够激活Android市场的功能,可以把链接写成:

 <a href="market://search?q=[query]">Android Market link</a>

其中<query>就是搜索的内容,你应用的名称

例子:

 <a href="market://search?q=MyApp">MyApp</a>

4. Ovi Store
这是诺基亚Nokia的一个应用市场。

 <a href="http://store.ovi.com/content/XXXXX">MyApp</a>

XXXX就是你的应用的ID(application Id)。

5. Windows Marketplace

微软的应用市场

 <a href="http://marketplace.windowsphone.com/details.aspx?appId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">MyApp</a>

其中 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 只的就是应用的ID

6. BlackBerry App World

黑莓的应用市场

 <a href="http://appworld.blackberry.com/webstore/content/XXXXX">MyApp</a>

链接中的XXXX就是应用ID。下面这个是作者页面的URL

 <a href="http://appworld.blackberry.com/webstore/vendor/XXXX">MyApp</a>

其中的XXXX是指作者的ID

7. 地图定位GPS

 <a href="geopoint:[经度],[纬度]">我的位置</a>

例如:

 <a href="geopoint:100,23">我的位置</a>

8. 聊天工具

(1) Yahoo Messager

 <a href="ymsgr:[动作]?[用户名]&m=[消息]">Yahoo Messager</a>

[动作]有:addfriend, sendIM, call

例子:

 <a href="ymsgr:sendIM?my.account@yahoo.com">给my.account@yahoo.com发消息</a>

(2) Windows Messager (MSN)

 <a href="msnim:[动作]?contact=[用户名]">Windows Messager</a>

[动作]有:chat (聊天), add (添加成联系人), voice (语音), video (视频)
例子:

 <a href="msnim:chat?contact=my.account@hotmail.com">MSN</a>

(3) Google Talk (GTalk)

 <a href="gtalk:[动作]?jid=[用户名]&from_jid=[自己的用户名]">GTalk</a>

[动作]有:chat (聊天),call (语音)

例子:

 <a href="gtalk:chat?jid=your@gmail.com&from_jid=my@gmail.com">GTalk</a>

(4) Skype

 <a href="skype:[用户名]?[动作]">Skype</a>

[动作]有:chat, add, userinfo, voicemain

例子:

 <a href="skype:mySkypeId?chat">Skype</a>

9. Mail 邮件

就和普通的html一样使用mailto

 <a href="mailto:nobody@wordpress.com"></a> <a href="mailto:nobody@wordpress.com,no.one@wordpress.com"></a> <a href="mailto:nobody@wordpress.com?subject=Testing"></a> <a href="mailto:nobody@wordpress.com?subject=Testing mailto&cc=no.one@wrodpress.com"></a>

特殊的链接:打电话,短信,email;iPhone 和Android应用

标签:wordpress   xxxxx   例子   通过   word   number   国际   bst   class   

原文地址:http://www.cnblogs.com/yhl-0822/p/7497298.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!