Deployment for Android App Monitoring
Requirements
Permissions
Android App Monitoring requires the following permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
Minimum SDK
Android SDK 32
Installation
Gradle Installation
Add the following repository to your application build.gradle
file:
allprojects {
repositories {
// ...
maven {
url "http://gradle.germainsoftware.com/artifactory/libs-release-local"
credentials {
username 'consumer'
password 'AP6BWGtbP9TZtx2GeGvU8pE2gkX$'
}
}
}
}
Add the following dependency to your project build.gradle
file (contact Germain Support to get the latest release version)
:
dependencies {
// ...
implementation(group: 'com.germainsoftware.apm', name: 'mobile-library', version: '2022.3')
}
Maven Installation
Add the following repository to your application top build.gradle
file:
allprojects {
repositories {
// ...
maven {
url "http://gradle.germainsoftware.com/artifactory/libs-release-local"
credentials {
username 'consumer'
password 'AP6BWGtbP9TZtx2GeGvU8pE2gkX$'
}
}
}
}
Add the following dependency to your project's pom.xml
file(contact Germain Support to get the latest release version)
:
<dependency>
<groupId>com.germainsoftware.apm</groupId>
<artifactId>mobile-library</artifactId>
<version>2022.3</version>
</dependency>
Manual Installation
Few simple steps to manually install Germain UX Android App Monitoring:
Download our library in aar format (please contact Germain Support to get the latest release)
You should receive 3 components:
germain-apm-common.aar, germain-apm-data.aar, germain-apm-library.aar
Upload all aar files into your application's
libs
folderUpdate your module level gradle file and add the following:
JAVArepositories { flatDir { dirs 'libs' } } //.... dependencies { // ... your current dependencies // ... Germain UX's 3rd party dependencies not available in the aar files (please contact Germain Support for the list) // implementation 'com.esotericsoftware:kryo:4.0.1' implementation(name:'germain-apm-common', ext:'aar') implementation(name:'germain-apm-data', ext:'aar') implementation(name:'germain-apm-library', ext:'aar') }
Rebuild your app and create new release after initializing our monitoring
ProGuard Integration
If your application is using ProGuard minification/obfuscation please add the following configuration settings to your proguard-rules file:
-keepclassmembers enum com.germainsoftware.apm.data.model.** { *; }
-keepattributes LineNumberTable,SourceFile
-dontwarn org.abego.treelayout.**
-dontwarn com.google.common.**
-dontwarn com.google.auto.common.**
-dontwarn me.eugeniomarletti.kotlin.**
-dontwarn org.antlr.**
-dontwarn com.esotericsoftware.kryo.**
-dontwarn org.stringtemplate.**
To disable ProGuard on Germain UX Android App Monitoring and speed up your build you can add the following configuration settings to your proguard-rules file:
-keep class com.germainsoftware.apm.** { *; }
Initialization
Initialize Germain UX monitoring in the onCreate()
method in your Application subclass. In the simplest integration two things must be provided and the rest will get autoconfigured:
Application's context
Beacon URL where the monitoring data will be sent (contact germain Team if you don't know it)Java:
public class SampleApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
GermainAPM.init(this, "http://GERMAIN_APM_SERVER/ingestion/fact");
}
}
Kotlin:
class SampleApplication : Application() {
override fun onCreate() {
super.onCreate()
GermainAPM.init(this, "http://GERMAIN_APM_SERVER/ingestion/fact")
}
}
In addition please add the following service inside your application's AndroidManifest.xml
:
<manifest>
//....
<application>
//....
<service
android:name="com.germainsoftware.apm.mobile.library.GermainAPMService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":germainapmservice"
android:exported="false"/>
</application>
</manifest>
Component: Mobile App
Feature Availability: 8.6.0 or later