public class

AppLovinSdkUtils

extends Object
java.lang.Object
   ↳ com.applovin.sdk.AppLovinSdkUtils

Class Overview

This class contains a set of shared SDK utility methods.

Summary

Constants
String TAG
Public Constructors
AppLovinSdkUtils()
Public Methods
static int dpToPx(Context context, int px)
Convert a size in pixels to DP.
static boolean openUri(Context context, Uri uri, AppLovinSdk sdk)
Launch an appropriate intent to handle a click on a given ad.
static boolean openUrl(Context context, String url, AppLovinSdk sdk)
Launch an appropriate intent to handle a click on a given ad.
static void runOnUiThread(Runnable runnable)
Performs the given runnable on the main thread.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String TAG

Constant Value: "AppLovinSdkUtils"

Public Constructors

public AppLovinSdkUtils ()

Public Methods

public static int dpToPx (Context context, int px)

Convert a size in pixels to DP.

Parameters
context Context to use.
px Size in raw pixels.
Returns
  • DP adjusted size.

public static boolean openUri (Context context, Uri uri, AppLovinSdk sdk)

Launch an appropriate intent to handle a click on a given ad.

Parameters
context Context to use.
uri Click uri to open.
sdk The sdk.
Returns
  • True if the uri has been successfully opened. False otherwise.

public static boolean openUrl (Context context, String url, AppLovinSdk sdk)

Launch an appropriate intent to handle a click on a given ad.

Parameters
context Context to use.
url Click url to open.
sdk The sdk.
Returns
  • True if the url has been successfully opened. False otherwise.

public static void runOnUiThread (Runnable runnable)

Performs the given runnable on the main thread.