Step1:
Add GoogleAdMobAdsSdk-4.1.1.jar file in your project.
step2:
Implement AdListener
Step3:
Override Method of interface .
step4:
declare variable private InterstitialAd interstitial;
Step5:
class Demo implements AdListener
{
............
private InterstitialAd interstitial;
..........
write this in your onCreate()
{
......
interstitial = new InterstitialAd(activity, "xxxxxxxx");//replace xxxxxxx is Admob Id
AdRequest adRequest = new AdRequest();
interstitial.loadAd(adRequest);
adFlag=true;
interstitial.setAdListener(GameOverWindow.this);
.....
}
..............
@Override
public void onReceiveAd(Ad arg0) {
// TODO Auto-generated method stub
interstitial.show();
}
}
Add GoogleAdMobAdsSdk-4.1.1.jar file in your project.
step2:
Implement AdListener
Step3:
Override Method of interface .
step4:
declare variable private InterstitialAd interstitial;
Step5:
class Demo implements AdListener
{
............
private InterstitialAd interstitial;
..........
write this in your onCreate()
{
......
interstitial = new InterstitialAd(activity, "xxxxxxxx");//replace xxxxxxx is Admob Id
AdRequest adRequest = new AdRequest();
interstitial.loadAd(adRequest);
adFlag=true;
interstitial.setAdListener(GameOverWindow.this);
.....
}
..............
@Override
public void onReceiveAd(Ad arg0) {
// TODO Auto-generated method stub
interstitial.show();
}
}
No comments:
Post a Comment