2

I am using UADetectorServiceFactory to parse user agent. I am using the following code to find OS version number which returns empty value sometimes. What am I missing here?

ua = req.getHeader("User-Agent");
UserAgentStringParser parser = UADetectorServiceFactory.getResourceModuleParser();
ReadableUserAgent agent = parser.parse(ua);
OperatingSystem os = agent.getOperatingSystem();
String deviceVersion = os.getVersionNumber().toString();

Sample User-Agent string:

Mozilla/5.0 (Android; Mobile; rv:34.0) Gecko/34.0 Firefox/34.0
Inaccessible
  • 1,560
  • 3
  • 18
  • 42
  • 1
    you are not missing anything: http://stackoverflow.com/questions/15337026/how-to-detect-androids-version-number-in-firefox-for-android – syllabus Jan 28 '15 at 10:18

0 Answers0