如何实现, 浏览器点击打开 自己的程序, 类似 迅雷, 91助手等。

2013-11-01 14:55:18 +08:00
 hpze2000
就是一个下载链接, 比如已经安装 了迅雷, 他会至用迅雷打开下载,
如果没安卓迅雷, 会提示, 先安装迅雷,


这种功能不知道实现原理是如何的
3637 次点击
所在节点    程序员
14 条回复
hpze2000
2013-11-01 15:07:25 +08:00
问题补充, 如果是 安卓下 又如何实现。。
Ricepig
2013-11-01 15:09:32 +08:00
浏览器插件吧
hpze2000
2013-11-01 15:11:57 +08:00
@Ricepig 浏览器插件,不对吧, 我觉得是写入自己的协议,
但是, 没安装之前, 是如何判断, 提示 要先安装我们的软件 ,这个不懂如何实现。
inee
2013-11-01 15:12:32 +08:00
自己写的端口协议
Ricepig
2013-11-01 15:12:47 +08:00
@hpze2000 还是插件。。。js判断无法得到插件时就弹窗
qingting
2013-11-01 15:12:53 +08:00
ksky
2013-11-01 15:13:00 +08:00
开发的时候可以配置一个短链接,比如weixin://,然后你在浏览器里输入weixin://就可以调出微信了。

开发App的时候定义的。
hpze2000
2013-11-01 15:14:16 +08:00
@Ricepig 哦这样, 那如果是安卓里面 有没有思路?
hpze2000
2013-11-01 15:14:46 +08:00
@ksky 问题是, 如果还没安装微信呢 ? 这么让他弹出提醒 先安装 微信?
yangg
2013-11-01 15:16:16 +08:00
html5有这个:
navigator.registerProtocolHandler(protocol, uri, title);
Note for Chrome:
Protocol whitelist includes mailto, mms, nntp, rtsp, and webcal. Custom protocols must be prefixed with "web+".
其它这是我以前看的相关链接
http://hi.baidu.com/weforhappy/blog/item/43afabc5c0aa23a48326acd1.html
http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx
http://hublog.hubmed.org/archives/001154.html
http://updates.html5rocks.com/2011/06/Registering-a-custom-protocol-handler
http://stackoverflow.com/questions/411544/custom-protocol-in-linux
hpze2000
2013-11-01 15:43:12 +08:00
@yangg 谢谢, 参考下 ,有些 E文 有些吃力
keniusahdu
2013-11-01 16:24:53 +08:00
@hpze2000 Android用Intent。Intent intent= new Intent();
intent.setAction("android.intent.action.VIEW");
keniusahdu
2013-11-01 16:27:25 +08:00
@hpze2000 Intent intent= new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setClassName("com.android.browser","启动你的包+Activity");
startActivity(intent);
大概是这样。好久不写。记不太清。参考下吧
darasion
2013-11-01 17:22:03 +08:00
就是给浏览器注册一个协议处理程序。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/87695

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX