linkrunner

The Linkrunner Android SDK provides native integration for Linkrunner functionality in Android applications.

Features

  • Easy initialization and setup

  • User management and tracking

  • Payment tracking and management

  • Event tracking

  • Deeplink handling

Installation

dependencies {
implementation 'io.linkrunner:android-sdk:1.0.0'
}

Measuring LinkRunner SDK Size Impact

Quick Size Overview

  • Download Size: 123KB (AAR file)

  • Estimated APK Impact: 30-80KB (varies by app configuration)

  • Method Count: ~300 methods

How to Measure SDK Size Impact in Your App

Method 1: Before/After APK Comparison (Simplest)

  1. Measure Base APK Size:

    # Build your app WITHOUT LinkRunner SDK
    ./gradlew assembleRelease
    # Note the size
    ls -lh app/build/outputs/apk/release/app-release.apk
  2. Add LinkRunner SDK:

    // In app/build.gradle
    dependencies {
    implementation 'io.linkrunner:android-sdk:2.1.5'
    }
  3. Measure New APK Size:

    ./gradlew clean assembleRelease
    ls -lh app/build/outputs/apk/release/app-release.apk
  4. Calculate Impact:

    • SDK Impact = New APK Size - Original APK Size

Method 2: Using Android Studio APK Analyzer

  1. Open Android Studio

  2. Analyze Base APK:

    • Build your app without SDK

    • Go to Build > Analyze APK

    • Select your APK

    • Note total size and DEX size

  3. Analyze With SDK:

    • Add LinkRunner SDK

    • Build again

    • Analyze new APK

    • Compare sizes

    • Look for io.linkrunner in DEX files

  4. Key Metrics to Check:

    • Total APK size difference

    • DEX file size increase

    • Number of methods added

    • New dependencies introduced

Method 3: Using Gradle Build Analysis

Add this to your app's build.gradle:

android {
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

// Add at the end of the file
tasks.register("apkSizeReport") {
doLast {
def apkDir = new File("${project.buildDir}/outputs/apk/release")
apkDir.listFiles().each { file ->
if (file.name.endsWith('.apk')) {
println "APK: ${file.name}"
println "Size: ${file.length() / 1024 / 1024} MB"
}
}
}
}

Then run:

./gradlew clean assembleRelease apkSizeReport

Size Optimization Tips

  1. Enable R8/ProGuard:

    android {
    buildTypes {
    release {
    minifyEnabled true
    shrinkResources true
    }
    }
    }
  2. Add ProGuard Rules:

    # Add to proguard-rules.pro
    -keep class io.linkrunner.sdk.** { *; }
  3. Enable ABI Filters if you don't need all architectures:

    android {
    defaultConfig {
    ndk {
    abiFilters 'armeabi-v7a', 'arm64-v8a'
    }
    }
    }

Expected Size Impact

Minimal~30KB- ProGuard enabled
- App already uses similar dependencies
- ABI filtering enabled
Average~50KB- ProGuard enabled
- Some shared dependencies
- Default configuration
Maximum~80KB- ProGuard disabled
- No shared dependencies
- All ABIs included

Dependency Size Breakdown

Our SDK uses these major dependencies:

  • Retrofit + OkHttp: ~150-200KB

  • Coroutines: ~100-150KB

  • Koin: ~50KB

  • Play Services: ~100KB

Note: If your app already uses these dependencies, they won't add to the final APK size.

Troubleshooting Size Issues

If you see unexpectedly large size increases:

  1. Check Dependency Conflicts:

    ./gradlew app:dependencies
  2. Analyze DEX Content:

    • Use Android Studio's APK Analyzer

    • Look for duplicate classes

    • Check if R8/ProGuard is working correctly

  3. Enable Detailed Build Reports:

    android {
    buildTypes {
    release {
    minifyEnabled true
    shrinkResources true
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
    }
    }

Need Help?

If you're seeing unexpected size impacts or need help optimizing, please:

  1. Open an issue on our GitHub repository

  2. Include your build configuration

  3. Share the size analysis results

  4. List any optimization steps you've tried

We're committed to helping you maintain an optimal app size while using our SDK.

Packages

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard