-1
我想通過Admob在Android手機應用中使用Phonegap實現廣告。我已經使用HTML + Javascrip/Jquery編寫了整個代碼,現在我正在使用Phonegap構建本機應用程序。Phonegap App for Android:在div中顯示Admob廣告
我可以使用此代碼通過AdMob聯播廣告中看到:
public class ModernSnake extends DroidGap {
/** Called when the activity is first created. */
private static final String AdMob_Ad_Unit = "a151376a873f810";
private AdView adView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.html", 10000);
adView = new AdView(this, AdSize.BANNER, AdMob_Ad_Unit);
LinearLayout layout = super.root;
layout.addView(adView);
AdRequest request = new AdRequest();
request.setTesting(true);
adView.loadAd(request);
}
} 但問題是,旗幟在頁面底部的全部時間。
所以有可能通過Javascript調用adView函數,也許顯示在我之前創建的div中?