Sky_Monkey / blog_20140404_1_2802286

来自CSDN博客:通过网页的JS代码启动移动APP http://blog.csdn.net/Sky_Monkey/article/details/22938125#

  android xml app 最后更新时间 2014-04-04 17:14:50
blog_20140404_1_2802286 28行 PHP
Raw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
<span style="font-size:18px;"><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></span>
blog_20140404_2_5735652 10行 html/xml
Raw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
<span style="font-size:18px;"><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></span>