Gideros AdMob Plugin for Android to display and manipulate AdMob ads.

You can find example Gideros project, example Android project with plugin source and plugin folder for installation.




Download AdMob SDK and include it in your project. To do that, right click on project and select properties, from there select "Java Build Path" and click on "Add External JARs..." and navigate to downloaded SDK jar file.

Then go to Order and Export tab and check added Admob jar file

Add this to your Android manifest file


Next you'll need to include plugin files into your exported android project. You can simply copy contents of AdMobPlugin folder into your project folder.

Or step by step, add files to according directories of your exported Gideros project (libs/armeabi and libs/armeabi-v7a) and to "src/com/giderosmobile/android/plugins" directory and copy main.xml file into "res/layout".

Then you need to open main Activity inside "src/com/giderosmobile/android" folder (usually named as YourApplicationActivity, where YourApplication is the name of your application).

Then import needed packages

import com.yourdomain.yourapp.R;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import android.content.Context;
import android.content.Intent;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.FrameLayout;



Just right after


Add AdMob class inside externalClasses using "" string

static private String[] externalClasses = {

Then you'll need to modify some code, first comment out this line:


Add this code under the commented line:

	FrameLayout layout = (FrameLayout)findViewById(;

Example codes

require 'admob'


admob.setAlignment('center', 'top')

Timer.delayedCall(15000, function()

Method list

Load advertisement

Back to method list

Method name loadAd(admobID, adType)
Description Load and for provided app id with provided ad type
Input parameters

string admobID - admob ID of your app

string adType - Type of an ad. Possible values:

  • banner
  • iab_banner
  • iab_leaderboard
  • iab_mrect
  • iab_skyscaper
  • smart_banner
  • interstitial


Example input

admob.loadAd("87u89chsd9dsfdsuf", "banner")

Remove advertisement

Back to method list

Method name removeAd()
Description Remove an ad from view

Set Position

Back to method list

Method name setAlignment(horizontal, vertical)

Set Alignment of ad.

Horizontal values:

  • left
  • right
  • center


Vertical values:

  • top
  • bottom
  • center


Set horizontal alignment

Back to method list

Method name setHorizontalAlignment(horizontal)
Description Set horizontal alignment of ad.

Horizontal values:

  • left
  • right
  • center


Set vertical position

Back to method list

Method name setVerticalAlignment(vertical)
Description Set vertical alignment of ad.

Vertical values:

  • top
  • bottom
  • center


Get Alignment

Back to method list

Method name getAlignment()
Description Get Alignment of ad

Get horizontal alignment

Back to method list

Method name getHorizontalAlignment()
Description Get horizontal alignment of ad.

Get vertical alignment

Back to method list

Method name getVerticalAlignment()
Description Get vertical alignment of ad.

Set visibility of ad

Back to method list

Method name setVisible(visible)
Description Set visibility of ad.
Input parameters

bool visible - true to show ad and false to hide it

Latest changes

None for now