android - Can't see admob in cocos2dx -


i'm pretty sure problem in here somewhere:

protected void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate);

      // create ad.     adview = new adview(this);     adview.setadsize(adsize.banner);     adview.setadunitid(ad_unit_id);      // add adview view hierarchy. view have no size     // until ad loaded.     layoutparams adparams = new layoutparams(layoutparams.match_parent,layoutparams.match_parent);       // create ad request. check logcat output hashed device id     // test ads on physical device.     adrequest adrequest = new adrequest.builder()         .addtestdevice(adrequest.device_id_emulator)         .addtestdevice("insert_your_hashed_device_id_here")         .build();      // start loading ad in background.     adview.loadad(adrequest);     addcontentview(adview, adparams); } 

and yes, id initialized correctly.

i think problem way calculating position in adparams. here's code use, puts ad @ bottom of screen:

linearlayout.layoutparams adparams = new linearlayout.layoutparams(             getwindowmanager().getdefaultdisplay().getwidth(),                                     getwindowmanager().getdefaultdisplay().getheight()+getwindowmanager().getdefaultdisplay().getheight()-110);  adview = new adview(this, adsize.banner, “xxxxxx”);  adrequest request = new adrequest(); adview.loadad(request);                 addcontentview(adview, adparams);  

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -