Awesome
java-device-detector
java port of https://github.com/matomo-org/device-detector
Get Start
- download this project
- get the latest regexes from https://github.com/matomo-org/device-detector/tree/master/regexes
- run it
DeviceDetector d = new DeviceDetector();
CompositeDetectResult ret = d.parse(ua);
if(ret!=null) {
System.out.println(ret);
}
Customize
- By default, DeviceDetector will detect bot, os, client and device
- You can create your own DeviceDetector to customize the parsers and detect logic
Environment
- java8
Performance
work in progress
- Cache regex objects
- Pre-match, tests the useragent against a combination of all regexes