If a user surfs to my site I want to display a message if he using Android phone. My website is http://website.com
How can I do this?
I have tried this but not succeeded:
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';
}