Code Monkey home page Code Monkey logo

dotnet-device-detection's Introduction

51Degrees Device Detection for Microsoft .NET

Recent Changes | Supported Databases | .NET Developer Documention | Available Properties

Need C | Java | PHP | Python | Perl | Node.js?

Server Side: Use code like...

Request.Browser["IsMobile"]

or

Request.Browser["IsTablet"]

... from within a web application server side to determine the requesting device type.

Client Side: Include...

https://[YOUR DOMAIN]/51Degrees.features.js?DeviceType&ScreenInchesDiagonal

... from Javascript to retrieve device type and physcial screen size information. Use Google Analytics custom dimensions to add this data for more granular analysis.

Offline: Use...

var detectionProvider = new Provider(StreamFactory.Create("[DATA FILE LOCATION]"));
var deviceType = detectionProvider.Match("[YOUR USERAGENT]")["DeviceType"];

... to perform offline analysis of web logs with User-Agent headers.

Review All Properties

What's needed?

The simplest method of deploying 51Degrees device detection to a .NET project is with NuGet. Just search for 51Degrees on NuGet.

This GitHub repository and NuGet include 51Degrees free Lite device database. The Lite data is updated monthly by our professional team of analysts.

Data files which are updated weekly and daily, automatically, and with more properties and device combinationsare also available.

Compare Device Databases

Recent Changes

Version 3.2.11 Highlights

New Lite Data File released for August.

Major Changes in Version 3.2

  • Embedded data has been removed from the assembly and now must be provided from the App_Data folder.
  • .NET 3.5 is not supported in this release in order to use memory mapped files and simplify overriding default browser capabilities.
  • In stream mode entity data properties that can allocate large arrays only initialise these arrays when needed.
  • Caches used with stream operation are now fixed memory size and serviced via the thread pool.
  • Automatic update processes uses temporary files rather than main memory to verify integrity of updated files prior to using them.
  • Temporary files are now created in the App_Data/51Degrees folder of the web application rather than a UNC path or the master data file folder.
  • Values associated with Profiles are now retrieved using a more efficient algorithm.
  • DataSet.Properties collection now has a string accesser to make retrieving properties by name simpler.
  • Web sites using memory mode use a byte array to improve start up time.
  • Version 3.2 data file formats are supported in parallel with version 3.1 data files.
  • 51Degrees unit tests are now part of the open source distribution.

Changes from 3.2.5

Summary of API changes:

  • Provider supports retrieving match results using device ids generated from previous matches.
  • The classes to update device data files are now public and can be used to update device data files from non web environments.
  • Licence keys are now verified against the 51Degrees public signature before being used to retrieve updates.
  • The cache has been upgraded to use a least recently used (LRU) design. This removes the need to service the cache in a background thread, and results in a more predictable performance under load.
  • Duplicate code has been consolidated with a focus on improving documentation and implementing recommendations from code analysis and peer reviews. Testing coverage has been included with initial unit tests for new features.
  • Consistent examples have been added in parallel with APIs in other languages. The examples are designed to highlight specific use cases for the API. They relate to example specific documentation on the 51Degrees web site under Support -> Documentation -> .NET.
  • The override to indicate if cookies are supported now defaults to True when the value is unknown. This prevents 3rd party components such as forms authentication from failing where an assumption that cookies are always supported has been made but not verified against the server side browser capabilities.
  • The demo web site project no longer includes the 51Degrees.dat file in the project. It is instead copied from the repositories data folder when the project is built.
  • The signed assembly is now compiled with "Optimise Code" option enabled.

dotnet-device-detection's People

Contributors

jwrosewell avatar ben51degrees avatar lily51degrees avatar joseph51d avatar iftikhar51 avatar richteaman avatar

Watchers

 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.