我有一个完美显示插页式广告的应用程序,但它们只是图像,而且作为生活在视频上的一代,我认为让Admob也能展示视频广告也是有益的.
我是否必须为此添加额外权限?或者我应该做些什么?
以下是我展示广告的方式;
interstitial = new InterstitialAd(Main.this); // Insert the Ad Unit ID interstitial.setAdUnitId("ca-app-pub-...442"); //Locate the Banner Ad in activity_main.xml // Request for Ads adRequest = new AdRequest.Builder() // Add a test device to show Test Ads .addTestDevice(AdRequest.DEVICE_ID_EMULATOR) .addTestDevice("") .build(); // Load ads into Banner Ads //adView.loadAd(adRequest); // Load ads into Interstitial Ads Runnable r = new Runnable () { @Override public void run() { interstitial.loadAd(adRequest); } }; runOnUiThread(r); // Prepare an Interstitial Ad Listener interstitial.setAdListener(new AdListener() { public void onAdLoaded() { // Call displayInterstitial() function displayInterstitial(); } });
而这两个权限;
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>@H_404_14@