pieroxy/java-user-agent-detection


Some code to deduce an OS/Platform/Browser out of a user-agent string

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.pieroxy:java-user-agent-detection:2017.09.24.17.00.GMT'
	}
	dependencies {
		implementation("com.github.pieroxy:java-user-agent-detection:2017.09.24.17.00.GMT")
	}
	<dependency>
	    <groupId>com.github.pieroxy</groupId>
	    <artifactId>java-user-agent-detection</artifactId>
	    <version>2017.09.24.17.00.GMT</version>
	</dependency>

                            
    libraryDependencies += "com.github.pieroxy" % "java-user-agent-detection" % "2017.09.24.17.00.GMT"
        
        

                            
    :dependencies [[com.github.pieroxy/java-user-agent-detection "2017.09.24.17.00.GMT"]]
        
        

Readme


java-user-agent-detection

Some code to deduce an OS/Platform/Browser out of a user-agent string, compatible with Java 1.6 or newer.

Useful links

How to contribute

I will not merge pull requests, as most of this code and tests are generated. What you can do is open issues if you find problems or would like to suggest improvements. You can also leave a message on the blog if you just want to ask something.

How to build with ant

Building with ant is as simple as installing ant and typing ant.

Your jar can then be found in the build/ directory and the javadoc in build/doc/index.html.

How to build with Maven

Building with ant is as simple as installing Maven and typing mvn release

Your jar can then be found in the target/ directory.