I added admob view to Android framelayout. 

I couldn't see ad. I think that admob view  is not disappered, because when I click admob location, actvity is changed to show advertisement.





To resolve problem, I applied background color to admob view. Below show my code.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
//-----------------------------------------------------------------------------------------------------------//
//for admob
adView = new AdView(this);
adView.setAdSize(AdSize.SMART_BANNER);
adView.setAdUnitId("ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
layout.addView(adView, new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT,Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL));
        
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build();
adView.loadAd(adRequest);
adView.setBackgroundColor(Color.TRANSPARENT);
//-----------------------------------------------------------------------------------------------------------//


I added [adView.setBackgroundColor(Color.TRANSPARENT);]. After applying this code, I could see admob test image.




'NDK & OpenGL ES' 카테고리의 다른 글

OpenGLES2.0 GLSL, 2D Basic shader  (1) 2014.09.18
OpenGLES 2.0,GLSL lighting code  (0) 2014.09.15
GLSL, OpenGLES2.0 glFog  (0) 2014.09.12
NDK AdMob, Can't see admob on Framelayout  (0) 2014.09.10
GLSurfaceView & GLRenderer 설정  (0) 2014.04.15
이클립스 NDK설정  (0) 2014.04.15