use of com.google.android.gms.ads.InterstitialAd in project superCleanMaster by joyoyao.
the class MemoryCleanActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memory_clean);
getActionBar().setDisplayHomeAsUpEnabled(true);
// applyKitKatTranslucency();
mClearMemoryAdapter = new ClearMemoryAdapter(mContext, mAppProcessInfos);
mListView.setAdapter(mClearMemoryAdapter);
bindService(new Intent(mContext, CoreService.class), mServiceConnection, Context.BIND_AUTO_CREATE);
int footerHeight = mContext.getResources().getDimensionPixelSize(R.dimen.footer_height);
mListView.setOnScrollListener(new QuickReturnListViewOnScrollListener(QuickReturnType.FOOTER, null, 0, bottom_lin, footerHeight));
textCounter.setAutoFormat(false);
textCounter.setFormatter(new DecimalFormatter());
textCounter.setAutoStart(false);
// the amount the number increments at each time interval
textCounter.setIncrement(5f);
// the time interval (ms) at which the text changes
textCounter.setTimeInterval(50);
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("ca-app-pub-4369038195513432/2986510514");
mInterstitialAd.loadAd(new AdRequest.Builder().build());
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
use of com.google.android.gms.ads.InterstitialAd in project Space-Station-Tracker by Kiarasht.
the class MapsActivity method initializeAds.
/**
* Initialize ads when the activity is started for the first time
*/
private void initializeAds() {
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
MobileAds.initialize(mContext, getString(R.string.app_ID_Main));
// Initiate the interstitial ad and onAdClosed listener
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId(getString(R.string.interstitial_ad_unit_id));
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
requestNewInterstitial();
switch(mInterstitialAdActivity) {
case 0:
startActivity(new Intent(mContext, Locations.class));
break;
case 1:
startActivity(new Intent(mContext, PeopleinSpace.class));
break;
}
}
});
if (!mSharedPreferences.getBoolean("advertisement", false)) {
mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().addTestDevice(getString(R.string.test_device)).build();
mAdView.loadAd(adRequest);
} else if (mAdView == null) {
findViewById(R.id.adView).setVisibility(View.GONE);
}
}
use of com.google.android.gms.ads.InterstitialAd in project AnExplorer by 1hakr.
the class AdWrapper method init.
private void init(Context context) {
// Ads
if (!isTelevision()) {
LayoutInflater.from(context).inflate(R.layout.ads_wrapper, this, true);
initAd();
} else {
mInterstitialAd = new InterstitialAd(context);
initInterstitialAd();
}
}
use of com.google.android.gms.ads.InterstitialAd in project Android-NotesApp by HelloPraveen.
the class MainActivity method prepareAd.
private void prepareAd() {
interstitialAd = new InterstitialAd(MainActivity.this);
interstitialAd.setAdUnitId("ca-app-pub-8429477298745270/2004640333");
interstitialAd.loadAd(new AdRequest.Builder().build());
}
use of com.google.android.gms.ads.InterstitialAd in project superCleanMaster by joyoyao.
the class RubbishCleanActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_rublish_clean);
getActionBar().setDisplayHomeAsUpEnabled(true);
// applyKitKatTranslucency();
// StikkyHeaderBuilder.stickTo(mListView).setHeader(header)
// .minHeightHeaderPixel(0).build();
res = getResources();
int footerHeight = mContext.getResources().getDimensionPixelSize(R.dimen.footer_height);
mListView.setEmptyView(mEmptyView);
rublishMemoryAdapter = new RublishMemoryAdapter(mContext, mCacheListItem);
mListView.setAdapter(rublishMemoryAdapter);
mListView.setOnItemClickListener(rublishMemoryAdapter);
mListView.setOnScrollListener(new QuickReturnListViewOnScrollListener(QuickReturnType.FOOTER, null, 0, bottom_lin, footerHeight));
bindService(new Intent(mContext, CleanerService.class), mServiceConnection, Context.BIND_AUTO_CREATE);
// for android 6.0+
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("ca-app-pub-4369038195513432/2986510514");
mInterstitialAd.loadAd(new AdRequest.Builder().build());
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
Aggregations