Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

API to get Browser from UserAgent string

 
Carlos Araujo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I'm trying to port an PHP application to Java, but I can't find any API to get the browser's name, version and OS, from the UserAgent string.
Ive tried to use this http://turbine.apache.org/turbine/development/turbine-2.4/apidocs/org/apache/turbine/util/BrowserDetector.html , but it doesn't detect bots and it's not very "smart".
Can anoyne point me to some API so I can import in project to be able to do this?

Best regards
 
Rob Spoor
Sheriff
Pie
Posts: 20526
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I take it that with "Java" you mean JSP or servlets?
 
Carlos Araujo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Actually it's a Desktop application, that parses Apache Logs.
In those logs I have the "user agent strings"(http://www.useragentstring.com/pages/useragentstring.php) like:

And I would like to have a Class or static methods where I could pass as argument the UserAgentString and get browser name, version and OS.
Could try to implement this, but this is common so I would like to know if there's already implemented.

Best regards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic