PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview of Ad control
  • Creating an Ad control
  • To create an Ad control:
  • Size of ads
  • Operating mode of Ad control
  • Test mode
  • Loading and refreshing the ads
  • Click on an ad
  • Modifying the permissions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview of Ad control
The Ad control is used to monetize an Android application by displaying an ad banner. This banner will generate incomes according to the number of clicks performed by the application users.
The "AdMob" protocol (Google) is used to display the ads.
Caution:
  • The use of the Map control is subject to specific terms and conditions. See Conditions for using the Ad control for more details.
  • To use an Ad control, the application must be compiled with Android SDK version 3.2 or later.
    However, the application can operate on devices running an earlier version (1.5, 1.6, 2.0, ...) in accordance with the minimum runtime version specified in the wizard for generating the Android application.
Creating an Ad control

To create an Ad control:

  1. In the window editor, click (or select "Insert .. Control .. Ad control").On the "Creation" pane, in the "Graphic controls" group, click "Ad".
  2. Click the position where the control will be created in the window.
To display the control characteristics, select "Description" from the popup menu of control.

Size of ads

The popup menu found on the right of the icon for control creation proposes four possible sizes:
  • 320 x 50, for the phones and tablets.
  • 300 x 250, for the tablets only.
  • 468 x 60, for the tablets only.
  • 768 x 90, for the tablets only.
Caution:
  • The selected size will be the minimum size of control. The control can be enlarged in edit or at run time. In this case, the banner will remain centered in the control.
  • No ad will be display if the size of the Ad control is not sufficient.
Operating mode of Ad control

Test mode

AdMob does not allow the application provider to click his own ads or to artificially increase the number of ad displays.
The test mode of Ad control is used to display "fake ads" on which the click triggers no income.
The test mode is automatically:
  • enabled when the application is started on the emulator.
  • disabled at run time on the phone or on the tablet.
Notes:
  • At run time in the simulator, the Ad control will display a fixed image whose size is identical to the size of the ad banner.
  • ..TestMode is used to find out whether the test mode is enabled or not.

Loading and refreshing the ads

An ad is automatically loaded in the Ad control when the window is opened.
Then, new ads can be regularly loaded in the control according to the refresh rate defined in the application setting on the AdMob site.
The ads are loaded in background task from Internet. Therefore, the device must be connected in order for the ads to be displayed. A time-out (few seconds to several minutes) may be required between the opening of the window and the actual display of the first ad. This time-out depends on the connection quality and on the ad size.
We recommend that you use the "Loading an ad" and "Error while loading an ad" processes to check the display of ads in the control. See Processes associated with the Ad control for more details.
Note: To find out whether an ad is displayed in the control, use ..AdLoaded.

Click on an ad

The consequences of a click performed on an ad displayed in the Ad control depend on the type of ad. The most common actions are :
  • Opening the market to download the application corresponding to the ad.
  • Opening the browser on the site corresponding to the ad.
Modifying the permissions
Using an Ad control automatically adds the following permissions to the list of permissions required by the application:
  • INTERNET
  • ACCES_NETWORK_STATE
Minimum required version
  • Version 17
Comments
Click [Add] to post a comment