少扯淡,直接上代码:
<script>
function startAPP(){
window.location = "**://**.**/**";
}
function downloadAPP(){
window.location = "http://IP/**/**.apk";
}
</script>
<style type="text/css">
body{background:#D2D460;text-align:center;margin-top:10%}
div{width:100%;margin:0 auto;background:#fff;text-align:left;}
</style>
</head>
<body>
<?php
$var_name = $_GET["isappinstalled"];
if ($var_name=="1"){
echo '<img src=images/start.png alt=打开APP onclick=startAPP() ></img>';
}else if ($var_name=="0"){
echo '<img src=images/download.png alt=打开APP onclick=downloadAPP() ></img>';
}else{
echo '<img src=images/welcome.png alt=打开APP onclick=startAPP() ></img>';
}
?>
</body>
在app里面需要做以下设置(一般是在manifest.xml文件的activity的 intent filter里面)
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="**"
android:host="**.**"
android:pathPrefix="/**">
</data>
</intent-filter>
本文介绍了一种通过PHP判断是否已安装特定App的方法,并根据不同情况引导用户启动或下载App。此外,还提供了在App中配置相应Intent Filter的示例。
930

被折叠的 条评论
为什么被折叠?



