Today we released a version update to our Java SDK, taking it from 1.6.2 to 1.7.0 and adding support for the latest Mechanical Turk API WSDL. You can download the SDK from its SourceForge repository, or learn more.
This update brings the following changes:
Improved support for Qualifications using new comparators and US state locales – Support for the new WSDL means that developers now have more flexibility in choice of comparators as well as the ability to qualify Workers by geographical location, including US states.
Comparators are a set of checks that allow you to verify whether Workers have the right set of Qualifications to preview or work on your HIT. The updated SDK now supports three new comparators: “In”, “NotIn” and “DoesNotExist” which were previously added to the Mechanical Turk API as announced here.
The new SDK also gives developers the ability to use a US Worker’s state location in addition to country locations when specifying Qualifications, which was previously announced here.
To see an example how both the new comparators and the new locales can be used, check out the “Simple Survey” sample in the samples folder within the SDK. Within SimpleSurvey.java, here is an example of the new “In” comparator in action:
QualificationRequirement locationQualReq = new QualificationRequirement();
locationQualReq.setQualificationTypeId(RequesterService.LOCALE_QUALIFICATION_TYPE_ID);
locationQualReq.setComparator(Comparator.In);
Here, the locationQualReq QualificationRequirement is being configured to use the new “In” comparator which will be used to check whether a Worker’s geographical location falls within a specified set. Below is how you would then pass in the set of locales you want to check for, including US states, to locationQualReq using setLocaleValue:
washington.setCountry("US");
washington.setSubdivision("WA");
Locale maryland = new Locale();
maryland.setCountry("US");
maryland.setSubdivision("MD");
Locale canada = new Locale();
canada.setCountry("CA");
Locale greatBritain = new Locale();
greatBritain.setCountry("GB");
locationQualReq.setLocaleValue(new Locale[] { washington, maryland, canada, greatBritain });
Support for Java 8 – The new SDK now requires Java 8 or higher. Java 8 has been available since 2014, and we encourage developers on older platforms to make the migration. Previous versions of the SDK will continue to work with older versions of Java.
SSL connectivity issues fixed – Developers who were using older versions of the SDK with Java 8 or higher may have run into SSL connectivity issues due to changes in certification checking that were released with JDK 8u51 (JDK-8067695). This has now been addressed.
Preview HIT functionality removed – The SDK had a legacy local preview option that would generate a HIT as an HTML file on your local machine. There were known issues with this functionality as we added new functionality to HITs themselves and the preferred method of testing now is to use the Developer Sandbox. We are thus removing this legacy functionality to simplify the getting started experience for new developers.
This update was driven primarily by feedback from developer customers using our API and we hope the updated SDK makes it even easier to use. Please share your feedback with us on the Mechanical Turk developer forums, or contact Customer Service if you are having trouble using the updated SDK.