Skip to content

Instantly share code, notes, and snippets.

@chumpy
Created January 29, 2012 00:02
Show Gist options
  • Select an option

  • Save chumpy/1696346 to your computer and use it in GitHub Desktop.

Select an option

Save chumpy/1696346 to your computer and use it in GitHub Desktop.
Using user-agent-utils
UserAgent userAgent = UserAgent.parseUserAgentString((String)request.getHeader("User-Agent"));
String browser = userAgent.getBrowser.getName();
String os = userAgent.getOperatingSystem().getName();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment