public final class AdRegistration
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
enableLogging(boolean enable)
Enable writing LogCat messages during integration and testing of the Amazon Mobile Ads API.
|
static void |
enableTesting(boolean enable)
During integration and testing of the Amazon Mobile Ads API, you should indicate all ad requests
are for testing.
|
static java.lang.String |
getVersion()
Gets the current version of the Amazon Mobile Ads API.
|
static void |
registerApp(android.content.Context context)
Register your app to track app downloads from mobile ad campaigns.
|
static void |
setAppKey(java.lang.String appKey)
Sets the Application Key to identify your application in a
AdLayout.loadAd(AdTargetingOptions) call. |
public static final void setAppKey(java.lang.String appKey) throws java.lang.IllegalArgumentException
AdLayout.loadAd(AdTargetingOptions)
call.
AdLayout.loadAd(AdTargetingOptions)
.
You could add this call to your Activity's onCreate function, or some other
app initialization code.appKey
- The Amazon Appstore Application Key.java.lang.IllegalArgumentException
- Thrown if the App Key is empty or null.public static final void enableLogging(boolean enable)
enable
- Whether to enable logging.public static final void enableTesting(boolean enable)
enable
- Set to true to flag all requests as test requests, and set to false to flag all requests as production requests.public static final java.lang.String getVersion()
public static final void registerApp(android.content.Context context)
setAppKey(String)
and the
com.amazon.device.ads.AdRegistration#registerApp(Activity)
to your app's initialization code, e.g. your Activity's onCreate method.
AdLayout.loadAd(AdTargetingOptions)
automatically registers your app. Only call this method if you are
not using the Amazon Mobile Ads API to display ads, but to track
app downloads from mobile ad campaigns.
The com.amazon.device.ads.AdRegistration#registerApp(Activity)
method
creates an AsyncTask to send your App Key and hashed device IDs
to the Amazon Mobile Ad Network. Calling this method will not block any UI
process or affect user interaction with your app.context
- The Context for retrieving context-sensitive data.