UADetector Java Library

repository·master·Indexed 42 days ago

https://github.com/arouel/uadetector

A portable Java library for parsing User-Agent strings to identify browsers, operating systems, robots, and device categories. It supports over 190 desktop and mobile browsers, 130 client types, and 400 robots, with device categorization for smartphones and tablets available since version 0.9.10.

Tokens
481
Snippets
1
Records
4
Agent score
4%

What's inside UADetector

  1. What is UADetector?

    master
    UADetector is a portable Java library designed to analyze User-Agent strings. It identifies over 190 desktop and mobile browsers, 130 other client types (such as feed readers, email clients, and multimedia players), and over 400 robots (like Googlebot or BingBot). The library's primary goal is to detect the specific type of client and its associated operating system (e.g., identifying Mobile Firefox 9.0 on Android).
  2. Understand the UADetector module structure

    master

    UADetector is split into two distinct modules that work together:

    1. Core Module: Contains the API and the implementation logic required to read detection information and perform the actual User-Agent identification.
    2. Resources Module: Contains the database of identification information and a service factory class used to obtain preconfigured UserAgentStringParser singletons.

    To use the library effectively, you typically interact with the core API while relying on the resources module for the underlying data and parser instances.

  3. Device categorization in UADetector

    master

    Since version 0.9.10, UADetector supports device categorization. This allows you to classify specific hardware into broader categories. For example:

    • Smartphone: Devices like iPhone or Nexus 4.
    • Tablet: Devices like iPad, Kindle, or Surface RT.

    Detailed information about the properties available during parsing can be found in the ReadableUserAgent API documentation.

  4. Build and run the UADetector Hello World example

    master

    To build and run the UADetector Hello World demo application, use Apache Maven. This will start a Jetty server hosting a demo web application.

    Requirements:

    • JDK 1.6 or above
    • Apache Maven 3.x
    • An active internet connection (to resolve transitive dependencies and building tools)

    Steps:

    1. Run the Maven command to clean, package, and start the Jetty server.
    2. Once the server is running, access the application via your browser at http://localhost:8080/.
    mvn clean package jetty:run