Installation

Installation

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

Download the files.

Download (opens in a new tab) the latest version of the Xweather Android SDK. This includes the Xweather Demo project for code examples using the Xweather Android libraries.

Determine which components you need.

AerisWeather Core library

AerisMap library

  • This library provides access to Xweather 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 Xweather to create weather maps for your Android project, this is the library for you.

Include the SDK files.

Finally, you'll need to include the required Xweather Android SDK files in your project's gradle.build file(s).

Gradle Configuration

The AerisWeather Core and Maps libraries are available through the Central Repository (opens in a new tab). 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'
}
dependencies {
    implementation 'com.aerisweather:aeris-core-lib:#.#.#@aar'
}

AerisWeather Maps:

Remember: You do not need to add AerisWeather Core when using AerisWeather Maps, as the core library is referenced in the maps library.

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

Permissions

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

<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.example.demoaerisproject">
  <!-- 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>

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.** { *; }