Forum/Help & Support

Using your Java API within a Java application

Bruno Verachten
posted this on October 11, 2011 18:48

Dear HandsetDetection developers,

 

I'm trying your Java API to check a set of user agents seen on our website.
I have a standalone Java application to see what your API will identify.
Unfortunately, I can't do it right.

The hdconfig.ini file is in the classpath and contains what your site generated for me (found on https://www.handsetdetection.com/sites/config/xxxxx).
My Java code looks like:

hd = new HDBase(emailKey, secret);
        //("demo@handsetdetection.com", "demo");
        hd.setv2ApiKey("f60e0ff93080929b62b82da9ece64f85");
        hd.setURL("http://api-us1.handsetdetection.com");
        hd.detect(userAgent);

I added the proxy configuration, but I get nothing (Connection timed out: connect).

I must have missed something. Can you please help?

Kind regards,

Bruno Verachten

 

 

Comments

User photo
Bruno Verachten

I now have a connection, but the answer is always  {"message":"OK","status":0}.

What method do I have to call to identify a device?
Thanks.

October 12, 2011 02:25.