Deployment for Android App Monitoring

🚀 Deploy Monitoring for an Android Application

📂 Overview

Deploy Android application monitoring by adding the GermainUX Mobile App library to the Android project, initializing it when the application starts, and configuring the required Android permissions and service.

The library can collect configured:

Item

1

User sessions

2

Application lifecycle events

3

Launch performance

4

Screens, views, and fragments

5

Transactions

6

Crashes and exceptions

7

Application and device metrics

8

System events permitted by Android

The application must be rebuilt and released after the library is added.

📋 Requirements

Before deployment:

Requirement

Confirm that the Android and Java or Kotlin versions are supported by the current GermainUX Mobile App library.

Obtain the latest library version and repository access from GermainUX.

Obtain the HTTPS ingestion URL for the GermainUX environment.

Confirm that the application can send outbound HTTPS requests to GermainUX.

Define the application name and environment.

Review privacy, security, and user-consent requirements.

Test the integration in a nonproduction build.

Do not use package versions, repository credentials, or ingestion URLs copied from an older deployment. Obtain the current values for your GermainUX environment.

🔒 Required Android Permissions

Add the required permissions to AndroidManifest.xml:

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

    <application>
        <!-- Application configuration -->
    </application>
</manifest>

Additional permissions may be necessary only for optional system-event or device monitoring. Request permissions only when they are required by the application and approved by its privacy and security policies.

Android may restrict access to certain system events regardless of the declared permissions.

📦 Obtain the Mobile App Library

GermainUX can provide the Android library through:

Distribution

A private Maven-compatible repository

Android Archive (.aar) files for manual installation

Use the current package and dependency information supplied with the library release. Never place repository credentials directly in source control.

Store repository credentials in an approved Gradle properties file, environment variable, CI/CD secret, or credential-management system.

⚙️ Option 1: Install with Gradle

Add the GermainUX repository to the project’s dependency-management configuration using the repository URL and credentials provided for your environment.

Example structure:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()

        maven {
            url = uri("GERMAINUX_REPOSITORY_URL")

            credentials {
                username = providers.gradleProperty(
                    "germainRepositoryUsername"
                ).get()

                password = providers.gradleProperty(
                    "germainRepositoryPassword"
                ).get()
            }
        }
    }
}

Add the current GermainUX Mobile App dependency to the application module:

dependencies {
    implementation(
        "com.germainsoftware.apm:mobile-library:CURRENT_VERSION"
    )
}

Replace the placeholders with the repository and release information supplied by GermainUX.

Do not hard-code repository credentials in build.gradle, build.gradle.kts, or another committed project file.

📂 Option 2: Install AAR Files

For manual installation:

  1. Obtain the current GermainUX .aar files and dependency list.

  2. Copy the files into the application module’s libs directory.

  3. Add the local repository to the module configuration.

  4. Add each required AAR as a dependency.

  5. Add any external dependencies not packaged inside the AAR files.

  6. Synchronize and rebuild the project.

Example:

repositories {
    flatDir {
        dirs("libs")
    }
}

dependencies {
    implementation(
        mapOf(
            "name" to "germain-apm-common",
            "ext" to "aar"
        )
    )

    implementation(
        mapOf(
            "name" to "germain-apm-data",
            "ext" to "aar"
        )
    )

    implementation(
        mapOf(
            "name" to "germain-apm-library",
            "ext" to "aar"
        )
    )
}

The archive names and external dependencies can change between releases. Use the files and instructions supplied with the installed version.

✨ Initialize GermainUX

Create or update the application’s Application subclass and initialize GermainUX in onCreate().

☕ Java

Java
import android.app.Application;
import com.germainsoftware.apm.mobile.library.GermainAPM;

public class MonitoredApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        GermainAPM.init(
            this,
            "https://YOUR_GERMAINUX_HOST/ingestion/fact"
        );
    }
}

🧩 Kotlin

Python
import android.app.Application
import com.germainsoftware.apm.mobile.library.GermainAPM

class MonitoredApplication : Application() {

    override fun onCreate() {
        super.onCreate()

        GermainAPM.init(
            this,
            "https://YOUR_GERMAINUX_HOST/ingestion/fact"
        )
    }
}

Replace the sample URL with the ingestion URL assigned to the GermainUX environment.

Always use HTTPS in production.

🔖 Register the Application Class

If the application does not already register a custom Application subclass, add it to AndroidManifest.xml:

HTML
<application
    android:name=".MonitoredApplication">

    <!-- Activities and services -->

</application>

If the application already has an Application subclass, add GermainUX initialization to that existing class instead of creating a second one.

Initialize the library once per application process unless the supplied release documentation specifies otherwise.

🔌 Register the GermainUX Service

Add the GermainUX service inside the <application> element:

<service
    android:name=
        "com.germainsoftware.apm.mobile.library.GermainAPMService"
    android:permission="android.permission.BIND_JOB_SERVICE"
    android:process=":germainapmservice"
    android:exported="false" />

Keep the service non-exported so other applications cannot start it directly.

Verify the required service declaration against the documentation included with the installed library version.

🗺️ Configure Network Security

Confirm that:

Check

The ingestion endpoint uses a trusted TLS certificate.

The application is permitted to connect to the GermainUX hostname.

Network-security configuration does not block the endpoint.

Proxies, VPNs, firewalls, or mobile-device policies permit the connection.

Cleartext HTTP traffic is not required.

Certificate pinning, when used, accounts for the approved GermainUX endpoint.

Do not disable Android network-security controls globally to enable monitoring.

✂️ Configure Code Shrinking and Obfuscation

If the application uses R8 or ProGuard:

  1. Obtain the rules supplied with the current GermainUX library.

  2. Add them to the application’s shrinker configuration.

  3. Preserve the model classes and attributes required for serialization and diagnostic stack traces.

  4. Build a release variant.

  5. Verify that monitoring works after shrinking and obfuscation.

  6. Retain the mapping file for crash analysis.

Avoid broad -dontwarn or -keep rules unless they are required by the installed library version. Rules from older releases may hide legitimate dependency or build problems.

🛡️ Configure Privacy Before Release

Review every automatically or manually captured attribute.

Do not collect:

Prohibited data

Passwords

Authentication tokens

Payment-card data

Sensitive personal or health information

Message or form content that is not required

Unrestricted exception values containing confidential data

Configure:

Configuration

Anonymous or pseudonymous user identification

Allowed application and device attributes

Custom-event and transaction attributes

Error-message filtering

Data retention

Access permissions

Environment separation

Do not include secrets in build constants or monitoring attributes.

🧪 Build and Test

After installation:

  1. Clean and rebuild the Android project.

  2. Confirm that dependency resolution succeeds.

  3. Launch the application.

  4. Verify that initialization completes without an exception.

  5. Generate a normal user session.

  6. Navigate through representative screens and fragments.

  7. Execute a monitored transaction.

  8. Send a controlled handled exception.

  9. Validate crash collection in a safe test build.

  10. Confirm that telemetry appears in GermainUX.

  11. Verify the application name, version, environment, and device context.

  12. Measure startup and runtime overhead.

  13. Confirm that sensitive information is excluded.

Test both debug and release builds because shrinking, obfuscation, signing, and network settings may differ.

📣 Release

After validation:

  1. Use the approved production ingestion endpoint.

  2. Confirm the production application and environment identifiers.

  3. Verify privacy and retention settings.

  4. Publish the monitored build through the normal release process.

  5. Monitor initial telemetry volume, errors, and performance.

  6. Compare the new release with the previous application version.

  7. Configure dashboards, SLAs, alerts, and reports.

warning Troubleshooting

⛔ The library cannot be downloaded

Verify:

Item

Repository URL

Repository credentials

Network or proxy access

Dependency coordinates and version

Gradle repository configuration

Credential availability in the local or CI/CD environment

🔧 The application does not compile

Check:

Potential cause

Android and Java or Kotlin compatibility

Duplicate dependencies

Missing external dependencies

AAR file names

R8 or ProGuard configuration

Android manifest merging errors

Release notes for the installed library

📡 No telemetry reaches GermainUX

Confirm that:

Check

GermainAPM.init() executes.

The ingestion URL is correct.

The URL uses HTTPS.

The device can reach the GermainUX environment.

The service is registered correctly.

The application has internet permission.

Network-security or certificate policies do not block the connection.

The selected GermainUX application and environment are enabled.

🔍 Debug works but the release build fails

Review:

Area

R8 or ProGuard rules

Obfuscation

Release-only network configuration

Product flavors

Build-time endpoint selection

Certificate pinning

CI/CD secret injection

ℹ️ Get More Information

GermainUX can help determine which monitoring, analytics and automation capabilities are appropriate for your Android App environment.

Contact GermainUX Support.

Feature Availability: 2022.1 or later