Skip to content

Android SDK

This document applies to our SDK version 3 for Android.

Integration Requirements

The SDK supports devices with these minimum requirements:

  • At least Android API 16 (Jelly Bean 4.1).

Supported CPU architectures

  • arm64-v8a
  • armeabi-v7a
  • x86
  • x86_64

Known limitations

Emulation support

Android Studio default emulators may not work properly with our Edge Delivery Service. We highly recommend you trying other emulators or simply testing with real mobile devices.

CPU architectures

Our SDK depends on third party native code libraries. If you use additional native code libraries in your app, please take the this into account:

Android's way of managing multiple native code libraries bundled within the same app is as follows:

  1. When you launch an app in a phone / device, Android searches through all of the bundled libraries for the closest CPU architecture to the device's actual CPU.
  2. Any library that doesn't specifically support that CPU architecture may not load, even if it supports a backward compatible CPU.

For example: An app uses two libraries, supporting the following architectures:

  • Library #1: arm64-v8a, armeabi-v7a, x86, x86_64.
  • Library #2: armeabi-v7a, x86, x86_64.

If you try the app in a phone with an armeabi-v7a CPU, it may run fine. But, the very same app in a phone with an arm64-v8a CPU may fail to load library #2.

You should make sure that all libraries that you include in your project, or get included as dependencies, support at least the CPUs listed at Requirements.

TLS support on Android 4

Our service uses up-to-date TLS versions. Android 4.x devices ship with TLS v1.2, but it is disabled by default. To enable it, you have to patch the device's security provider. You can follow the recommended practice here: Updating Your Security Provider to Protect Against SSL Exploits.

In short:

Just call ProviderInstaller.installIfNeeded() or ProviderInstaller.installIfNeededAsync() once, during your app's initialisation process.

The device must have Google Play Services and Google Play for this to work. If they are not installed, ProviderInstaller will fail with an exception. You can catch it and prompt the user to install or update Google Play Services.

Installing or updating Google Play Services depends on the country and device brand. If the device comes with Google Play app, the user can install Google Play Services from it. If not, the user has to manually find and install two APK files (Google Play and Google Play Services). Also, Google Play Services may have been banned in some countries.

You can detect the affected Android versions like this:

if (Build.VERSION.SDK_INT >= 15 && Build.VERSION.SDK_INT <= 20) {

    // ... you are running inside Android 4

}

Integration sample

A reference integration sample application can be obtained from here. Once you download the repository, import it in Android Studio using the Import project... option from the menu. When you are ready, build and run the application. The required parameters and order of operations are described in detail below.

Downloads

The Android SDK is automatically downloaded when adding the corresponding dependency in the build.gradle file, as explained in the following section. Please contact System73 Support for Android SDK download information.

Adding our SDK to your project

Permissions

Add the following permissions in your project's AndroidManifest.xml file:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Arbitrary HTTP Loads

By default, the application will prevent non secure HTTP requests. Open the AndroidManifest.xml and add the following code to allow arbitrary HTTP requests.

<application 
    ... 
    android:usesCleartextTraffic="true"
    ...>

Gradle setup

To integrate the SDK, first set up the System73 Maven repository in the project's build.gradle file:

allprojects {
   repositories {
       // ... other repositories
       maven {
           url "https://<SYSTEM73_MAVEN_HOST>/repository/maven-s73-releases"
       }
   }
}
  • Then add the following sentence inside the dependencies section of the module's build.gradle file:
implementation 'com.system73.polynet:polynet-android-sdk:3.3.0-xxx'

This will automatically download and import the SDK and all its required dependencies in your Android project.