I'm trying to integrate AdWhirl and AdMob in my Android Application and I have some question:
I have many activities and I want put advertisement in most of them. In which activity should I put the following code?
//***ADWHIRL CODE // These are density-independent pixel units, as defined in // http://developer.android.com/guide/practices/screens_support.html int width = 320; int height = 52;
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); float density = displayMetrics.density; width = (int) (width * density); height = (int) (height * density); // Optional, will fetch new config if necessary after five minutes. AdWhirlManager.setConfigExpireTimeout(1000 * 60 * 5); // References AdWhirlLayout defined in the layout XML. AdWhirlLayout adWhirlLayout = (AdWhirlLayout) findViewById(R.id.adwhirl_layout); adWhirlLayout.setAdWhirlInterface(this); adWhirlLayout.setMaxWidth(width); adWhirlLayout.setMaxHeight(height); //*******ADWHIRL CODE END
I already put also this code in AndroidManifest:
<!-- AdWhirl Key -->
<meta-data android:value="7e*********************5a6"
android:name="ADWHIRL_KEY" />
<!-- AdMob integration -->
<activity android:name="com.google.ads.AdActivity"
android:configChanges="orientation|keyboard|keyboardHidden" />
- Is it possible show the ads always in the foreground, in a indipendent way from the height of the content?
Does anyone have any advice? Any help is appreciated. Sorry for my English.