The Adjust SDK contains helper methods that return device information. Use these methods to add details to your callbacks and improve your reporting.
Adjust device identifier
public static void getAdid(final OnAdidReadListener onAdidReadListener)
Adjust generates a unique Adjust Device ID (ADID) for each device. You can request this information asynchronously from the Adjust SDK by passing a callback method to the Adjust.getAdid
method.
Adjust.getAdid { adid -> // Your callback function}
Adjust.getAdid(new OnAdidReadListener() { @Override public void onAdidRead(String adid) { // Your callback function }});
Google Play Services Advertising ID
public static void getGoogleAdId(final Context context,final OnGoogleAdIdReadListener onGoogleAdIdReadListener)
The Google Play Services Advertising ID (GPS ADID) is a device-specific identifier for Android devices.
Users can opt out of sharing their GPS ADID by toggling the “Opt out of Ads Personalization” setting on their device. When a user enables this setting, the Adjust SDK returns a string of zeros when trying to read the GPS ADID.
You can access this value by calling the getGoogleAdId
method in a background thread. Assign a delegate function to access the GPS ADID value.
Adjust.getGoogleAdId(this, object : OnGoogleAdIdReadListener { override fun onGoogleAdIdRead(googleAdId: String) {}})
Adjust.getGoogleAdId(this, new OnGoogleAdIdReadListener() { @Override public void onGoogleAdIdRead(String googleAdId) {}});
Amazon Advertiser ID
public static void getAmazonAdId(final Context context,final OnAmazonAdIdReadListener onAmazonAdIdReadListener)
The Amazon Advertising ID (Amazon Ad ID) is a device-specific identifier for Android devices. You can request this information asynchronously from the Adjust SDK by passing a callback method to the Adjust.getAmazonAdId
method.
Adjust.getAmazonAdId(applicationContext, object : OnAmazonAdIdReadListener { override fun onAmazonAdIdRead(amazonAdId: String) {}})
Adjust.getAmazonAdId(getApplicationContext(), new OnAmazonAdIdReadListener() { @Override public void onAmazonAdIdRead(String amazonAdId) { }});
Adjust SDK version getter
To read the version of the Adjust SDK, pass a callback function to the Adjust.getSdkVersion
method. The version number is available as a String
in your callback function.
Adjust.getSdkVersion {sdkVersion -> // Your callback function}
Adjust.getSdkVersion(new OnSdkVersionReadListener() { @Override public void onSdkVersionRead(String sdkVersion) { // Your callback function }})