Skip to main content

Android SDK

While DeployGate can distribute an app with just an APK file upload, incorporating an SDK makes the app development process more seamless.


SDK Installation (Android Studio/Gradle)

  1. Enter the following into the app module’s build.gradle file (Example: app/build.gradle).
build.gradle
// Groovy DSL

dependencies {
// Use SDK dependency for variants like debug.
debugImplementation "com.deploygate:sdk:${latest_version}"

// Use no-op inplementation for vatiants you would like to disable DeployGate SDK.
releaseImplementation "com.deploygate:sdk-mock:${latest_version}"
}
build.gradle.kts
// Kotlin DSL

dependencies {
// Use SDK dependency for variants like debug.
debugImplementation("com.deploygate:sdk:${latest_version}")

// Use no-op inplementation for vatiants you would like to disable DeployGate SDK.
releaseImplementation("com.deploygate:sdk-mock:${latest_version}")
}
When sdk-mock is preferable?

Currently, we provides two dependencies for Android apps.

  • com.deploygate:sdk
  • com.deploygate:sdk-mock

Please use sdk-mock dependency for production builds instead of sdk when you would like to disable DeployGate SDK on production builds. sdk-mock dependency has public interfaces that are same as of sdk but their implementations are empty, so you don't have to modify your app code for specific build variants.

For apps that are targeting API 30 or later

Please use Android SDK 4.3.0 or later. If use 4.3.0 or earlier, for devices with Android 11 or later, package queries must be enabled for SDK to connect to DeployGate services. As such, please add the following to AndroidManifest.xml.

<queries>
<package android:name="com.deploygate" />
</queries>
  1. On Android Studio, click on Sync Project With Gradle Files to apply the edits.

Screenshot of Android sdk

  1. After building and distributing an app with DeployGate, the app’s launch and crash reports will be available on DeployGate.
Building and uploading is easy with the Gradle DeployGate Plugin

Gradle Plugin allows you to build and upload by simply running Gradle task.

DeployGate SDK will not function with builds not distributed via DeployGate

DeployGate SDK will only function with builds distributed via DeployGate in conjunction with the DeployGate app. It will not function when installed on emulators or devices directly connected to development environments, not through DeployGate.

Some features provided by DeployGate SDK might function only with specific OS version or later

Please review the corresponding references listed below for more details.

References