Panchaksharappa, Varuna

Upgrade mPulse SDK - version 20.32 and above for Android



  • An Android app using the mPulse SDK with an associated API/license key. 

  • Familiarity with mPulse features and configurations available with the SDK. For more information on that, see the Getting Started Guide.


Sample App: Download

We've created a sample project that you can use to validate the setup and functionality of the SDK. You can use this sample app to compare against your legacy and make sure everything is working correctly, as outlined in the step below.


Upgrade to mPulse SDK v20.32 and above

Step 1: Support AndroidX libraries

The SDK supports API 15 and above.​ ​The target/compile SDK should be atleast set to API 28 and it is also ​required by Google for any app updates from Novemb​er 2019​. Google no longer maintains support libraries up until version 28 and has made androidX the default support library in Android Studio. ​mPulse SDK has migrated from Android Support libraries to androidx-packaged​ library artifacts. This will not only make our SDK better, but also allows us to use the latest ​Jetpack features​.​ ​If you have not migrated to androidX library artifacts, add the following two lines to your ​​ file to use mPulse SDK.



AndroidX also requires minimum build tools version​ to be set '' ​in the root build.gradle​ file. The minimum gradle version should be set at ​gradle-4.6 ​in the ​​.


Step 2: Adding dependencies.

If you have previously included the aar file locally in the lib folder, remove that library first. The project gradle file should have jcenter() by default.

If not, add it as shown below.

allprojects {

   repositories {





Note: For all the steps following, the column on the left shows the existing code. Replace this code with the code in the column on the right.  


Legacy SDK

mPulse SDK with Common Framework

apply plugin: ""

implementation 'com.soasta.mpulse:mpulse-android:2.6.1'

implementation ''


Step 3: Edit the app-level build.gradle to remove the plugin;

Legacy SDK

mPulse SDK with Akamai Common Framework

apply plugin: ""


Note: Remove the plugin



Step 4: Edit the project-level build.gradle to remove the classpath

Legacy SDK

mPulse SDK with Common Framework

classpath 'com.soasta.mpulse:mpulse-android-gradle-plugin:2.6.1'


Note: At this point you’ll see compile errors in your project. This is expected behavior because you’re no longer using the soasta package, com.soasta.mpulse.


Step 5: Android studio will usually import all the packages automatically. The packages will be changed as follows. 

After doing step 1, step 2 and step 3, you’ll see compile errors in your project. This is expected behavior because you’re no longer using the soasta package, com.soasta.mpulse. 

All com.soasta.* is renamed to com.akamai.*

Legacy SDK

mPulse SDK with Akamai Common Framework


import com.soasta.mpulse.core.MPLog;




import com.soasta.mpulse.core.beacons.MPBeacon;

import com.soasta.mpulse.core.filter.MPFilter;

import com.soasta.mpulse.core.filter.MPFilterResult;


import com.soasta.mpulse.core.MPulseMetricTimerOptions;

import com.soasta.mpulse.core.config.MPulseSettings;


import com.akamai.mpulse.core.MPLog;




import com.akamai.mpulse.core.beacons.MPBeacon;

import com.akamai.mpulse.core.filter.MPFilter;

import com.akamai.mpulse.core.filter.MPFilterResult;


import com.akamai.mpulse.core.MPulseMetricTimerOptions;

import com.akamai.mpulse.core.config.MPulseSettings;


Step 6: Third-party libraries traffic

If you’re using third-party networking libraries like OkHTTP/Retrofit, then you need to add the AkaOkHttpAppInterceptor wrapper, if you are using Picasso then you need to add AkaPicassoDownloader to your app. If you ignore this part, you won’t be able to track traffic from those third-party libraries. 


  • If you’re using OkHTTP, use the following. 

OkHTTP - Adding wrapper

OkHttpClient client = new OkHttpClient.Builder()

       .addInterceptor(new AkaOkHttpAppInterceptor())



  • If you’re using Retrofit, use the following. 

Retrofit - Adding wrapper

Retrofit retrofit = new Retrofit.Builder()






  • If you’re using Picasso, use the following. 

Picasso - Adding wrapper

Picasso mPicasso = new Picasso.Builder(getApplicationContext())

           .downloader(new AkaPicassoDownloader(getApplicationContext()))





Step 7: Initialization

Initialization has been improved and is auto-initialized. Remove usage of MPulse.initializeWithAPIKey API.

Legacy SDK

mPulse SDK with Akamai Common Framework

public static final String MPULSE_API_KEY = "28L3-XCVBGH-HGJ-UN5";


MPulse.initializeWithAPIKey(MPULSE_API_KEY, getApplicationContext());


Auto Initialization


Step 8: Adding API KEY


Next, you need to create a new file and add the API Key there. 

At the project level, in the res folder, create a folder called xml

In the xml folder, create a file named akamai_sdk_init.xml, as mentioned below. Note that your license key is unique, the one below is just an example. 

<?xml version="1.0" encoding="utf-8"?>
<!-- Add you API KEY -->


To reference the API key, you need to add below meta-data In AndroidManifest.xml.

  <activity...   </activity>
      android:resource="@xml/akamai_sdk_init" />


Save and close the file. 

Step 9: To enable Debug Logging, change the following lines as shown. 


Legacy SDK

mPulse SDK with Akamai Common Framework

import com.soasta.mpulse.core.MPLog;




Note: MPLog is deprecated.




As a final step, compile your app. It should compile without errors, and you’re good to go.