dimanche 19 octobre 2014

Android: AdView not getting displayed, though Log shows Ad is loaded


Vote count:

0




I am working with cocos2dx JS 3.0 and I am trying to implement Admob directly in Android without going through cocos2dx calls.


Created AdUnit and implemented the AdView as follows:



AdRequest request = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("AC2DFFFAFB44FE1EBC80F6B40559AB14")
.build();

AdView adView = new AdView(AppActivity.this);
adView.setAdSize(AdSize.BANNER);
adView.setAdUnitId("ca-app-pub-XYZ/XYZ");
adView.loadAd(request);

@SuppressWarnings("deprecation")
ViewGroup.LayoutParams ad_layout_params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
adView.setLayoutParams(ad_layout_params);

mFrameLayout.addView(adView); //Here `mFrameLayout` is the core `RelativeLayout` that contains GLView's that run cocos engine.


In Logcat, I am getting the following, but the AD is not displayed !!



Starting ad request.
JS: [Some JS Logs]
Ad finished loading.
Scheduling ad refresh 60000 milliseconds from now.
Ad is not visible. Not refreshing ad.
Scheduling ad refresh 60000 milliseconds from now.
Ad is not visible. Not refreshing ad.
Scheduling ad refresh 60000 milliseconds from now.
Ad is not visible. Not refreshing ad.
[repeating]


I guess, the admob Integration is done right, but issue with adding the AdView to the right parent view or issue with setting the position of AdView.


As per this thread (Move AdView to bottom, Cocos2dx Activity), changed the mFrameLayout in Cocos2dxActivity to RelativeLayout


Any help would be highly appreciated !!



asked 44 secs ago

saiy2k

625






Android: AdView not getting displayed, though Log shows Ad is loaded

Aucun commentaire:

Enregistrer un commentaire