Search in sources :

Example 16 with InterstitialAd

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);
}
Also used : QuickReturnListViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener) CoreService(com.balaganovrocks.yourmasterclean.service.CoreService) Intent(android.content.Intent) InterstitialAd(com.google.android.gms.ads.InterstitialAd) ClearMemoryAdapter(com.balaganovrocks.yourmasterclean.adapter.ClearMemoryAdapter) DecimalFormatter(com.balaganovrocks.yourmasterclean.widget.textcounter.formatters.DecimalFormatter)

Example 17 with InterstitialAd

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);
    }
}
Also used : SupportMapFragment(com.google.android.gms.maps.SupportMapFragment) AdRequest(com.google.android.gms.ads.AdRequest) InterstitialAd(com.google.android.gms.ads.InterstitialAd) Intent(android.content.Intent) AdListener(com.google.android.gms.ads.AdListener)

Example 18 with InterstitialAd

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();
    }
}
Also used : InterstitialAd(com.google.android.gms.ads.InterstitialAd)

Example 19 with InterstitialAd

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());
}
Also used : SpannableStringBuilder(android.text.SpannableStringBuilder) TaskStackBuilder(android.app.TaskStackBuilder) InterstitialAd(com.google.android.gms.ads.InterstitialAd)

Example 20 with InterstitialAd

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);
}
Also used : QuickReturnListViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener) RublishMemoryAdapter(com.balaganovrocks.yourmasterclean.adapter.RublishMemoryAdapter) Intent(android.content.Intent) InterstitialAd(com.google.android.gms.ads.InterstitialAd) CleanerService(com.balaganovrocks.yourmasterclean.service.CleanerService)

Aggregations

InterstitialAd (com.google.android.gms.ads.InterstitialAd)22 Intent (android.content.Intent)12 SpannableStringBuilder (android.text.SpannableStringBuilder)10 View (android.view.View)9 AdListener (com.google.android.gms.ads.AdListener)9 SharedPreferences (android.content.SharedPreferences)8 Typeface (android.graphics.Typeface)8 TaskStackBuilder (android.app.TaskStackBuilder)6 FloatingActionButton (android.support.design.widget.FloatingActionButton)6 DatabaseHandler (io.praveen.typenote.SQLite.DatabaseHandler)6 Note (io.praveen.typenote.SQLite.Note)6 SuppressLint (android.annotation.SuppressLint)4 TargetApi (android.annotation.TargetApi)4 Notification (android.app.Notification)4 NotificationChannel (android.app.NotificationChannel)4 NotificationManager (android.app.NotificationManager)4 PendingIntent (android.app.PendingIntent)4 NotificationCompat (android.support.v4.app.NotificationCompat)4 RecyclerView (android.support.v7.widget.RecyclerView)4 AdRequest (com.google.android.gms.ads.AdRequest)4