Giter Club home page Giter Club logo

device-detection-java's Introduction

51Degrees Device Detection Engines

51Degrees Java Device Detection

Developer Documentation

Introduction

This repository contains Java implementation of the device detection specification.

Dependencies

For runtime dependencies, see our dependencies page. The tested versions page shows the JDK versions that we currently test against. The software may run fine against other versions, but additional caution should be applied.

Data

The Java API can either use our cloud service to get its data or it can use a local (on-premise) copy of the data.

Cloud

You will require resource keys to use the Cloud API, as described on our website. Get resource keys from our configurator, see our documentation on how to use this.

On-Premise

If you are using on-premise detection, a "Lite" version of the data required is packaged in this repository. It contains only a limited set of "essential" device detection properties.

You may want to license our complete data file containing all properties. Details of our licenses are available on our website.

If you want to use the lite file, you will need to install GitLFS, then:

git lfs install

Then, navigate to 'device-detection.hash.engine.on-premise/src/main/cxx/device-detection-cxx/device-detection-data' and execute:

git lfs pull

Installation

Our latest release is available as compiled JARs on Maven - or you can compile from source as described below.

Maven

The 51Degrees Java Device Detection package is available on maven. Make sure to select the latest version.

<!-- Make sure to select the latest version from https://mvnrepository.com/artifact/com.51degrees/pipeline.device-detection -->
<dependency>
    <groupId>com.51degrees</groupId>
    <artifactId>device-detection</artifactId>
    <version>4.4.19</version>
</dependency>

This package includes the Cloud and on-premise APIs.

Build and Install from source

Device detection on-premise uses a native binary. (i.e. compiled from C code to target a specific platform/architecture) This section explains how to build this binary.

Pre-requisites

  • Install C build tools:
    • Windows:

      • You will need either Visual Studio 2019 or the C++ Build Tools installed.
        • Minimum platform toolset version is v142
        • Minimum Windows SDK version is 10.0.18362.0
      • Set the CMake command path in the PATH environment variable:
        • set PATH="[Visual Studio Installation Path]\[Visual Studio Version]\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\";%PATH%
    • Linux:

      • sudo apt-get install g++ make libatomic1 cmake
  • Maven version 3.8.4 or higher is recommended, and what is used for our own build.
  • If you have not already done so, pull the git submodules that contain the native code:
    • git submodule update --init --recursive

Build steps

Batch script and Bash script are provided to support building native binaries on Windows and Linux/macOS. These scripts are implicitly called by the Maven build step.

mvn clean install

On Windows, the Platform Toolset version and Windows 10 SDK version can be overwritten when running mvn by adding following options:

  • -DplatformToolsetVersion=[ Platform Toolset Version ]
  • -DwindowsSDKVersion=[ Windows 10 SDK Version ]

This is not recommended unless absolutely necessary and should be used with caution.

Tests

You will need resource keys (see above) to complete the tests and run examples which include exercising the cloud API.

To verify the code:

mvn clean test -DTestResourceKey=[Resource Key]

For tests and examples that require a license key add the following option:

  • -DLicenseKey=[License Key]

Projects

  • device-detection - This is the project to get all Device Detection capabilities.
  • device-detection.hash.engine.on-premise - when you want to use local detection.
  • device-detection.cloud - when you want to use our cloud detection.
  • device-detection.shared - Shared classes.

device-detection-java's People

Contributors

arturadam avatar automation51d avatar ben51degrees avatar dependabot[bot] avatar drasmart avatar fatima51degrees avatar jorabin avatar jorabin-51d avatar joseph51d avatar justadreamer avatar pi-alexander-popel avatar piotr-grabalski avatar riabkov avatar steve51d avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.