1、首先做成HTML的内容,url格式如下:<a href="[scheme]://[host]/[path]?[query]">点我</a>1说明:schema: 判断启动的Apphost: 标记path: 标记,可无query: 传值的(key,value)键值对,可无
2、例如:<a href="myapp://jp.app/openwith?name=zhangsan&age=26">启动应用程序</a>
3、本例中做如下超链接跳转:<a href="finance://pay.com/mpos?orderId=1020160126"> Open APP </a> 1其中:schema —- finance 对应Android中 android:schemahost --- pay.com 对应android中 android:host
4、path --- mpos 对应android中 android:pathPrefixquery 幻腾寂埒--- orderId=1020160102 为Html链接和APP相互传递的数据,可以在Uri中通过getQueryParameter 方法获取全部Html源码:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>mpos</title>
5、<meta name="viewport" content="width租涫疼迟=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0"> <meta name="imagemode" content="force"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="format-detection" content="telephone=no"> </head> <body> <h1>H5打开APP</h1> <a href="finance://pay.com/mpos?orderId=102016000"> Open APP </a> </body> </html>