---
agentTools:
  projectIndex: https://developers.appnext.com/llms.txt
---

# Banners

Adobe Air Banners ad unit

[block:callout]
{
  "type": "warning",
  "title": "Before you begin!",
  "body": "Make sure that you have completed the Adobe Air Plugin installation before you begin integrating the Banners ad unit"
}
[/block]

[block:api-header]
{
  "title": "Integrating the Banners ad unit"
}
[/block]

\##Step 1: Set the banner

[block:code]
{
  "codes": [
    {
      "code": "var banner:Banner = new Banner(\"YOUR_APPNEXT_PLACEMENT_ID\");\nbanner.setBannerSize(Banner.SIZE_BANNER);\nbanner.setPosition(Banner.POSITION_CENTER | Banner.POSITION_BOTTOM);\nbanner.addEventListener(AdEvent.AD_LOADED, adLoadedHandler);\nbanner.loadAd();\n\nfunction adLoadedHandler(event: Event): void {\n\tbanner.show();\n}\n",
      "language": "text"
    }
  ]
}
[/block]

\##Step 2: Configure the BannerAdRequest (Optional)

By default, the banner settings will be loaded with pre-defined settings. You can change these settings by defining the `BannerAdRequest` object

Setters that are relevant to all banner sizes:

* `setCategories` - String. Set preferred ad categories
* `setPostback` - String. Postback parameters that will be posted to your server after user installed an app (make sure to encode the values)

Setters that are relevant only to the `MEDIUM_RECTANGLE` banner size:

* `setCreativeType` - The `MEDIUM_RECTANGLE` size can show video in addition to static creative. When video is in use, the file will be streamed (default value is `ALL` - managed by Appnext)
  * `BannerAdRequest.TYPE_ALL`
  * `BannerAdRequest.TYPE_VIDEO`
  * \`BannerAdRequest.TYPE\_STATIC\*
* `setAutoPlay` - Boolean. When a video is set in the creative, this setter defining if the video will autoplay or not (default value is false)
* `setMute` - Boolean. When a video is set in the creative, this setter is defining if the video will start on muted volume or not. Un-mute/Mute button is located in the video creative. (default value is true - video is muted)
* `setVideoLength` - When a video is set in the creative, this setter is defining the preferred length of the video. (default value is SHORT)
  * `BannerAdRequest.VIDEO_LENGTH_SHORT` - Up to 15 seconds long videos
  * `BannerAdRequest.VIDEO_LENGTH_LONG` - 20-60 seconds long videos

[block:code]
{
  "codes": [
    {
      "code": "// All sizes example\nBannerAdRequest banner_request = new BannerAdRequest();\nbanner_request\n       .setCategories(\"category1, category2\")\n       .setPostback(\"Postback string\");\n// ...\nbanner.loadAd(banner_request);\n\n\n// MEDIUM_RECTANGLE size example\nBannerAdRequest banner_request = new BannerAdRequest();\nbanner\n  .setCategories(\"category1, category2\")\n  .setPostback(\"Postback string\")\n  .setCreativeType(BannerAdRequest.TYPE_VIDEO)\n  .setAutoPlay(true)\n  .setMute(false)\n  .setVideoLength(BannerAdRequest.VIDEO_LENGTH_SHORT);\n// ...\n",
      "language": "text"
    }
  ]
}
[/block]

\##Step 3: Banner Events

* `AdEvent.AD_LOADED` - The banner was successfully loaded, and it’s ready to be shown to the user
* `AdEvent.AD_IMPRESSION` - The banner was viewed by the user, and an impression was reported to Appnext
* `AdEvent.AD_CLICKED` - The banner was clicked by the user
* `AdEvent.AD_ERROR` - An error has occurred

The following possible errors can be passed in the AdEvent.AD\_ERROR handler:

* `NoInternetConnection;`
* `NoPlacementID;`
* `AdNotReady;`
* `PreparingViews;`
* `LoadingAd;`
* `NoAds;`

[block:api-header]
{
  "title": "App Categories"
}
[/block]

[block:parameters]
{
  "data": {
    "0-0": "1. Action\n2. Adventure\n3. Arcade\n4. Arcade & Action\n5. Board\n6. Books & Reference\n7. Brain & Puzzle\n8. Business\n9. Card\n10. Cards & Casino\n11. Casino\n12. Casual\n13. Comics\n14. Communications\n15. Education\n16. Educational\n17. Entertainment\n18. Family\n19. Finance\n20. Health & Fitness\n21. Libraries & Demo\n22. Lifestyle\n23. Live Wallpaper\n24. Media & Video\n25. Medical\n26. Music\n27. Music & Audio\n28. News & Magazines",
    "0-1": "29. Personalization\n30. Photography\n31. Productivity\n32. Puzzle\n33. Racing\n34. Role Playing\n35. Shopping\n36. Simulation\n37. Social\n38. Sports\n39. Sports Games\n40. Strategy\n41. Tools\n42. Travel & Local\n43. Trivia\n44. Weather\n45. Word",
    "0-2": ""
  },
  "cols": 2,
  "rows": 1
}
[/block]

[block:api-header]
{
  "title": "Integration Support"
}
[/block]

Should you have any problems integrating the product, log a ticket with us by emailing <support@appnext.com>.