tags:

views:

184

answers:

3

I want to call android application on clicking of button on some website from mobile. Suppose I am opening one url on android browser and I want to call my application on clicking on button provided by that site. How to do that??

Suppose we are using browser other than Chrome then is it allowing??

A: 

Please take a look at the WebViewDemo. Javascript code in the web page can call into your Activity. As well as the other way around.

Jacques René Mesrine
A: 

You cannot... if the site is being browsed in the default browser (Chrome).

If you already have an application that embeds the WebView, then you can do some bit of handling of - mouse clicks, window alerts, navigation etc. Otherwise, not!

MasterGaurav
I wonder who and why -1 :)Just because there' no other option! Or else fix me :)
MasterGaurav
-1, since you are wrong. There are a lot of applications that open when you click specific URL:s in the standard browser.Just to be sure I just checked that clicking a Spotify link in the browser will open the Spotify app (on Android 1.5).
kigurai
Gotcha! Thanks for reminding... one can have an activity with intent-filter with data-scheme and some action!
MasterGaurav
+3  A: 

If you link to your application as "myapp://foo/bar", can't you use some sort of intent filter to start your application.

I mean, if you press a youtube link in the browser it asks if you want to complete the action with the YouTube app or the browser.

I have seen similar examples regarding Google Maps links (which would open in either browser, google maps(?) or GeoBeagle).

kigurai