Admob Banner

  • Description

      Admob Banner

      The Admob Banner component allows you to place ads in our application. Banner ads are rectangular images or text ads that they occupy a place within the design of an application. The ad remain on the screen while users interact with the application and can update automatically after a certain period of time.

      In order to use Admob we must create an account in create account. It will also be helpful to know how to configure Admob in our application set up Admob.

  • Events

    • On ad closed
    • Event to be executed when the user is about to return to the app after tapping on an ad.
    • On ad failed to load
    • Event to be executed when an ad request fails..
      The possible values are defined as constants in the class Ad Request:
      • ERROR_CODE_INTERNAL_ERROR: there has been a problem in our systems internal (by example, the ad server has sent an invalid response).
      • ERROR_CODE_INVALID_REQUEST: the ad request was invalid; for example, the ID of the block of ads was wrong.
      • ERROR_CODE_NETWORK_ERROR: has not been able to make the ad request due to problems with the network connection.
      • ERROR_CODE_NO_FILL: the ad request was successful, but it has not been returned no announcement because there is no ad inventory.
    • On ad left application
    • Event to be executed when an ad request fails.
    • On ad loaded
    • Event to be executed when an ad finishes loading.
    • On ad opened
    • Event to be executed when an ad opens an overlay that covers the screen.
  • Procedures

    • Load Ad
    • This method allows to load our ad on the screen. So that this function you have to add the unique id or with the property 'Add unique id' or from the properties of the Admob Banner component.
  • Properties

    • Height
    • To set the height of the banner.
    • Height in percentage
    • To set the percentage height of the banner.
    • Width
    • To set the width of the banner.
    • Width in percentage
    • To set the width in percentage of the banner.
    • Visible
    • Specifies whether the banner should be visible on the screen. The value is true if the component is displayed and false if it is hidden.
    • Add unique Id
    • Specifies the unique identifier for the ad unit. This id is better put it in the properties of the component, but with this block of ownership we can change that id dynamically.
    • Test mode
    • Specifies whether you are in test mode or not. If we set the value to True, we will be indicating that we are in test mode and vice versa. This allows You can have a production ID set but when you activate test mode, the ads that will be shown will be tested.
  • Example

    • Adding banner
    • As we can see, adding a banner is very easy. We simply must add the 'Load ad' block and add in the properties of the component the corresponding unique Id.

    • And that's it, our ad will appear on the screen.