How to check if a web page has been opened by a mobile browser or a computer browser. I tried this :
name = request.getHeader("User-Agent");
But it gives these type of results :
- For Fedora Firefox Browser : Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0
- For Android Phone Browser : Mozilla/5.0 (Linux;U;Android 2.3.6;en-in;Micromax A50 Build/GRK395) AppleWebKit/533.1(KHTML,like Gecko) Version/4.0 Mobile Safari/533.1
I cannot from the above two results,differentiate whether the web page was visited by a mobile phone or a computer. How do I do that ?
It will be great if I am able do this in Java.
Android
– mishadoff