下面是我用我的网页内容。它基于JavaScript和jQuery。这个想法是搜索浏览器的用户代理内部对“Android”的子字符串,如果是这样的话 - 与Android市场URI部分取代HTTP URI的一部分,各个环节里面:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
updateAndroidMarketLinks();
// some more core here ...
function updateAndroidMarketLinks()
{
var ua = navigator.userAgent.toLowerCase();
if (0 <= ua.indexOf("android")) {
// we have android
$("a[href^='http://market.android.com/']").each(function() {
this.href = this.href.replace(/^http:\/\/market\.android\.com\//,
"market://");
});
}
}
});
</script>
</head>
<body>
<a href="http://market.android.com/details?id=com.google.earth" target="_blank">Download for Android</a>
</body>
</html>
只需检查此链接:http://developer.android.com/guide/publishing/publishing.html#marketintent,以示例方式给出所有内容。 – 2011-08-23 11:14:00
http://developer.android.com/distribute/tools/promote/linking.html – 2014-12-11 07:52:28