Version 2.0 Migration Guide

Welcome to version 2.0 of AerisWeather's Android Software Development Kit.

There are several architectural changes that you should be aware of before jumping into the upgrade from 1.x. The following guide will help you when migrating from a pre-2.0 version of the SDK within your own projects.

Summary

Requirements

The AerisWeather Android SDK officially supports Android 4.4 (KitKat) and up, Java SE 8 and Google Play Services through 10.0.1. For the most part, these will be backward compatible, but if your project requires supporting an earlier version, you should refer to the previous versions of the AerisWeather Android libraries which can be found via the Central Repository under "com.hamweather".

Package Prefix

To bring the Android libs more in line with our current corporate branding, the package prefix "hamweather", has been replaced with "aerisweather". All of the references to hamweather in the code and comments have been updated accordingly. 

To Do:
Once you update to the 2.x libraries, you will need to change any references of "hamweather" in your code to "aerisweather"

File Names

Along with the renaming of the package prefix, we have also updated the naming of the libraries themselves to provide a more consistent feel and convention. 

The previously named aeris-android-lib is now aeris-core-lib.

The previously named aeris-maps-library is now aeris-maps-lib.

The previously named aeris-android-lib.jar is now renamed to aeris-core-lib.jar

To Do:
Typically the jar file is not used directly, so the only change needed for here will be in your build.gradle where you will change the name as well as the version.

Maven Repository

A new repository has been created to provide access to the newly named aerisweather packages and libraries. The new repository can be found in the Central Repository under "com.aerisweather". 

Official releases of the AerisWeather Android SDK libraries can be found in the Releases repository of the Central Repo. The following is all that is needed to ensure access to the new repository:

 

buildscript {
    
    repositories {

        mavenCentral()
        
        jcenter()

    }
}

...

repositories {

    mavenCentral()

    jcenter()

}


Gradle Dependency

To reference the version 2.0.0 AerisWeather Android libraries in your Gradle file, use:


dependencies {
    compile ('com.aerisweather:aeris-maps-lib:2.0.0@aar') { 
        transitive true } 
    compile 'com.google.android.gms:play-services-maps:10.0.1' 
    compile 'com.android.support:appcompat-v7:25.1.0'
}

To Do:
Update the build.gradle file(s) with the above referenced dependencies.

Core Library

New Endpoints

  • Convective Outlook - The convective/outlook endpoint provides convective outlook information based on the SPC convective outlooks.  Coverage of this endpoint is for the US only.
  • Dought Monitor - The droughts/monitor endpoint provides access to the US drought monitor information from the National Drought Mitigation Center.  Coverage of this endpoint is for the US only, and data is updated weekly.
  • Fires Outlook - The fires/outlook endpoint provides fire weather outlook information based on the SPC fire weather outlooks.  Coverage of this endpoint is for the US only.
  • Indicies - Indices for health and outdoor activities as based on common weather observations and forecasts
    • Arthritis
    • Cold and Flu
    • Migraines
    • Sinus
    • Outdoors
    • Golf
    • Biking
    • Swimming
    • Campfires
    • Bees
  • Phrases Outlook
  • Storm Cells Summary (Beta) - The stormcells/summary endpoint provides an overall summary on current storm cells based on search / filter criteria.  Example uses include obtaining the number of storms cells, maximum hail currently reported within storm cells,  number of storm cells with a high probability of hail within a 50 mile radius.  This endpoint can also provide polygons of the storm cell groups included in the summary. Coverage area includes the 50 US states, Puerto Rico and Guam
  • Storm Reports Summary - The storm reports data set provides access to all local storm reports (LSR) as transmitted by the National Weather Service (NWS). These reports are received from storm spotters, such as amateur radio operators, storm chasers, law enforcement, emergency management, or citizens about severe weather conditions in their area.

Endpoint Type - Spelling Error

In the core library, we corrected a spelling error in the STORMCELLS endopint type.

STORMECELLS has been corrected to STORMCELLS

To Do:
If you reference this endpoint in your code, you will need to update to the correct spelling.

Maps Library

Tile Data / AMP Layers

Version 2 of the SDK includes support for our latest and greatest mapping service AMP (AerisWeather Mapping Platform). The previous group of Tiles or Overlays has been removed, since AMP provides all of those layers and more.

For more info on our new mapping service, check out AMP (AerisWeather Mapping Platform).

 

For detailed information regarding how to use the AMP layers in your Android application, please refer to the Maps section of the AerisWeather Android SDK documentation.

Point Data

AerisPointData Class

  • Added another getRequest method with an option to bypass and replace the default parameters.
  • For an example, see the onResume sample method below and note this line:
    • AerisRequest request = pointData.getRequest(Action.CLOSEST, params, null, true);

New Layer - Records (for a full explanation of the layer see the API endpoint docs for Records)

The records data set provides access to daily US records (RER) as transmitted by the National Weather Service (NWS).

  • Default parameters: from=-7days, limit=500

Examples

To display the records layer with default parameters:

public void onResume()  
{
  super.onResume(); 

  //we are resuming the map view, so check for updated options and redraw the layers   
  if (m_mapView != null)     
  {
    if (m_mapOptions != null)
    {
      m_mapOptions = AerisMapOptions.getPreference(getActivity());
      m_mapView.addLayer(m_mapOptions.getPointData());
    }

    //tell the map to redraw itself
    m_mapView.onResume();      
  } 
} 

To display the records layer with custom parameters:

public void onResume()    
{
  super.onResume();

  //we are resuming the map view, so redraw the layers
  if (m_mapView != null)
  {
    if (m_mapOptions != null)
    {
      m_mapOptions = AerisMapOptions.getPreference(getActivity());

      AerisPointData pointData = AerisPointData.RECORDS;
      ParameterBuilder params = new ParameterBuilder();
      params.withFrom("-30days");
      params.withLimit(250);

      m_locHelper = new LocationHelper(getActivity());
      Location myLocation = m_locHelper.getCurrentLocation();
      params.withPlace(myLocation.getLatitude(), myLocation.getLongitude());
      //params.withPlace("minneapolis,mn");

      AerisRequest request = pointData.getRequest(Action.CLOSEST, params, null, true);
      AerisCommunicationTask pointDataTask = new AerisCommunicationTask(m_mapView.getContext(), pointData.getHandler(m_mapView), request);
      pointDataTask.withProgress(m_mapView);
      pointDataTask.execute(new Void[0]);
    }

    //tell the map to redraw itself
    m_mapView.onResume();
  }
}
 

Polygon Data

Three new polygon layers are included with v2.0:

Convective Outlook

The convective/outlook endpoint provides convective outlook information based on the SPC convective outlooks.  Coverage of this endpoint is for the US only.

Drought Monitor

The droughts/monitor endpoint provides access to the US drought monitor information from the National Drought Mitigation Center.  Coverage of this endpoint is for the US only, and data is updated weekly.

Fire Outlook

The fires/outlook endpoint provides fire weather outlook information based on the SPC fire weather outlooks.  Coverage of this endpoint is for the US only.


//polygons m_aerisMapView.addLayer(m_mapOptions.getPolygonData()); 

/** * SAMPLE: DAY TWO CONVECTIVE */ 
AerisPolygonData aerisPolygonData = m_mapOptions.getPolygon(); 
aerisPolygonData.setConvectiveOutlookParameters(new ParameterBuilder(). 
    withFilter(Filter.DAY_TWO.getCode() + "," + Filter.GEO_POLY.getCode()). 
    withCustomParameter("from", "today")); 
m_aerisMapView.addLayer(aerisPolygonData);


For detailed information regarding how to implement maps in your Android application, please refer to the Maps section of the AerisWeather Android SDK documentation.

Last modified: July 30, 2020