package jackall.moncalc.utils import android.content.Context import android.widget.FrameLayout import com.google.android.gms.ads.AdRequest import com.google.android.gms.ads.AdSize import com.google.android.gms.ads.AdView import com.google.android.gms.ads.MobileAds /** * Created by matsumoto_k on 2017/11/06. */ class AdUtil { companion object { fun startBannerAd(context: Context, framelayout: FrameLayout, adSize: AdSize, bannerUnitId: String) { MobileAds.initialize(context) val adBannerView = AdView(context) adBannerView.adSize = adSize adBannerView.adUnitId = bannerUnitId framelayout.addView(adBannerView) val adBannerRequest = AdRequest.Builder().build() adBannerView.loadAd(adBannerRequest) } } }