AndEngine에서 만든 게임에 adMob 광고를 표시하려고합니다.ANDEngine ADmob AD not displayed
LogCat의 WebRequest에 대해 WebViewResponse를 얻을 수 있으며 네트워크 권한을 제거하면 네트워크 요구 사항 오류가있는 블랙 박스가 나타납니다. 하지만 네트워크 요구 사항을 추가하면 웹 응답은 수신되지만 표시에는 성공하지 못합니다.
무엇이 문제 일 수 있습니까?
감사합니다.
@Override
protected void onSetContentView() {
final FrameLayout frameLayout = new FrameLayout(this);
final FrameLayout.LayoutParams frameLayoutLayoutParams =
new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT,
FrameLayout.LayoutParams.FILL_PARENT);
adView = new AdView(this, AdSize.BANNER, “xxxxxxxxx”);
adView.refreshDrawableState();
adView.setVisibility(AdView.VISIBLE);
final FrameLayout.LayoutParams adViewLayoutParams =
new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT,
Gravity.CENTER_HORIZONTAL|Gravity.CENTER_VERTICAL);
int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50,
getResources().getDisplayMetrics());
// top of AD is at middle of the screen
adViewLayoutParams.topMargin = height/2;
Log.v("AD", "Adview height : " + height);
Log.v("AD", "Adview size {x:" + adView.getWidth() + ", y: " + adView.getHeight()+ "}");
adView.setAlpha(255);
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
adRequest.addTestDevice(“xxxxxxxxxxxxxx”);
adView.loadAd(adRequest);
this.mRenderSurfaceView = new RenderSurfaceView(this);
mRenderSurfaceView.setRenderer(mEngine, this);
final android.widget.FrameLayout.LayoutParams surfaceViewLayoutParams =
new FrameLayout.LayoutParams(super.createSurfaceViewLayoutParams());
frameLayout.addView(this.mRenderSurfaceView, surfaceViewLayoutParams);
frameLayout.addView(adView, adViewLayoutParams);
this.setContentView(frameLayout, frameLayoutLayoutParams);
}
logcat은 무엇이라고 말합니까? – William