Repository navigation
refactor(android SDK): convert MParticleApiClientImpl to Kotlin - #1006
Conversation
Kotlin migration progressThis pull request converts 487 lines of Java to Kotlin.
Conversion progress: 37.3% (10,379 of 16,550 baseline Java LOC left to convert). 93 Java files and 75 Kotlin files in scope. |
Binary compatibility
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 |
📦 SDK Size Impact ReportWhat the SDK adds to a minified release APK. mParticle Core SDKMeasured 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.
mParticle Core + Rokt kitMeasured 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
Rokt SDK+ umbrella (adds the payment extension)
➡️ SDK size impact change is minimal. Raw measurementscore, 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} |
e5f7178 to
36ec9f4
Compare
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 Kotlinkotlin-tooling-java-to-kotlinskill and the migration playbook.What changes
MParticleApiClientImplto Kotlin incom.mparticle.internalwith zero change to the public API dump relative to row B2.MParticleApiClientImpland its methods stayopen; all@Throwsannotations matchMParticleApiClientTest;MPThrottleExceptionandMPConfigExceptionstayinner classwithinternal constructor(), andMPRampExceptionandMPNoConfigExceptionstay nestedclassdeclarations withinternal constructor().mDeviceRampNumberbecomes@JvmField internal var,setConfigUrl,addMessageSignature, andcheckThrottleTimebecomeinternal open fun, andDEFAULT_THROTTLE_MILLISandMAX_THROTTLE_MILLISsit in aninternal companion object.getCookiesandsetCookiesstay functions. Parameters are nullable (T?) and dereferenced with!!where the Java code first used them, andsendAliasRequestreturns a non-nullAliasNetworkResponse.Linked work
Stacked on row B2 (
NetworkConnectionandMParticleBaseClientImpl), 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
MParticleApiClientImplTest,MParticleApiClientTest, andUploadHandlerTest.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 (
MParticleApiClientImplconverted from Java to Kotlin, with zero API dump diff relative to row B2).