SDK Installation

To begin using the AerisWeather Android SDK in your project, download the latest version of the SDK and ensure that you have the required AerisWeather API keys for your application. 

Step 1: Get the files.  

  • Download the latest version of the AerisWeather Android SDK. This includes the AerisWeather Demo project for code examples using the AerisWeather Android libraries. 

Step 2: Get access to the AerisWeather API. 

  • To use the AerisWeather API, you will need valid access keys. Access keys are obtained by registering your application/namespace with AerisWeather. To register your application, log in to AerisWeather with your account and look for "APPS". 

  • Don't have an AerisWeather account? You can get one for free.

Step 3: Determine which components of the AerisWeather Android SDK you need for your project:

  • AerisWeather Core library
    • This is the base library for accessing the AerisWeather API. If you are planning to use the AerisWeather API for data without a map component, this is all you need.

  • AerisMap library

    • This library provides access to AerisWeather mapping features such as radar, satellite, warnings, etc. 

    • The map library includes a dependency to the AerisWeather Core library, so you won't need to download the Core library separately. If you are planning to use AerisWeather to create weather maps for your Android project, this is the library for you.

Step 4: Include the AerisWeather Android SDK files in your project's gradle.build file(s).

Gradle Configuration

The AerisWeather Core and AerisWeather Maps libraries are available through the Central Repository. To add these dependencies to your project add these lines to your build.gradle file. 

AerisWeather Core:

repositories {
    mavenCentral()
}
dependencies {
    compile 'com.aerisweather:aeris-core-lib:#.#.#@aar'
}

 

AerisWeather Maps: 

Remember: You do not need to to add AerisWeather Core when using Thr AerisWeather Mapping Platform, as the core lib is referenced in the maps lib.

repositories {
    mavenCentral()
}
dependencies {
    compile 'com.aerisweather:aeris-maps-lib:#.#.#@aar'


Permissions

The following permissions are required in order to use the AerisWeather Android SDK in the application. Please add these to your AndroidManifest.xml:

<manifest>
  <!-- Internet is required to make calls to the Aeris API -->
  <uses-permission android:name="android.permission.INTERNET" />

  <!-- Aeris Library uses the network state to determine if network is availabe to make calls  -->
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

  <!-- Google maps requries this now with tiles -->
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

  <!-- (Optional If you want location services to be used as well) -->
  <uses-permission android:name="android.permission.ACCESS_COURSE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</manifest>

 

AerisDemo App

The SDK also includes a demo app, providing code examples of many common Core and Map library usages. For more details regarding the set up and use of the demo, check out the AerisWeather Demo App page

 

Using Proguard

If you are using Proguard in your application, you may want to add -keep or -keepclassmembers to your Proguard config file. Since Proguard obfuscates (renames) and shrinks (removes) code, debugging low level issues can be more challenging if the key members are missing or renamed in a production build.

-keep
Keeps the classes and class members that implement android.os.Parcelable from being removed or renamed.

-keepclassmembers
Keeps the class members only of classes that implement android.os.Parcelable from being removed or renamed.

Config Entries

If you are using SDK version 1.2 or older, the statement for the Proguard config file would be:
-keepclassmembers class com.hamweather.aeris.model.** { *; }

If you are using SDK version 2.0 or newer, add the following line:
-keepclassmembers class com.aerisweather.aeris.model.** { *; }

 

That’s it! 

Your project is ready to start using the AerisWeather Android SDK. So now that we have the SDK installed, let's check out how to use it...

Last modified: July 30, 2020