如何当RSS链接在浏览器中打开打开我的Andr​​oid应用程序? [英] How to open my Android app when rss link is opened in browser?

查看:118
本文介绍了如何当RSS链接在浏览器中打开打开我的Andr​​oid应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建RSS聚合我的Andr​​oid手机。我希望能够订阅RSS订阅源从浏览器,因为大多数网站都通过RSS按钮订阅。

I'm creating an rss aggregator for my Android phone. I'd like to be able to subscribe to an rss feed from the browser since most websites have a subscribe via rss button.

如何建立一个意图过滤器来接收这些链接?

How can I build an intent filter to receive those links?

这个问题是相似的,并展示了如何创建一个意图过滤器来处理浏览器链接: <一href="http://stackoverflow.com/questions/3469908/make-a-link-in-the-android-browser-start-up-my-app">Make在Android浏览器链接启动我的应用程序?

This question was similar and showed how to create an intent filter to handle browser links: Make a link in the Android browser start up my app?

不过,我不知道如何使它具体的RSS源。 作为一种尝试,我试过这个过滤器:

However, I don't know how to make it specific to rss feeds. As an attempt I tried this filter:

        <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>

我是在正确的轨道?我应该怎么过滤呢?

Am I on the right track? What should I be filtering on?

推荐答案

原来有很多不同的方式播客可以进行设置,以便每一个意图过滤器将只对其中的一些。很多不同的过滤器的需要使用以获得所需的效果超过最订阅链接

Turns out there's a lot of different ways podcasts can be set up so each intent filter will only work for some of them. A lot of different filters need to be used to get the desired effect over most subscribe links.

下面是一些过滤器,我发现工作:

Here's some of the filters I found that worked:

<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="itpc" />
                <data android:scheme="pcast" />
                <data android:scheme="feed" />
                <data android:scheme="rss" />
            </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="http" android:host="*"
                    android:pathPattern=".*xml" />
                <data android:scheme="http" android:host="*"
                    android:pathPattern=".*rss" />
                <data android:scheme="http" android:host="*"
                    android:pathPattern=".*feed.*" />
                <data android:scheme="http" android:host="*"
                    android:pathPattern=".*podcast.*" />
                <data android:scheme="http" android:host="*"
                    android:pathPattern=".*Podcast.*" />
                <data android:scheme="http" android:host="*"
                    android:pathPattern=".*rss.*" />
                <data android:scheme="http" android:host="*"
                    android:pathPattern=".*RSS.*" />
            </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:mimeType="text/xml" android:scheme="http" />
                <data android:mimeType="application/rss+xml" android:scheme="http" />
                <data android:mimeType="application/atom+xml" android:scheme="http" />
            </intent-filter>

这篇关于如何当RSS链接在浏览器中打开打开我的Andr​​oid应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆