任何人都可以指导我如何从Android浏览器启动我的Android应用程序?
有没有办法检查手机上当前是否注册了URL方案...使用javascript?
首先,我的问题非常类似于此,这个和这个.我想要实现的Android文档就在这里.我无法使用这些资源来使用它,所以请不要将其标记为重复,因为它不是.
我有一个网站和一个Android应用程序.用户将能够扫描包含http://mywebsite.com/map/等链接的QR码.当用户尝试打开此链接时,我希望Android向他显示一个选择器对话框,他可以选择使用我的应用程序打开该链接.如果我的应用程序没有安装,它应该进入指定的网站.
我知道当用户导航到该地址时,Chrome会通过打开选择器对话框来实现此目的.例如,尝试下载Stack Exchange应用程序并在Chrome中转到此问题.它会显示:

按照上述答案中的建议后,我在AndroidManifest.xml中添加了以下代码:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="mywebsite.com"
android:path="/map"
android:scheme="http" />
<data
android:host="mywebsite.com"
android:path="/animals"
android:scheme="http" />
<data
android:host="mywebsite.com"
android:path="/articles"
android:scheme="http" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
另外,我尝试将android:mimeType ="text/plain"添加到数据中,但它没有帮助.
问题是,当我访问http://mywebsite.com/map或http://mywebsite.com/map/时, Chrome只会打开网页而不显示选择器对话框.
我想提一下:
我试过link1,link2,link3,link4,link5,link6
以下是有关DeepLinking的所有内容
我想要的是自定义uri myapp:// some_data,打开设备中安装的本机应用程序,需要some_data初始化应用程序.
有两种方案可以单击自定义URL.
1)在SMS应用程序内,当用户点击链接时,它应自动打开已安装的,否则打开应用程序托管的googleplay商店
2)从电子邮件正文中.
我已经尝试了以上列出的所有链接,但它们都不适用于我.我对方案部分有重大问题.
这是我的AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
Run Code Online (Sandbox Code Playgroud)
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="MainActivity"
android:label="@string/app_name"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="inderbagga" />
</intent-filter>
</activity>
</application>
Run Code Online (Sandbox Code Playgroud)
这是MainActivity.java
TextView tvText=(TextView)findViewById(R.id.tvid);
if (getIntent().getAction() == Intent.ACTION_VIEW&&getIntent().getScheme().equals("inderbagga")) {
Toast.makeText(getApplicationContext(), ""+getIntent().getScheme(), Toast.LENGTH_SHORT).show();
Uri uri = getIntent().getData();
// do stuff with uri
tvText.setText(uri.toString());
}
else …Run Code Online (Sandbox Code Playgroud) 我想从电子邮件URL打开我的应用程序,基本上就像下面显示的Twitter.com示例.
电子邮件链接:

选择打开应用程序或浏览器:

点击应用程序选项后,Twitter应用程序将打开:

我尝试了以下代码,但它无法正常工作:
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="www.twitter.com" android:scheme="http"></data>
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
如果有人有正确的答案,请在这里写一些例子.
我尝试使用自己的方案从浏览器启动我的应用程序时遇到问题.
代码如下:
清单文件:
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:exported="false">
<intent-filter>
<data android:scheme="allplayer" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
Html文件:
<html>
<head>
</head>
<body>
<a href="allplayer://site.com">Test link</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
如果我点击链接,我的应用程序将无法启动.我做了很多研究,但找不到答案.
如果我用http更改allplayer一切正常.
通过此链接,我了解到不建议您使用自己的方案.这是否意味着你自己的计划不起作用?这里
的人正在使用自己的方案,从他的反馈来看,它似乎正在发挥作用.
我错过了什么吗?
我有这样的要求,类似于Android Pit app-store实现的要求.
我需要检查Android应用程序是否已使用移动网页(PHP和JS)安装在设备上,如果已安装,请立即启动应用程序.
这些是Android pit使用的中间页面.
未安装应用时 - http://www.androidpit.com/en/android/market/app-center-mobile?pname=com.ocito.laredoute
已安装应用程序时 - http://www.androidpit.com/en/qrdl/com.mobage.ww.a692.Bahamut_Android
有谁知道如何实现这个?
我正在开发一个具有自己的URI前缀的应用程序.(dchub://在这种情况下)
搜遍了所有并阅读了很多,但我有点困惑.
当有人点击dchub://浏览器中的链接时,是否可以启动我的应用程序?
到目前为止,发现了很多的例子otherway各地从您的应用中打开浏览器,但是那不是我要找的.
非常感谢,我已经想到了,现在我有点陷入下一部分.
Uri data = getIntent().getData();
if (data.equals(null)) { } else {
String scheme = data.getScheme();
String host = data.getHost();
int port = data.getPort();
}
Run Code Online (Sandbox Code Playgroud)
nullpointerexception如果我正常启动应用程序,我会得到一些,如果我从网页打开它可以正常工作.所以我想包括一些检查nullvalue但是没有解决它.任何建议我如何才能通过选择它来启动应用程序?
因此,我正在制作移动应用,并希望使用相同的URL进行在iOS和Android中激活内容的链接.我知道怎么做了.我对android的意图是这样的:
<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:host="activity.action android:scheme="myapp"/>
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
我的问题是当我去测试这个并且想在电子邮件myapp中做一个超链接://activity.action在android上的gmail中不被识别为url并显示为纯文本.有没有办法来解决这个问题?如何将gmail识别的非标准架构作为链接?
我正在为我的Android手机创建一个rss聚合器.我希望能够从浏览器订阅RSS订阅源,因为大多数网站都通过rss按钮订阅.
如何构建一个意图过滤器来接收这些链接?
这个问题类似,并展示了如何创建一个处理浏览器链接的意图过滤器: 在Android浏览器中创建一个链接启动我的应用程序?
但是,我不知道如何使它特定于rss feed.作为尝试,我尝试了这个过滤器:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:mimeType="application/rss+xml" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
我是在正确的轨道上吗?我应该过滤什么?
android ×9
intentfilter ×3
javascript ×2
deep-linking ×1
email ×1
gmail ×1
html-email ×1
hyperlink ×1
iphone ×1
jquery ×1
php ×1
rss ×1
safari ×1
twitter ×1
uri ×1
url ×1
url-scheme ×1