Is it possible to open one app in an android device, from a website?
Will it be possible, if I have a bu开发者_JS百科tton in a website and and when clicked, it will do a trigger function and a related App will open automatically in an Android device? In iPhone it is getting possible. Thanks
From a previous Stack Overflow Question:
Launch custom android application from android browser
Namely:
Use an <intent-filter>
with a <data>
element. For example, to handle all links to twitter.com, you'd put this inside your <activity>
in your AndroidManifest.xml:
<intent-filter>
<data android:scheme="http" android:host="twitter.com"/>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
Then, when the user clicks on a link to twitter in the browser, they will be asked what application to use in order to complete the action: the browser or your application.
Of course, if you want to provide tight integration between your website and your app, you can define your own scheme:
<intent-filter>
<data android:scheme="my.special.scheme" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
Then, in your web app you can put links like:
<a href="my.special.scheme://other/parameters/here">
It is possible: you need to register a URL handler in your app.
EDIT: see How to listen for a custom URI for details.
It's also possible to launch an Android app from a web browser that's not on the device.
Take a look at Chrome to Phone for an example.
http://code.google.com/p/chrometophone/
精彩评论