title: Detect mobile devices from user agent string
body: <p>I am looking for a way to analyze user agent strings to determine whether they were generated by mobile devices.  This needs to be java-based and usable in large batch log file analysis on hadoop for generating statistics (i.e., a web service wouldn't be appropriate).</p>
  
  <p>I have seen <a href="http://wurfl.sourceforge.net/" rel="noreferrer">WURFL</a>, but given that I just need a binary mobile/not mobile response, the license fee seems prohibitive.</p>
  
  <p>So far I have been using <a href="http://uadetector.sourceforge.net" rel="noreferrer">UADetector</a>, which is almost exactly what I need.  However, I have encountered some limitations with it.  In my testing, I have found many user agent strings that provide enough information to determine that the user agent is from a mobile device, but are reported as UNKNOWN by UADetector.  </p>
  
  <p>For example, poorly-standardized Android apps can send the UA string "Android".  This is enough to know that it came from a mobile device, but UADetector reports this UserAgentType as UNKNOWN rather than MOBILE_BROWSER.</p>
  
  <p><a href="http://www.apachemobilefilter.org/" rel="noreferrer">Apache Mobile Filter</a>'s <a href="http://litedetection.apachemobilefilter.org/" rel="noreferrer">Lite Device Detection</a> does the right thing, but I need something I can use from Java.</p>
  
  <p>Can anyone recommend a better solution?</p>