1.例如我们现在有一个html页面如下:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<a href="myschele://openapp.com/">打开App</a>
</body>
</html>
2.接下来我们在本地app的AndroidMainfest中配置
<data android:host="openapp.com" android:scheme="myschele"/><activity android:name=".MainActivity">
<intent-filter>
</intent-filter>
</activity>
3.然后使用“手机浏览器”或者“webview”的方式打开这个本地的html网页,点击“打开APP”即可成功开启本地的指定的app
4.传递数据:
web端:如同get请求方式
<a href="myschele://openapp.com/?arg0=param0&arg1=param1">打开App</a>
Android客户端:
Uri uri = getIntent().getData(); String test1 = uri.getQueryParameter("arg0"); String test2 = uri.getQueryParameter("arg1");