Tu put a admob to opengl android view you have to create a RelativeLayout where to put a addmob and add this layout to principal layout where you have precedently added opengl view
This is a simple code :
AdView adView = new AdView(this);
adView.setAdSize(AdSize.BANNER);
adView.setAdUnitId(“ca-app-pub-your id “);
adView.setBackgroundColor(Color.TRANSPARENT);
RelativeLayout layout = new RelativeLayout(this);
layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
RelativeLayout.LayoutParams adParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
adParams.addRule(RelativeLayout.CENTER_VERTICAL); //Position of admob
mGLSurfaceView = new CCGLSurfaceView(this);
layout.addView(mGLSurfaceView);
layout.addView(adView , adParams) ;
setContentView(layout);
if you want to rotate a admob you can use setRotate is it for API 11
This is the code .
AdView adView = new AdView(this);
adView.setAdSize(AdSize.BANNER);
adView.setAdUnitId(“ca-app-pub-your admob id “);
adView.setBackgroundColor(Color.TRANSPARENT);
adView.setRotation(-90f);
LinearLayout layout2 = new LinearLayout(this);
layout2.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
layout2.setBackgroundColor(Color.TRANSPARENT);
RelativeLayout layout = new RelativeLayout(this);
layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
layout.setBackgroundColor(Color.TRANSPARENT);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
float width = metrics.widthPixels;
float height = metrics.heightPixels;
int left = 0;
int top = 0 ;
int right = 0 ;
int bottom = 0 ;
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT);
layoutParams.setMargins(left,top,right, bottom);
RelativeLayout.LayoutParams adParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.MATCH_PARENT);
adParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
layout2.addView(adView,layoutParams);
mGLSurfaceView = new CCGLSurfaceView(this);
layout.addView(mGLSurfaceView);
layout.addView(layout2,adParams);
setContentView(layout);