下面是我用我的網頁內容。它基於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