0

Is it possible Redirect to specific url if page viewed from android by detecting it's package name (or another identificator information) from website (html or javascript)?

2 Answers2

0

I think what you are looking is this meta tags.

0

I think this idea is impossible if you brows your web page from external browser (like google chrome).

So I suggest to brows the web page in a webview inside your android application and make your code listen for this webview by extend WebViewClient and call onPageFinished() :

   mWebView.setWebViewClient(new WebViewClient() {

   public void onPageFinished(WebView view, String url) {
        // do your stuff here
    }
});

In the web app you can make a specific page for redirecting (for example www.your_website.com/redirecting.html) , and make the app do what you want when surf this link :

mWebView.setWebViewClient(new WebViewClient() {

   public void onPageFinished(WebView view, String url) {
        // do your stuff here
        if(url == "www.your_website.com/redirecting.html"){
             //do what you want...
        }
    }
});