Summary: Nested Classes | Methods | Inherited Methods | [Expand All]
public class

# MobileAds

extends Object

java.lang.Object
↳ | com.google.android.gms.ads.MobileAds

## Class Overview

Class contains logic that applies to the Mobile Ads SDK as a whole. Right now, the only methods in it are used for initialization.

## Summary

Nested Classes
class | MobileAds.Settings | This class describes all optional initialization settings that impact the Google Mobile Ads SDK's behavior.

Public Methods
static RewardedVideoAd | getRewardedVideoAdInstance(Context context) Get the rewarded video ad instance.
static void | initialize(Context context, String applicationCode) Initialize the Mobile Ads SDK.
static void | initialize(Context context) Initialize the Mobile Ads SDK.
static void | initialize(Context context, String applicationCode, MobileAds.Settings settings) Initialize the Mobile Ads SDK.
static void | setAppMuted(boolean muted) Set the current app mute state.
static void | setAppVolume(float volume) Set the current app volume.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Methods

#### public static RewardedVideoAd getRewardedVideoAdInstance (Context context)

Get the rewarded video ad instance.

##### Parameters

context | The `Context` the SDK is running in.

#### public static void initialize (Context context, String applicationCode)

Initialize the Mobile Ads SDK. The SDK will configure itself.

This method should be called as early as possible, and only once per application launch.

##### Parameters

context | The `Context` the SDK is running in.
applicationCode | The AdMob application code.

#### public static void initialize (Context context)

Initialize the Mobile Ads SDK. The SDK will configure itself.

This method should be called as early as possible, and only once per application launch.

##### Parameters

context | The `Context` the SDK is running in.

#### public static void initialize (Context context, String applicationCode, MobileAds.Settings settings)

Initialize the Mobile Ads SDK. The SDK will configure itself and initialize integrated features such as Google Analytics.

This method should be called as early as possible, and only once per application launch.

##### Parameters

context | The `Context` the SDK is running in.
applicationCode | The AdMob application code.
settings | Additional settings for initializing the Mobile Ads SDK.

#### public static void setAppMuted (boolean muted)

Set the current app mute state.

##### Parameters

muted | true if the app is muted, false otherwise

#### public static void setAppVolume (float volume)

Set the current app volume.

##### Parameters

volume | the volume as a float from 0 (muted) to 1 (full media volume)

##### Throws

IllegalArgumentException | if volume is out of the valid range