Skip to content

Instantly share code, notes, and snippets.

@hkurosawa
Created February 14, 2012 02:22
Show Gist options
  • Save hkurosawa/1822617 to your computer and use it in GitHub Desktop.
Save hkurosawa/1822617 to your computer and use it in GitHub Desktop.
Adding Admob banner to PhoneGap App
public class PhonegapWithAdmobActivity extends DroidGap {
private AdView adView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
adView = new AdView(this, AdSize.BANNER, PUBLISHER_ID);
super.loadUrl("file:///android_asset/www/index.html");
((LinearLayout)appView.getParent()).addView(adView);
adView.loadAd(new AdRequest());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment