Can we use GoogleAds/AdMob/AdWhirl in cocos2d-android? -


i want add admob / adwhirl gamelayer scene.

i search on everywhere couldn't find way work. don't want switch library. , should do?

if have worked on , give way .

as there not layout xml file cocos2d android can add progammatically. crate linear layout in onstart method itself.

like this

linearlayout.layoutparams adparams = new linearlayout.layoutparams(                 getwindowmanager().getdefaultdisplay().getwidth(),                                         getwindowmanager().getdefaultdisplay().getheight()+getwindowmanager().getdefaultdisplay().getheight()-50);          adview = new adview(simplegame.this, adsize.banner, "your ad id"); adview.setadlistener(simplegame.this);                                     adrequest request = new adrequest();         request.addtestdevice(adrequest.test_emulator);         adview.loadad(request);                          ccdirector.shareddirector().getactivity().addcontentview(adview,adparams); 

this should in try , catch.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -