We have released v2.7.0 of the Android SDK. This release adds support for the conditions endpoint, the new fire perimeter support within the fires endpoint, many bug fixes, and other minor enhancements. Review the change history for a complete list of changes within the new release.
With this release, the Android SDK now directly supports the conditions endpoint. With the conditions support, you can fetch weather conditions for any latitude/longitude right now, any time over the past ten years, or for up to the next 15 days.
The conditions endpoint is an excellent option to replace the observations endpoint for current weather conditions. The conditions endpoint will provide estimated weather conditions versus a nearby observation station at the requested location.
The following is an example of how to query the weather conditions for right now:
1 2 3 4 5 6 |
<pre class="inline:true decode:1 " >AerisCustomCommunicationTask task; PlaceParameter place = new PlaceParameter("seattle,wa"); AerisRequest request = new AerisRequest(new Endpoint(EndpointType.CONDITIONS), place.getTextDisplay(""), builder.build()); task = new AerisCustomCommunicationTask(getActivity(), this, request); task.withProgress(this); task.execute(); |
An example of using the conditions support within a batch request from the Demo Application:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<pre class="inline:true decode:1 " >BatchBuilder builder = new BatchBuilder(); builder.addGlobalParameter(this.getPlaceParameter()); builder.addEndpoint(new Endpoint(EndpointType.CONDITIONS) .addParameters(FieldsParameter.initWith("periods"))); builder.addEndpoint(new Endpoint(EndpointType.PLACES, Action.CLOSEST) .addParameters(FieldsParameter.initWith("place"))); builder.addEndpoint(new Endpoint(EndpointType.FORECASTS, Action.CLOSEST) .addParameters(FieldsParameter.initWith( ForecastsFields.WEATHER_PRIMARY, ForecastsFields.MAX_TEMP_F, ForecastsFields.ICON, ForecastsFields.DATETIME_ISO, ForecastsFields.MIN_TEMP_F))); AerisRequest request = builder.build(); BatchCommunicationTask task = new BatchCommunicationTask(getActivity(), this, request); task.execute(); |
Several years ago, the alerts endpoint replaced the now-deprecated advisories endpoint within the AerisWeather API. While the endpoint name changed, the response is the same.
If you use EndpointType.ADVISORIES, your application will continue to work, though you will now receive a deprecation warning. Instead, utilize EndpointType.ALERTS.
We hope you enjoy the new version and can’t wait to see what you make next! Contact our sales team or sign up for a developer account to get started today.
No comments yet.
Be the first to respond to this article.