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 21 (Lollipop 5.0).
Supported CPU architectures¶
The SDK supports these CPU architectures:
- arm64-v8a
- armeabi-v7a
- x86
- x86_64
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:
- 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.
- 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.
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"
...>
Large Heap¶
The default heap size for Android apps is deliberately constrained to ensure equitable memory distribution among various applications on a device. However, scenarios arise where the SDK requires caching a brief video data interval, potentially exceeding the heap limit due to varied video encoding segment sizes. To address this, you can enable a larger heap size by setting android:largeHeap="true"
in the AndroidManifest.xml file. This adjustment grants the app permission to request expanded memory allocation from the system. Open the AndroidManifest.xml
and insert the following code snippet under application tag to implement this modification.
<application
...
android:largeHeap="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://artifacts.s73cloud.com/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.15.0'
This will automatically download and import the SDK and all its required dependencies in your Android project.
This section was last updated 2024-11-18