9: 2016-08-13 (土) 20:22:20 njf[4] [5] [6] | 現: 2019-04-25 (木) 19:27:54 njf[4] [7] [8] | ||
---|---|---|---|
Line 76: | Line 76: | ||
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]]も参考にして下さい。) | ||
Line 290: | Line 291: | ||
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() { | ||
Line 305: | Line 306: | ||
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() { | ||
Line 317: | Line 318: | ||
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() { | ||
Line 328: | Line 329: | ||
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() { | ||
Line 340: | Line 341: | ||
aneAdmob.showInterstitial(); | aneAdmob.showInterstitial(); | ||
} | } | ||
+ | |||
} | } | ||
); | ); | ||
+ | |||
} | } | ||
Line 394: | Line 395: | ||
return result; | return result; | ||
} | } | ||
+ | |||
@Override | @Override | ||
public void dispose() { | public void dispose() { | ||
+ | |||
} | } | ||
}; | }; | ||
Line 421: | Line 422: | ||
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); |
(This host) = https://njf.jp