android:如果手机安装了app则打开一个activity,如果没有安装则去到android market如何在HTML页面实现
2014-04-04 10:46
1136 查看
在android手机访问的页面上放置一个超链接,链接指向的href是指向android手机能识别的market里面的地址
[html] view
plaincopy
<a href="market://search?q=com.lta.mytransport"><img src="../images/480x600/ico_cam.gif" /> <br />Snap & Send</a>
在AndroidManifest.xml文件中配置一个activity,该activity为:如果本机安装了此app,则打开这个activity
注意下面intent-filter里面的data标签的scheme属性和path属性,他们俩才是关键。
[html] view
plaincopy
<activity android:name=".ui.BeforeSnapActivity" android:screenOrientation="portrait" >
<intent-filter>
<data android:scheme="market" android:path="//search?q=com.lta.mytransport" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
[html] view
plaincopy
<a href="market://search?q=com.lta.mytransport"><img src="../images/480x600/ico_cam.gif" /> <br />Snap & Send</a>
在AndroidManifest.xml文件中配置一个activity,该activity为:如果本机安装了此app,则打开这个activity
注意下面intent-filter里面的data标签的scheme属性和path属性,他们俩才是关键。
[html] view
plaincopy
<activity android:name=".ui.BeforeSnapActivity" android:screenOrientation="portrait" >
<intent-filter>
<data android:scheme="market" android:path="//search?q=com.lta.mytransport" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
相关文章推荐
- android:如果手机安装了app则打开一个activity,如果没有安装则去到android market如何在HTML页面实现
- Android 如何从一个APP中打开另外一个APP,实现二者通信
- 如何实现一个只有广播和service的android应用没有activity
- 如何在android手机上实现app开机自动运行启动(可以打开应用界面)。
- Android在一个app中实现另一个app的自动安装,安装完成后自动打开(需Root)
- Android开发实践经验谈:如何让各式手机浏览器可以直接下载apk安装文件且实现自动安装APP
- 基于应用宝实现微信h5页面中打开本地app,如果没有跳转下载页面的解决方案
- 在没有个人/公司网站的情况下,如何利用同一个二维码自动识别手机系统(Android/IOS)跳转不同下载页面
- HTML5打开本地app应用的方法,如果你的手机上安装App,就会自动打app,否则在页面上会提示你进行下载app
- 如何打开APP在应用市场中对应的的activity页面---Android拓展篇
- 在页面中,我们经常看到,一个button按钮,如果属标点击,就会触发一个窗口的显示,如果二次点击并可以隐藏,那么如何通过JAVA配合html来实现这一功能呢?
- 如何把同一个Android项目同时安装到手机上--Android系统如何区分不同app
- android/iPhone:如何从browser直接打开应用程序或者打开应用商店(如果没有应用程序)
- (转)获取android手机内部存储空间和外部存储空间的参数 && 如何决定一个apk的安装位置
- 一个APP唤醒另一个App,如果这个App没有安装,则提示未安装或立即下载
- android获取手机内部存储空间和外部存储空间 && 如何确定一个应用的安装位置
- iOS 一个app跳转另一个app并实现通信(如A跳到B并打开B中指定页面)
- 在Android开发当中如何在一个app中打开淘宝app
- android中一个activity实现多个xml页面互换。
- 一个嵌入式web服务器项目,实现通过手机Android App实现对嵌入式设备的控制