Set the Username with the Aternity Android SDK (setUsername)

You can set a username for a mobile app in Aternity Mobile SDK to be consistent with desktops and laptops, so you can track this user's experience across all devices and platforms.In Android, you can set the username of the application at initialization, or separately using the setUsername method from the Aternity class.

Example of usernames for mobile devices displayed in the dashboards

The Aternity class provides the getInstance method which returns a singleton object. You should call the class's methods using the singleton object, to avoid manually creating and maintaining the Aternity object.


To monitor the wait times and usage times to display the UXI, you must also wrap the app.

Before You Begin

Before embedding Aternity's monitoring into an Android mobile app, verify your device conforms to the following minimum system requirements (Aternity Android Wrapper or Aternity Android Mobile SDK):

Attribute Requirement (Android Wrapper and Aternity Android SDK)

Operating system

Android 4.4 and up to Android 9

Java Developer Kit

JDK 1.8 or later.

Programming environment

Google Android Studio or a standalone Android SDK.

Using the SDK Manager, install the latest Android SDK tools (platform tools and build tools) for SDK Platform API level 19 or newer.


Internet access.

App resource usage

When you add Aternity functionality to an Android app:

  • Disk storage barely changes at all.

  • RAM size is an extra 5-10MB.

  • CPU usage rises by 1%.

To run a monitored app, the device must have the following operating systems:

Attribute Requirement

iOS operating system of monitored device

iOS 9 and up to iOS 12

Android operating system of monitored device

Android 4.4 and up to Android 9

In addition, ensure you have already done the following:


void setUsername(String name); 


Parameter Description


Set this to be the username you want to appear in the dashboards, defined as a string.


import com.aternity.sdk.Aternity;
public class CardViewActivity extends Activity {
    public void processLogin() {
        //report username to Aternity