fiftyone.device.example.illustration
Class TrieExample

java.lang.Object
  extended by fiftyone.device.example.illustration.TrieExample
All Implemented Interfaces:
Closeable

public class TrieExample
extends Object
implements Closeable

Example of creating a TrieProvider and using it to get a device property.

main assumes it is being run with a working directory at root of project or of this module.


Constructor Summary
TrieExample()
           
 
Method Summary
 void close()
           
 boolean isItMobile(String userAgent)
          Illustrates the basic process of detecting a device and retrieving a property for Trie provider.
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrieExample

public TrieExample()
            throws IOException
Throws:
IOException
Method Detail

isItMobile

public boolean isItMobile(String userAgent)
                   throws Exception
Illustrates the basic process of detecting a device and retrieving a property for Trie provider.

Parameters:
userAgent - an HTTP User-Agent header value
Returns:
ture if the device has been detected as mobile
Throws:
Exception - if there was a problem accessing data file.

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2017 51Degrees. All rights reserved.