Skip to content

refactor(android SDK): convert MParticleApiClientImpl to Kotlin - #1006

Merged
nickolas-dimitrakas merged 1 commit into
refactor/convert-networkconnection-andfrom
refactor/convert-mparticleapiclientimpl-to-kotlin
Nov 11, 2026
Merged

nickolas-dimitrakas merged 1 commit into
refactor/convert-networkconnection-andfrom
refactor/convert-mparticleapiclientimpl-to-kotlin

Conversation

@nickolas-dimitrakas

Copy link
Copy Markdown
Contributor

Why

Risk class M.

This pull request converts row B3 of the Kotlin migration tracker from Java to Kotlin: MParticleApiClientImpl, the last row of Stack B (networking). It is stacked on row B2's pull request.

Programme

The Java-to-Kotlin migration of android-core, the migration tracker row B3 (Stack B, networking), converted using the Kotlin kotlin-tooling-java-to-kotlin skill and the migration playbook.

What changes

  • Converts MParticleApiClientImpl to Kotlin in com.mparticle.internal with zero change to the public API dump relative to row B2.
  • Explicit conversion choices: MParticleApiClientImpl and its methods stay open; all @Throws annotations match MParticleApiClientTest; MPThrottleException and MPConfigException stay inner class with internal constructor(), and MPRampException and MPNoConfigException stay nested class declarations with internal constructor().
  • mDeviceRampNumber becomes @JvmField internal var, setConfigUrl, addMessageSignature, and checkThrottleTime become internal open fun, and DEFAULT_THROTTLE_MILLIS and MAX_THROTTLE_MILLIS sit in an internal companion object.
  • getCookies and setCookies stay functions. Parameters are nullable (T?) and dereferenced with !! where the Java code first used them, and sendAliasRequest returns a non-null AliasNetworkResponse.

Linked work

Stacked on row B2 (NetworkConnection and MParticleBaseClientImpl), following row B1 (#985).

Rollout

Merges with no release and reaches apps in the next SDK release. Revert the squash commit to roll back. Risk class M: the stack's QA smoke run is needed before this pull request merges.

Risks

  • Request signing, throttling, ramp sampling, or cookie parsing regression: verified by MParticleApiClientImplTest, MParticleApiClientTest, and UploadHandlerTest.

Who

Prepared by an automated coding agent as row B3 of the migration tracker and reviewed by the SDK team before merge.

Size

527 lines added and 488 removed across 2 files (MParticleApiClientImpl converted from Java to Kotlin, with zero API dump diff relative to row B2).

@nickolas-dimitrakas
nickolas-dimitrakas requested a review from a team as a code owner November 10, 2026 21:18
@nickolas-dimitrakas nickolas-dimitrakas self-assigned this Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Kotlin migration progress

This pull request converts 487 lines of Java to Kotlin.

Module Kotlin LOC Java LOC Java staying (facade) Java left to convert Kotlin share
android-core 9,661 16,341 9,716 6,625 37.2%
android-kit-base 601 5,405 1,651 3,754 10.0%
Total 10,262 21,746 11,367 10,379 32.1%

Conversion progress: 37.3% (10,379 of 16,550 baseline Java LOC left to convert). 93 Java files and 75 Kotlin files in scope.

@github-actions

Copy link
Copy Markdown

Binary compatibility

  • ✅ android-core is compatible with 6.1.10 (112 classes compared, 0 with additions only).
  • ✅ android-kit-base is compatible with 6.1.10 (37 classes compared, 0 with additions only).

Compares this branch with the last version published to Maven Central, both built without R8, over the public classes and members that release keeps under their own names. It also checks that this branch's release AAR still keeps them (see the script docstring). Full japicmp HTML/XML reports are attached as the api-compat-reports workflow artifact. This check is not in the required-check set yet, so a red result here does not block merging.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

📦 SDK Size Impact Report

What the SDK adds to a minified release APK.

mParticle Core SDK

Measured against an empty baseline app. Unlike the Rokt kit, android-core ships no Compose and no resources, so there is nothing here that a host app would already provide.

Metric Target branch This PR Change
APK size 121.65 KB 121.84 KB +196 bytes
Download size 119.47 KB 119.66 KB +194 bytes
Dex bytes 219.13 KB 219.52 KB +404 bytes

mParticle Core + Rokt kit

Measured against a Compose + Material3 reference app, so these are the costs on top of an app that already ships Compose. The reference app's dependencies are a documented convention, not a measured average: see size-report-rokt/README.md.

Metric Target branch This PR Change
APK size 1.26 MB 1.26 MB 0 bytes
Download size 1.25 MB 1.25 MB +1.15 KB
Dex bytes 2.24 MB 2.24 MB +340 bytes

Rokt SDK+ umbrella (adds the payment extension)

Metric Target branch This PR Change On top of mParticle Core + Rokt kit
APK size 6.55 MB 6.55 MB 0 bytes +5.29 MB
Download size 6.44 MB 6.43 MB -565 bytes +5.19 MB
Dex bytes 7.12 MB 7.12 MB +2.26 KB +4.89 MB

➡️ SDK size impact change is minimal.

Raw measurements

core, Target branch:

{"baseline_dex_bytes": 0, "baseline_download_bytes": 2514, "baseline_install_bytes": 7530, "core_dex_bytes": 224388, "core_download_bytes": 124848, "core_install_bytes": 132099}

core, This PR:

{"baseline_dex_bytes": 0, "baseline_download_bytes": 2512, "baseline_install_bytes": 7528, "core_dex_bytes": 224792, "core_download_bytes": 125040, "core_install_bytes": 132293}

rokt, Target branch:

{"baseline_dex_bytes": 1829108, "baseline_download_bytes": 1240062, "baseline_install_bytes": 1300934, "kit_dex_bytes": 4173860, "kit_download_bytes": 2548490, "kit_install_bytes": 2623275, "sdkplus_dex_bytes": 9297816, "sdkplus_download_bytes": 7987810, "sdkplus_install_bytes": 8165359}

rokt, This PR:

{"baseline_dex_bytes": 1829108, "baseline_download_bytes": 1240062, "baseline_install_bytes": 1300934, "kit_dex_bytes": 4174200, "kit_download_bytes": 2549665, "kit_install_bytes": 2623275, "sdkplus_dex_bytes": 9300132, "sdkplus_download_bytes": 7987245, "sdkplus_install_bytes": 8165359}

Measured 36ec9f4 merged into 20e1070

@jamesnrokt jamesnrokt added the promoted Opened from Rokt's internal review process label Nov 11, 2026
@nickolas-dimitrakas
nickolas-dimitrakas merged commit 3a522f9 into main Nov 11, 2026
126 of 133 checks passed
@nickolas-dimitrakas
nickolas-dimitrakas deleted the refactor/convert-mparticleapiclientimpl-to-kotlin branch November 11, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change-approved promoted Opened from Rokt's internal review process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants