I am coding a site and trying to make the mobile optimised part of the site work with a 'Find Us' button. I don't need to have anything fancy, and I now know what href to use to invoke using the 'Maps' app on Iphone, Android, Blackberry and windows phone. (thanks to: John Allan's post)
So, what I want to do now is to find either Java or another form that will let me put in the required links based upon the user-agent.
For example: I know for the Iphone I need to enter:
<a href="http://maps.google.com/?saddr=Current%20Location&daddr= 894%20Granville%20Street%20Vancouver%20BC%20V6Z%201K3">Find Us</a>
And for Andriod:
<a href="geo:894%20Granville%20Street%20Vancouver%20BC%20V6Z%201K3">Find Us</a>
However, I do not know how to make the code enter the right link for the right user-agent. I would like to do it inline if possible or with as little script as possible.
I have tried JSF from the post found here Check-User-Agent, but that code didn't work on my site. Currently I am just writing in HTML5.
Any help would be greatly appreciated.