从网页开放的Andr​​oid应用 [英] Open android application from a web page

查看:165
本文介绍了从网页开放的Andr​​oid应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,开放的Andr​​oid应用程序从内部链接的网页,我们必须写在An​​droidManifest.xml如下:

 <意向滤光器>
            <作用机器人:名称=android.intent.action.VIEW/>
            <类机器人:名称=android.intent.category.DEFAULT/>
            <类机器人:名称=android.intent.category.BROWSABLE/>
            <数据机器人:计划=my_scheme机器人:主机=my_host/>
        &所述; /意图滤光器>
 

的问题是,我在下面的方式写的:

 <意向滤光器>
            <作用机器人:名称=my_action/>
            <类机器人:名称=android.intent.category.DEFAULT/>
            <类机器人:名称=android.intent.category.BROWSABLE/>
            <数据机器人:计划=my_scheme机器人:主机=my_host/>
        &所述; /意图滤光器>
 

我没加android.intent.action.VIEW,而是我说我自己的行动,我做。 因为该版本已经发布,我不能改变它。

现在的问题是,如果有一种方法,使从JavaScript或简单的HTML网页,运行应用程序可能通过定义页面的具体行动呢?

谢谢

拉​​巴斯。


解决的:

感谢David我找到了一个解决办法:

 < A HREF =意图:// my_host#意向,计划= my_scheme,行动= my_action;末>链接到我的东西< / A>
 

解决方案

试试这个:

请你的链接是这样的:

 < A HREF =的意图:#Intent,行动= my_action;末>链接到我的东西< / A>
 

另外看看<一href="http://stackoverflow.com/questions/2958701/launch-custom-android-application-from-android-browser">Launch定制的Andr​​oid浏览器Android应用程序

I know that for opening android application from a link inside a web page we have to write the following in the AndroidManifest.xml:

        <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="my_scheme" android:host="my_host" />
        </intent-filter>

The problem is that I wrote it in the following way:

        <intent-filter>
            <action android:name="my_action"/>
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="my_scheme" android:host="my_host" />
        </intent-filter>

I didn't add "android.intent.action.VIEW" and instead I added my own action that i made. I can't change it because the version is already released.

The question is, if there's a way to make the application run from JavaScript or simple html page, maybe by defining the specific action in the page?

Thanks,

Paz.


SOLVED:

Thanks to David I found a solution:

<a href="intent://my_host#Intent;scheme=my_scheme;action=my_action;end">Link to my stuff</a> 

解决方案

Try this:

Make your links look like this:

<a href="intent:#Intent;action=my_action;end">Link to my stuff</a>

Also have a look at Launch custom android application from android browser

这篇关于从网页开放的Andr​​oid应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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