9: 2016-08-13 (土) 20:22:20 njf  |
現: 2019-04-25 (木) 20:27:54 njf  |
| | Finishボタンを押せばライブラリが作成されます。 | | Finishボタンを押せばライブラリが作成されます。 |
| | | | |
| - | *Google Play Servicesの追加 [#ua4e58f1] | + | *Google Play Servicesの追加 (現在は不要)[#ua4e58f1] |
| | | | |
| | + | &font(Red){----アップデートにより、このセクションの手順は意味がなくなったので飛ばしてください-----&br;}; |
| | (この部分については[[公式ページ:https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start?hl=ja]]も参考にして下さい。) | | (この部分については[[公式ページ:https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start?hl=ja]]も参考にして下さい。) |
| | | | |
| | super.onCreate(savedInstanceState); | | super.onCreate(savedInstanceState); |
| | setContentView(R.layout.activity_main); | | setContentView(R.layout.activity_main); |
| | + | |
| | aneAdmob = new ANEAdmob(this); | | aneAdmob = new ANEAdmob(this); |
| | + | |
| | aneAdmob.setAppID(APP_ID); | | aneAdmob.setAppID(APP_ID); |
| | aneAdmob.setBannerID(BANNER_ID); | | aneAdmob.setBannerID(BANNER_ID); |
| | aneAdmob.setInterstitialID(INTER_ID); | | aneAdmob.setInterstitialID(INTER_ID); |
| | + | |
| | Button button = (Button) findViewById(R.id.showBannerBtn); | | Button button = (Button) findViewById(R.id.showBannerBtn); |
| | + | |
| | assert button != null; | | assert button != null; |
| | button.setOnClickListener(new View.OnClickListener() { | | button.setOnClickListener(new View.OnClickListener() { |
| | aneAdmob.showBanner(); | | aneAdmob.showBanner(); |
| | } | | } |
| | + | |
| | } | | } |
| | ); | | ); |
| | + | |
| | button = (Button) findViewById(R.id.hideBannerBtn); | | button = (Button) findViewById(R.id.hideBannerBtn); |
| | + | |
| | assert button != null; | | assert button != null; |
| | button.setOnClickListener(new View.OnClickListener() { | | button.setOnClickListener(new View.OnClickListener() { |
| | aneAdmob.hideBanner(); | | aneAdmob.hideBanner(); |
| | } | | } |
| | + | |
| | } | | } |
| | ); | | ); |
| | button = (Button) findViewById(R.id.loadInterstitialBtn); | | button = (Button) findViewById(R.id.loadInterstitialBtn); |
| | + | |
| | assert button != null; | | assert button != null; |
| | button.setOnClickListener(new View.OnClickListener() { | | button.setOnClickListener(new View.OnClickListener() { |
| | aneAdmob.loadInterstitial(); | | aneAdmob.loadInterstitial(); |
| | } | | } |
| | + | |
| | } | | } |
| | ); | | ); |
| | + | |
| | button = (Button) findViewById(R.id.showInterstitialBtn); | | button = (Button) findViewById(R.id.showInterstitialBtn); |
| | + | |
| | assert button != null; | | assert button != null; |
| | button.setOnClickListener(new View.OnClickListener() { | | button.setOnClickListener(new View.OnClickListener() { |
| | aneAdmob.showInterstitial(); | | aneAdmob.showInterstitial(); |
| | } | | } |
| | + | |
| | } | | } |
| | ); | | ); |
| | + | |
| | } | | } |
| | | | |
| | return result; | | return result; |
| | } | | } |
| | + | |
| | @Override | | @Override |
| | public void dispose() { | | public void dispose() { |
| | + | |
| | } | | } |
| | }; | | }; |
| | Log.w("njf.jp.aneadmob", "ANEAdmobFREFunction:can't parse : arg 1"); | | Log.w("njf.jp.aneadmob", "ANEAdmobFREFunction:can't parse : arg 1"); |
| | } | | } |
| | + | |
| | if(aneAdmob == null){ | | if(aneAdmob == null){ |
| | aneAdmob = new ANEAdmob(freContext.getActivity()); | | aneAdmob = new ANEAdmob(freContext.getActivity()); |
| | } | | } |
| | + | |
| | if(method.equals("setAppID") && !prm.equals("")){ | | if(method.equals("setAppID") && !prm.equals("")){ |
| | aneAdmob.setAppID(prm); | | aneAdmob.setAppID(prm); |