Ads on Android

Ads on Android
0.0 0


I’ve been trying to implement ads in my Android application (simple banner from Smaato), but I’m having some difficulties.
I’ve tried to add the banner according to the Smaato manual with the following code, but the banner does not show up:
@ mBanner = new BannerView (this);
RelativeLayout myRelativeLayout = new RelativeLayout(this);
myRelativeLayout.addView(mBanner, new LayoutParams(LayoutParams.MATCH_PARENT, 70));@

When I’m using arbitrary banner size it works well, but the banner is cropped on some devices with higher resolutions:

@ RelativeLayout lContainerLayout = new RelativeLayout(this);
lContainerLayout.setLayoutParams(new RelativeLayout.LayoutParams( LayoutParams.WRAP_CONTENT , LayoutParams.WRAP_CONTENT ));
LayoutParams lButtonParams = new RelativeLayout.LayoutParams(sizex , sizey );

addContentView(lContainerLayout, new LayoutParams( LayoutParams.MATCH_PARENT , LayoutParams.WRAP_CONTENT ) );

Any help would be appreciated!