Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreI am pleased to announce that Spring for Android 2.0.0.M1 is now available in the Spring milestone repository. Highlights include:
ParameterizedTypeReference
OkHttpRequestFactory
This release raises the minimum version from Android 2.1 (API level 7) to Android 2.2 (API level 8). The Google Play Store app is no longer supported on Android 2.1 and that version is not being tracked on the Android developer Dashboards. Additionally, OkHttp is only supported on Android 2.3 and newer.
The following is an example of how to consume generic types with Rest Template:
ParameterizedTypeReference<List<String>> typeRef =
new ParameterizedTypeReference<List<String>>() {};
ResponseEntity<List<String>> responseEntity =
restTemplate.exchange(url, HttpMethod.GET, requestEntity, typeRef);
List<String> strings = responseEntity.getBody();
In order to maintain parity with Spring Framework's Rest Template library, this release introduces a few breaking changes. Specifically, note the RestTemplate
constructors have changed. The default constructor now creates a standard set of HttpMessageConverters
. The recommended way to prevent default message converters from being created is to use the following new constructor:
public RestTemplate(List<HttpMessageConverter<?>> messageConverters)
For a complete list of changes, see the Release Notes in JIRA. The reference documentation has also been updated to cover the new features.
Thanks again to everyone that has contributed to the release! Please try this new milestone and report any problems in JIRA or on GitHub.