开发者

Adding admob or mobclix to wiengine android app

开发者 https://www.devze.com 2023-04-03 15:19 出处:网络
I\'m trying to implement some mobclix ads into an android app based on wiengine which is basically a java port of cocos2d. 开发者_运维问答Has anyone tried doing this? if so please tell me how ;)

I'm trying to implement some mobclix ads into an android app based on wiengine which is basically a java port of cocos2d. 开发者_运维问答Has anyone tried doing this? if so please tell me how ;)

To be clear the basic problem is that because wiengine uses a nonstandard View based class (WYGLSurfaceView) you can't easily add another ad View on top of the existing one.

Thanks,

Nick


use Activity.addContentView, samples:

FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT,
    FrameLayout.LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.BOTTOM;
    lp.bottomMargin = 10;
AdView ad = new AdView(this);
ad.setResId("xxx");
ad.setGoneIfFail(true);
addContentView(ad, lp);
ad.requestAd();

full answer: http://blog.wiyun.com/?cat=8


Well I'm not sure if it will answer your question but we can push a new activity:

Intent toInfoIntent = new Intent(Director.getInstance().getContext(), InfoActivity.class);
Director.getInstance().getContext().startActivity(toInfoIntent);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号