SDK Installation

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

Step 1: Get the files.  

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

Step 2: Get access to the Aeris API. 

  • To use the Aeris 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 Aeris account? You can get one for free.

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

  • Aeris Core library
    • This is the base library for accessing the AerisWeather API. If you are planning to use the Aeris 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 Aeris Core library, so you won't need to download the Core library separately. If you are planning to use Aeris to create weather maps for your Android project, this is the library for you.

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

Gradle Configuration

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

Aeris Core:

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

 

Aeris Maps: 

Remember: You do not need to to add Aeris Core when using Aeris Maps, 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 Aeris 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 Aeris 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 Aeris Android SDK. So now that we have the SDK installed, let's check out how to use it...

Last modified: January 28, 2019