How To Detect Whether Request Is Coming From Browser Or Smartphone?
I am having a web application , which works fine . now there is a particular page which gets bulky when i access the application from smartphone browser , so I wanted a situation l
Solution 1:
Use the user-agent. Every connection to your server carries this header, by convenience and convention. There is no guarantee that a browser will be truthful(such as a spambot reporting itself as Chrome). You can get the user-agent as follows:
request.getHeader("User-Agent");
and then check again known user-agent strings and templates.
Post a Comment for "How To Detect Whether Request Is Coming From Browser Or Smartphone?"