Pregunta

I am new to Android game development. I am struggling to show Admob in my game. What am I doing wrong?

LinearLayout.LayoutParams adParams = new LinearLayout.LayoutParams(
                getWindowManager().getDefaultDisplay().getWidth(),
                getWindowManager().getDefaultDisplay().getHeight()
                        + getWindowManager().getDefaultDisplay().getHeight()
                        - 50);

    adView = new AdView(CandygrabberActivity.this, AdSize.BANNER,
            MY_AD_UNIT_ID);
    adRequest = new AdRequest();
    adRequest.setTesting(true);
    adView.loadAd(adRequest);

    CCDirector.sharedDirector().getActivity()
            .addContentView(adView, adParams);
¿Fue útil?

Solución

https://stackoverflow.com/a/17991961/2026280

Go through this answer. If you need some more help.just ask.

IF it helped you. Upvote the answer.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top