-
Notifications
You must be signed in to change notification settings - Fork 0
/
gradlew
142 lines (116 loc) · 5.03 KB
/
gradlew
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package com.binod.online_news;
import android.content.Context;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.util.Log;
import android.view.View;
import android.support.v4.view.GravityCompat;
import android.support.v7.app.ActionBarDrawerToggle;
import android.view.MenuItem;
import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds;
import java.io.File;
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
private static final long GAME_LENGTH_MILLISECONDS = 3000;
private static final String TAG = "MainActivity";
private AdView adView;
private AdView adView1;
private AdView adView2;
private AdView adView3;
private AdView adView4;
private AdView adView5;
private AdView adView6;
private AdView adView7;
private AdView adView8;
private AdView adView9;
private InterstitialAd interstitialAd;
private InterstitialAd interstitialAd1;
private InterstitialAd interstitialAd2;
private InterstitialAd interstitialAd3;
private InterstitialAd interstitialAd4;
private Button retryButton;
private Button cleardata;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize the Mobile Ads SDK.
MobileAds.initialize(this, "ca-app-pub-4832438752709537~6320182065");
// Create the InterstitialAd and set the adUnitId.
interstitialAd = new InterstitialAd(this);
interstitialAd1 = new InterstitialAd(this);
interstitialAd2 = new InterstitialAd(this);
interstitialAd3 = new InterstitialAd(this);
interstitialAd4 = new InterstitialAd(this);
// Defined in res/values/strings.xml
interstitialAd.setAdUnitId(getString(R.string.ad_unit_id));
interstitialAd1.setAdUnitId(getString(R.string.ad_unit_id1));
interstitialAd2.setAdUnitId(getString(R.string.ad_unit_id2));
interstitialAd3.setAdUnitId(getString(R.string.ad_unit_id3));
interstitialAd4.setAdUnitId(getString(R.string.ad_unit_id4));
//put the interestital ads to load
interstitialAd.loadAd(new AdRequest.Builder().build());
interstitialAd1.loadAd(new AdRequest.Builder().build());
interstitialAd2.loadAd(new AdRequest.Builder().build());
interstitialAd3.loadAd(new AdRequest.Builder().build());
interstitialAd4.loadAd(new AdRequest.Builder().build());
interstitialAd.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
Toast.makeText(MainActivity.this, "Best Ads Are Loaded For You", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdFailedToLoad(int errorCode) {
Toast.makeText(MainActivity.this,
"onAdFailedToLoad() with error code: " + errorCode,
Toast.LENGTH_SHORT).show();
}
@Override
public void onAdClosed() {
interstitialAd.loadAd(new AdRequest.Builder().build());
}
});
interstitialAd1.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
Toast.makeText(MainActivity.this, "1Best Ads Are Loaded For You", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdFailedToLoad(int errorCode) {
Toast.makeText(MainActivity.this,
"onAdFailedToLoad1() with error code: " + errorCode,
Toast.LENGTH_SHORT).show();
}
@Override
public void onAdClosed() {
interstitialAd1.loadAd(new AdRequest.Builder().build());
}
});
interstitialAd2.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
Toast.makeText(MainActivity.this, "2Best Ads Are Loaded For You", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdFailedToLoad(int errorCode) {
Toast.makeText(MainActivity.this,
"onAdFailedToLoad2() with error code: " + errorCode,
Toast.LENGTH_SHORT).show();
}
@Override
public void onAdClosed() {
interstitialAd2.loadAd(new AdRequest.Builder().build());