Unlike other examples, use of this example requires a 51Degrees Enterprise data file, which can be obtained on a trial basis or purchased from our pricing page here.
This class provides a framework and runner for comparing different device detection solutions. It is provided in a basic form to compare detection time. Different solutions may be compared by implementing the interfaces in Detection. In this example we have provided such implementations for 51Degrees and BrowsCap, and skeleton commented-out implementations for ScientiaMobile (WURFL) and DeviceAtlas. We don't have access to those APIs so the code has not been tested and it is left to those interested to uncomment and get working.
| void fiftyone.devicedetection.examples.console.comparison.Comparer.compare |
( |
List< Solution > | solutions, |
|
|
int | numberOfThreads, |
|
|
int | numberOfResults, |
|
|
Reporting | reportingModel, |
|
|
PrintWriter | writer ) throws Exception |
Execute the benchmarks using the solutions provided.
- Parameters
-
| solutions | some solutions |
| numberOfThreads | how many threads to run for each solution |
| numberOfResults | how many detections to do per thread |
| reportingModel | how and what to report |
| writer | where to report it |
- Exceptions
-
| Exception | to satisfy underlying APIs |
| List< BenchmarkResult > fiftyone.devicedetection.examples.console.comparison.Comparer.runBenchmarks |
( |
Solution | solution | ) |
throws Exception |
Initiate the benchmark threads.
- Parameters
-
| solution | the solution being benchmarked |
- Returns
- result of the benchmark
- Exceptions
-
| Exception | to satisfy called APIs |