Public types | |
---|---|
Orientation{ | enum Denotes the orientation of the AdSize. |
Type{ | enum Denotes the type size object that the AdSize represents. |
Public static attributes | |
---|---|
kBanner | const AdSize Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels). |
kFullBanner | const AdSize Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels). |
kLargeBanner | const AdSize Taller version of kBanner. Typically 320x100. |
kLeaderboard | const AdSize Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels). |
kMediumRectangle | const AdSize Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels). |
Public functions | |
---|---|
height() const | uint32_t The height of the region represented by this AdSize. |
operator!=(const AdSize & rhs) const | bool Comparison operator. |
operator==(const AdSize & rhs) const | bool Comparison operator. |
orientation() const | The AdSize orientation. |
type() const | The AdSize type, either standard size or adaptive. |
width() const | uint32_t The width of the region represented by this AdSize. |
Public static functions | |
---|---|
GetCurrentOrientationAnchoredAdaptiveBannerAdSize(uint32_t width) | Creates an AdSize with the given width and a Google-optimized height to create a banner ad given the current orientation. |
GetCurrentOrientationInlineAdaptiveBannerAdSize(int width) | A convenience method to return an inline adaptive banner ad size given the current interface orientation. |
GetInlineAdaptiveBannerAdSize(int width, int max_height) | This ad size is most suitable for banner ads given a maximum height. |
GetLandscapeAnchoredAdaptiveBannerAdSize(uint32_t width) | Creates an AdSize with the given width and a Google-optimized height to create a banner ad in landscape mode. |
GetLandscapeInlineAdaptiveBannerAdSize(int width) | Creates an AdSize with the given width and the device’s landscape height. |
GetPortraitAnchoredAdaptiveBannerAdSize(uint32_t width) | Creates an AdSize with the given width and a Google-optimized height to create a banner ad in portrait mode. |
GetPortraitInlineAdaptiveBannerAdSize(int width) | Creates an AdSize with the given width and the device’s portrait height. |
Orientation
Type
constAdSizekBanner
Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels).
constAdSizekFullBanner
Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).
constAdSizekLeaderboard
Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).
constAdSizekMediumRectangle
Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).
AdSize(uint32_twidth,uint32_theight)
Creates a new AdSize.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
uint32_theight()const
The height of the region represented by this AdSize.
Value is in density-independent pixels.
uint32_twidth()const
The width of the region represented by this AdSize.
Value is in density-independent pixels.
AdSizeGetCurrentOrientationAnchoredAdaptiveBannerAdSize(uint32_twidth)
Creates an AdSize with the given width and a Google-optimized height to create a banner ad given the current orientation.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | an AdSize with the given width and a Google-optimized height to create a banner ad. The size returned will have an aspect ratio similar to AdSize, suitable for anchoring near the top or bottom of your app. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded. |
AdSizeGetCurrentOrientationInlineAdaptiveBannerAdSize(intwidth)
A convenience method to return an inline adaptive banner ad size given the current interface orientation.
This AdSize allows Google servers to choose an optimal ad size with a height less than or equal to the height of the screen in the requested orientation.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | an AdSize with the given width and a height that is always 0. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded. |
AdSizeGetInlineAdaptiveBannerAdSize(intwidth,intmax_height)
This ad size is most suitable for banner ads given a maximum height.
This AdSize allows Google servers to choose an optimal ad size with a height less than or equal to the max height given in
Details | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns | an AdSize with the given width and a height that is always 0. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded. |
AdSizeGetLandscapeAnchoredAdaptiveBannerAdSize(uint32_twidth)
Creates an AdSize with the given width and a Google-optimized height to create a banner ad in landscape mode.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | an AdSize with the given width and a Google-optimized height to create a banner ad. The size returned will have an aspect ratio similar to BANNER, suitable for anchoring near the top or bottom of your app. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded. |
AdSizeGetLandscapeInlineAdaptiveBannerAdSize(intwidth)
Creates an AdSize with the given width and the device’s landscape height.
This ad size allows Google servers to choose an optimal ad size with a height less than or equal to the height of the screen in landscape orientation.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | an AdSize with the given width and a height that is always 0. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded. |
AdSizeGetPortraitAnchoredAdaptiveBannerAdSize(uint32_twidth)
Creates an AdSize with the given width and a Google-optimized height to create a banner ad in portrait mode.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | an AdSize with the given width and a Google-optimized height to create a banner ad. The size returned will have an aspect ratio similar to BANNER, suitable for anchoring near the top or bottom of your app. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded. |
AdSizeGetPortraitInlineAdaptiveBannerAdSize(intwidth)
Creates an AdSize with the given width and the device’s portrait height.
This ad size allows Google servers to choose an optimal ad size with a height less than or equal to the height of the screen in portrait orientation.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | an AdSize with the given width and a height that is always 0. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-23 UTC.