-1

I am trying to place an app download link on my website like I see on various websites. I need it to show up only when a relevant android device views the website. An example of this can be found on fiverr.com when viewing the website on an Android device.

Tried to look online on how to do it, but cannot seem to find the solution anywhere. I have looked an App indexing and have followed deep linking but this doesn't seem to do it.

  • possible duplicate of [What is the best way to detect a mobile device in jQuery?](http://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device-in-jquery) – Modred Jul 07 '15 at 14:24

1 Answers1

0

You can detect an android device,with JS or PHP .

Source : http://davidwalsh.name/detect-android

var ua = navigator.userAgent.toLowerCase();

var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");

if(isAndroid) {

    // Do something!

    // Redirect to Android-site?

    window.location = 'http://android.davidwalsh.name';

    //OR 

   window.location = 'https://play.google.com/store/apps/details?id=com.name.name';

}
UtopiaIsGood
  • 169
  • 2
  • 15
  • Not exactly what I was looking for, I would like a banner at the top or the bottom of the webpage on an android device with a link to the app, but this will work for now. – Daniel Sheen Jul 08 '15 at 12:01