Integration
Requirements
- Android SDK: API 21
Gradle
AppeliumFeedback SDK can be found in the Appelium Maven repository. Add this line to your build.gradle file to access the Maven repository:
1 2 3 4 5 | |
To use the AppeliumFeedback SDK, add this line to your build.gradle file:
implementation("com.appelium:feedback:<feedback-version>")
If you use Gradle Version Catalog, the equivalent is:
implementation(libs.appelium.feedback)
Do not use a release classifier (for example :release@aar or artifact { classifier = 'release' }).
Troubleshooting
Duplicate com.google.protobuf classes (Firebase)
The Appelium SDKs use Protobuf (com.google.protobuf:protobuf-javalite) to serialize payloads. If your app also integrates Firebase, the com.google.firebase:protolite-well-known-types artifact bundles its own copy of the com.google.protobuf.* classes. Having both on the classpath makes the build fail with a duplicate class error such as:
Execution failed for task ':app:check<Variant>DuplicateClasses'.
> Duplicate class com.google.protobuf.DescriptorProtos found in modules
protobuf-javalite-4.31.1.jar (com.google.protobuf:protobuf-javalite:4.31.1) and
protolite-well-known-types-18.0.1.aar (com.google.firebase:protolite-well-known-types:18.0.1)
Since Firebase's protolite-well-known-types already provides the com.google.protobuf runtime classes, exclude the standalone protobuf-javalite artifact pulled in transitively by the Appelium SDKs. Apply the exclusion directly on the Appelium dependencies so it stays scoped to those modules:
implementation("com.appelium:feedback:<feedback-version>") {
exclude group: "com.google.protobuf", module: "protobuf-javalite"
}
implementation("com.appelium:okhttp-v4:<okhttp-v4-version>") {
exclude group: "com.google.protobuf", module: "protobuf-javalite"
}
If you use Gradle Version Catalog, the equivalent is:
implementation(libs.appelium.feedback) {
exclude group: "com.google.protobuf", module: "protobuf-javalite"
}
implementation(libs.appelium.okhttpV4) {
exclude group: "com.google.protobuf", module: "protobuf-javalite"
}
Note
Prefer this per-dependency exclusion over a project-wide one (such as configurations.configureEach { exclude ... }), so that other libraries, configurations or build targets that legitimately need protobuf-javalite are not affected. Only apply the exclusion when another dependency (such as Firebase) already bundles the com.google.protobuf classes; if Appelium is the only library on your classpath that uses Protobuf, do not exclude it, otherwise the runtime classes will be missing.
Basic usage
To start the bug reporting interface for shake invocation events, add this line to your onCreate method in the Application class of your Android app:
AppeliumFeedback.start(apiKey = <#api key#>, application = this)
Enabling features
In the code above, we explained how simple it is to bootstrap bug reporting feature.
We believe that SDKs should be transparent and explicit about which features get enabled and when. For this reason we are making all the features off by default. Instead of going through documentation in order to find out how to disable something (which you never thought would be enabled in the first place), you can rest assured that with Appelium it is disabled unless you have explicitly enabled it 👍.
Nevertheless, lets examine other useful features that you can enable and how to pass more configuration parameters:
AppeliumFeedback.start(
apiKey = <#api key#>,
application = this,
bugReporting = BugReportingConfiguration.Enabled(),
crashReporting = CrashReportingConfiguration.Enabled(),
errorReporting = ErrorReportingConfiguration.Enabled(),
networkMonitoring = NetworkMonitoringConfiguration.Enabled(),
sessionMonitoring = SessionMonitoringConfiguration.Enabled(),
performanceTraces = PerformanceTracesConfiguration.Enabled()
)
Some features, like bug reporting allow more granular controls, e.g:
AppeliumFeedback.start(
apiKey = <#api key#>,
application = this,
bugReporting = BugReportingConfiguration.Enabled(
screenshotsEnabled = true,
screenRecording = BugReportingConfiguration.ScreenRecordingConfiguration.Enabled(
renderTouchEvents = true
),
invocationEvents = setOf(
InvocationEvent.Shake(),
InvocationEvent.Screenshot()
)
)
)
The default logs retention is 1 minute, and can be further customized via the logsRetention parameter during initialization:
AppeliumFeedback.start(
apiKey = <#api key#>,
application = this,
logsRetention = LogsRetentionConfiguration(maxLifetimeMs = 120_000, maxCount = 1_000)
)
Additionally, you can set the name and/or the version of the backend environment. This is very useful for network monitoring as it will allow you to compare network performance across different environments and different versions.
AppeliumFeedback.setApplicationEnvironment(name = "STAGING", version = "2.4.0")
Required permissions
android.permission.INTERNETandroid.permission.READ_EXTERNAL_STORAGEandroid.permission.WRITE_EXTERNAL_STORAGEandroid.permission.READ_BASIC_PHONE_STATE
Next steps
Once you integrated the SDK, you can add enrich the bug reports with Console Logs and Network Logs.
You can obtain the api key in Dashboard under application specific settings.