{"id":16560690,"url":"https://github.com/bgalek/devicedetect","last_synced_at":"2025-06-20T13:35:18.699Z","repository":{"id":83193707,"uuid":"249419857","full_name":"bgalek/devicedetect","owner":"bgalek","description":"Simple, fast and 0 dependencies library for device detection.","archived":false,"fork":false,"pushed_at":"2025-05-05T11:42:27.000Z","size":442,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T12:43:22.563Z","etag":null,"topics":["device","user-agent-analysis","varnish-devicedetect"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgalek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-03-23T12:05:23.000Z","updated_at":"2025-05-05T11:41:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c58b92c-f288-4cd7-9e36-e5a02d1e1fe9","html_url":"https://github.com/bgalek/devicedetect","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bgalek/devicedetect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgalek%2Fdevicedetect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgalek%2Fdevicedetect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgalek%2Fdevicedetect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgalek%2Fdevicedetect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgalek","download_url":"https://codeload.github.com/bgalek/devicedetect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgalek%2Fdevicedetect/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260953674,"owners_count":23088077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["device","user-agent-analysis","varnish-devicedetect"],"created_at":"2024-10-11T20:29:47.694Z","updated_at":"2025-06-20T13:35:13.682Z","avatar_url":"https://github.com/bgalek.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java port of [varnish-devicedetect](https://github.com/varnishcache/varnish-devicedetect)\n\u003e Simple, fast and 0 dependencies library for device detection. \n\n[![Build](https://github.com/bgalek/devicedetect/actions/workflows/build.yml/badge.svg)](https://github.com/bgalek/devicedetect/actions/workflows/build.yml)\n![Codecov](https://img.shields.io/codecov/c/github/bgalek/devicedetect.svg?style=flat-square)\n![GitHub Release Date](https://img.shields.io/github/release-date/bgalek/devicedetect.svg?style=flat-square)\n![Scrutinizer code quality](https://img.shields.io/scrutinizer/g/bgalek/devicedetect.svg?style=flat-square)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bgalek_devicedetect\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=bgalek_devicedetect)\n\n## Why?\nWhen comes to user agent parsing and normalization, sometimes few simple regex matches are enough good.\nJust like in [varnish-devicedetect](https://github.com/varnishcache/varnish-devicedetect). \n\nThis java library is an adaptation of this regular expressions list.\nTest cases origin from a varnish webserver with [varnish-devicedetect](https://github.com/varnishcache/varnish-devicedetect) installed.\nThis library is almost 100% consistent (a little more things are considered as bot).\n\n## Accuracy\nFew hundred thousands of requests were checked against [varnish-devicedetect](https://github.com/varnishcache/varnish-devicedetect) and [yauua](https://github.com/nielsbasjes/yauaa).\nThere was about 0.3% of differences. \n\nMaybe it's enough for You too!\n\nFeel free to explore library test data.\n\n## Performance\nOther libraries try to be as much accurate as possible. \nThey extract more information from `User-Agent` header and they use clever tricks to be performant.\nMost of them are decent piece of software. But sometimes, a much simpler approach will be acceptable.\n\n## Usage\nAdd library dependency:\n```groovy\ncompile \"com.github.bgalek.utils:devicedetect:1.0.0\"\n```\n\nDetect using default detectors:\n```java\nDeviceDetect.basic().detect(\"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36\")\n```\n\nProvide custom detections:\n```java\nDeviceDetect.custom().withCustomDetectors(List.of()).detect(\"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36\")\n```\n\n## Performance\n\nLibrary is considered thread-safe.\n\nJMH benchmark is included in project. \n\nThat's the result:\n \n| Benchmark                            | Mode  | Cnt  | Score  | Error   | Units |\n| :----------------------------------- | ----- | ---- | ------ | ------- | ----- |\n| DevicesDetectBenchmark.deviceDetect  | thrpt |  25  | 23.352 | ± 2.876 | ops/s |\n| DevicesDetectBenchmark.yauaa         | thrpt |  25  | 1.700  | ± 0.125 | ops/s |\n\n***REMEMBER: The numbers above are just data. To gain reusable insights, you need to follow up on \nwhy the numbers are the way they are. Do not assume the numbers tell you what you want them to tell.***\n\n\\* - cache disabled\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgalek%2Fdevicedetect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgalek%2Fdevicedetect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgalek%2Fdevicedetect/lists"}