Millennial Media Android Ad SDK Public Documentation  6.6.1
Static Public Member Functions | List of all members
MMSDK Class Reference

Static Public Member Functions

static void initialize (Application application) throws MMException
 
static void initialize (final Activity activity)
 
static boolean isInitialized ()
 
static void setUserData (UserData userData) throws MMException
 
static UserData getUserData ()
 
static void setAppInfo (AppInfo appInfo) throws MMException
 
static AppInfo getAppInfo ()
 
static void setLocationEnabled (boolean locationEnabled) throws MMException
 

Detailed Description

Exposes functionality of the Millennial Media SDK not tied to a specific ad placement type.

Member Function Documentation

◆ getAppInfo()

static AppInfo getAppInfo ( )
static

Retrieves the currently set AppInfo object.

Returns
the AppInfo object containing the application info being used by the SDK

◆ getUserData()

static UserData getUserData ( )
static

Retrieves the currently set UserData object.

Returns
the UserData object containing the user metadata being used by the SDK

◆ initialize() [1/2]

static void initialize ( Application  application) throws MMException
static

Initializes the SDK as a whole. This must be called before the SDK is used.

Parameters
applicationthe Application that will be used to initialize the SDK; we recommend that the developer create a derived Application class and performs the initialization inside that class
Exceptions
MMExceptionif no valid Application is provided or initialization fails for any reason

◆ initialize() [2/2]

static void initialize ( final Activity  activity)
static

Initializes the SDK as a whole. This must be called before the SDK is used.

Parameters
activitythe activity that will be used for initializing the SDK. This is normally the application's main activity.
Exceptions
IllegalStateExceptionif no valid Activity is provided
Deprecated:
Please use MMSDK.initialize(Application) in future to avoid state loss when the process is killed by the OS and then restarted by the user.

◆ isInitialized()

static boolean isInitialized ( )
static

Retrieves whether or not initialize has been called. MMSDK must be initialized before the SDK is used.

◆ setAppInfo()

static void setAppInfo ( AppInfo  appInfo) throws MMException
static

Sets the application info that will be sent along with ad requests.

Parameters
appInfothe AppInfo instance to send with the request
Exceptions
MMExceptionif the SDK is not initialized

◆ setLocationEnabled()

static void setLocationEnabled ( boolean  locationEnabled) throws MMException
static

Sets whether the SDK is allowed to collect and send location info when making requests. Default setting is true

Parameters
locationEnabledset to false to prevent the SDK from sending location info with requests, true (default) enables the SDK to send location info with requests
Exceptions
MMExceptionif the SDK is not initialized

◆ setUserData()

static void setUserData ( UserData  userData) throws MMException
static

Sets the user metadata that will be sent along with ad requests.

Parameters
userDatathe UserData instance to send with the request
Exceptions
MMExceptionif the SDK is not initialized