Showing Admob Interstitial ads on Activity onResume()
up vote
1
down vote
favorite
I am loading ads in a static manner on Activity onCreate()
if not already loaded and on onResume()
, I am showing ads after 3-4 intervals.
Is it against google Admob's policy to show Interstitial ads on Activity
onResume()
?I've gone through this article, where it says: Do not place interstitial ads on app load, but not sure I am breaking it or not. am I?
And if user gets a phone call while using app, when he hangs up,
onResume()
is called again. So, it might show an Interstitial ad. Am i breaking the law: It should be clear to the user which application the ad is associated with or implemented on, mentioned here?
Simplified version of my code is given:
AdmobInterstitial.java
public class AdmobInterstitial {
private static InterstitialAd mInterstitialAd;
public static InterstitialAd getInterstitial(final Context context) {
if(mInterstitialAd==null)
{
final AdRequest adRequest= new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
mInterstitialAd = new InterstitialAd(context.getApplicationContext());
mInterstitialAd.setAdUnitId(Utility.INTERSTITIAL);
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
mInterstitialAd.loadAd(adRequest);
}
});
mInterstitialAd.loadAd(adRequest);
}
return mInterstitialAd;
}
public static void counter(Application app, ShowAdInterface mmActivity)
{
SharedPreferences pref = app.getSharedPreferences(Utility.SHARED_PREF_NAME , MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
int my_counter=pref.getInt("banner_count",0);
if(my_counter>0&& my_counter%3==0) {
if(!mmActivity.showAd()) {
my_counter--;
}
}
my_counter++;
editor.putInt("banner_count",my_counter);
editor.apply();
}
}
ShowAdInterface
public interface ShowAdInterface {
public boolean showAd();
}
MainActivity.java
public class MainActivity extends AppCompatActivity implements ShowAdInterface{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mInterstitialAd= AdmobInterstitial.getInterstitial(this);
}
@Override
protected void onResume() {
super.onResume();
AdmobInterstitial.counter(getApplication(),this);
}
}
android admob interstitial
add a comment |
up vote
1
down vote
favorite
I am loading ads in a static manner on Activity onCreate()
if not already loaded and on onResume()
, I am showing ads after 3-4 intervals.
Is it against google Admob's policy to show Interstitial ads on Activity
onResume()
?I've gone through this article, where it says: Do not place interstitial ads on app load, but not sure I am breaking it or not. am I?
And if user gets a phone call while using app, when he hangs up,
onResume()
is called again. So, it might show an Interstitial ad. Am i breaking the law: It should be clear to the user which application the ad is associated with or implemented on, mentioned here?
Simplified version of my code is given:
AdmobInterstitial.java
public class AdmobInterstitial {
private static InterstitialAd mInterstitialAd;
public static InterstitialAd getInterstitial(final Context context) {
if(mInterstitialAd==null)
{
final AdRequest adRequest= new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
mInterstitialAd = new InterstitialAd(context.getApplicationContext());
mInterstitialAd.setAdUnitId(Utility.INTERSTITIAL);
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
mInterstitialAd.loadAd(adRequest);
}
});
mInterstitialAd.loadAd(adRequest);
}
return mInterstitialAd;
}
public static void counter(Application app, ShowAdInterface mmActivity)
{
SharedPreferences pref = app.getSharedPreferences(Utility.SHARED_PREF_NAME , MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
int my_counter=pref.getInt("banner_count",0);
if(my_counter>0&& my_counter%3==0) {
if(!mmActivity.showAd()) {
my_counter--;
}
}
my_counter++;
editor.putInt("banner_count",my_counter);
editor.apply();
}
}
ShowAdInterface
public interface ShowAdInterface {
public boolean showAd();
}
MainActivity.java
public class MainActivity extends AppCompatActivity implements ShowAdInterface{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mInterstitialAd= AdmobInterstitial.getInterstitial(this);
}
@Override
protected void onResume() {
super.onResume();
AdmobInterstitial.counter(getApplication(),this);
}
}
android admob interstitial
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am loading ads in a static manner on Activity onCreate()
if not already loaded and on onResume()
, I am showing ads after 3-4 intervals.
Is it against google Admob's policy to show Interstitial ads on Activity
onResume()
?I've gone through this article, where it says: Do not place interstitial ads on app load, but not sure I am breaking it or not. am I?
And if user gets a phone call while using app, when he hangs up,
onResume()
is called again. So, it might show an Interstitial ad. Am i breaking the law: It should be clear to the user which application the ad is associated with or implemented on, mentioned here?
Simplified version of my code is given:
AdmobInterstitial.java
public class AdmobInterstitial {
private static InterstitialAd mInterstitialAd;
public static InterstitialAd getInterstitial(final Context context) {
if(mInterstitialAd==null)
{
final AdRequest adRequest= new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
mInterstitialAd = new InterstitialAd(context.getApplicationContext());
mInterstitialAd.setAdUnitId(Utility.INTERSTITIAL);
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
mInterstitialAd.loadAd(adRequest);
}
});
mInterstitialAd.loadAd(adRequest);
}
return mInterstitialAd;
}
public static void counter(Application app, ShowAdInterface mmActivity)
{
SharedPreferences pref = app.getSharedPreferences(Utility.SHARED_PREF_NAME , MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
int my_counter=pref.getInt("banner_count",0);
if(my_counter>0&& my_counter%3==0) {
if(!mmActivity.showAd()) {
my_counter--;
}
}
my_counter++;
editor.putInt("banner_count",my_counter);
editor.apply();
}
}
ShowAdInterface
public interface ShowAdInterface {
public boolean showAd();
}
MainActivity.java
public class MainActivity extends AppCompatActivity implements ShowAdInterface{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mInterstitialAd= AdmobInterstitial.getInterstitial(this);
}
@Override
protected void onResume() {
super.onResume();
AdmobInterstitial.counter(getApplication(),this);
}
}
android admob interstitial
I am loading ads in a static manner on Activity onCreate()
if not already loaded and on onResume()
, I am showing ads after 3-4 intervals.
Is it against google Admob's policy to show Interstitial ads on Activity
onResume()
?I've gone through this article, where it says: Do not place interstitial ads on app load, but not sure I am breaking it or not. am I?
And if user gets a phone call while using app, when he hangs up,
onResume()
is called again. So, it might show an Interstitial ad. Am i breaking the law: It should be clear to the user which application the ad is associated with or implemented on, mentioned here?
Simplified version of my code is given:
AdmobInterstitial.java
public class AdmobInterstitial {
private static InterstitialAd mInterstitialAd;
public static InterstitialAd getInterstitial(final Context context) {
if(mInterstitialAd==null)
{
final AdRequest adRequest= new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
mInterstitialAd = new InterstitialAd(context.getApplicationContext());
mInterstitialAd.setAdUnitId(Utility.INTERSTITIAL);
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
mInterstitialAd.loadAd(adRequest);
}
});
mInterstitialAd.loadAd(adRequest);
}
return mInterstitialAd;
}
public static void counter(Application app, ShowAdInterface mmActivity)
{
SharedPreferences pref = app.getSharedPreferences(Utility.SHARED_PREF_NAME , MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
int my_counter=pref.getInt("banner_count",0);
if(my_counter>0&& my_counter%3==0) {
if(!mmActivity.showAd()) {
my_counter--;
}
}
my_counter++;
editor.putInt("banner_count",my_counter);
editor.apply();
}
}
ShowAdInterface
public interface ShowAdInterface {
public boolean showAd();
}
MainActivity.java
public class MainActivity extends AppCompatActivity implements ShowAdInterface{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mInterstitialAd= AdmobInterstitial.getInterstitial(this);
}
@Override
protected void onResume() {
super.onResume();
AdmobInterstitial.counter(getApplication(),this);
}
}
android admob interstitial
android admob interstitial
asked Nov 8 at 11:03
Touhidul Islam
19010
19010
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
I am using this kinda method and technique in many of my apps for many years now. Occassionally, every half a year, I get a mail from google admob about a little thing which they dislike. I usually wait for this to happen and then take action because they dont just ban you, they'll ask you nicely first. So just respond to that.
Anyway, regarding your matter: Always LOAD the ad on app load and show the ad in a manner, that no "accidental" clicks are produced. This is what google hates the most, so this is where you will get auto detected and receive a mail to change it. It really depens on your app. If you see the ad loading just fine without anyone accidentally clicking on them everthing is fine. So your code is probably ok, but debugging will give a finite answer! Good luck!
add a comment |
up vote
1
down vote
I think it's alright. Until you don't take any accidental clicks from the user, you are good to go. We are loading ads onResume() and we didn't find any problem so far.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I am using this kinda method and technique in many of my apps for many years now. Occassionally, every half a year, I get a mail from google admob about a little thing which they dislike. I usually wait for this to happen and then take action because they dont just ban you, they'll ask you nicely first. So just respond to that.
Anyway, regarding your matter: Always LOAD the ad on app load and show the ad in a manner, that no "accidental" clicks are produced. This is what google hates the most, so this is where you will get auto detected and receive a mail to change it. It really depens on your app. If you see the ad loading just fine without anyone accidentally clicking on them everthing is fine. So your code is probably ok, but debugging will give a finite answer! Good luck!
add a comment |
up vote
1
down vote
I am using this kinda method and technique in many of my apps for many years now. Occassionally, every half a year, I get a mail from google admob about a little thing which they dislike. I usually wait for this to happen and then take action because they dont just ban you, they'll ask you nicely first. So just respond to that.
Anyway, regarding your matter: Always LOAD the ad on app load and show the ad in a manner, that no "accidental" clicks are produced. This is what google hates the most, so this is where you will get auto detected and receive a mail to change it. It really depens on your app. If you see the ad loading just fine without anyone accidentally clicking on them everthing is fine. So your code is probably ok, but debugging will give a finite answer! Good luck!
add a comment |
up vote
1
down vote
up vote
1
down vote
I am using this kinda method and technique in many of my apps for many years now. Occassionally, every half a year, I get a mail from google admob about a little thing which they dislike. I usually wait for this to happen and then take action because they dont just ban you, they'll ask you nicely first. So just respond to that.
Anyway, regarding your matter: Always LOAD the ad on app load and show the ad in a manner, that no "accidental" clicks are produced. This is what google hates the most, so this is where you will get auto detected and receive a mail to change it. It really depens on your app. If you see the ad loading just fine without anyone accidentally clicking on them everthing is fine. So your code is probably ok, but debugging will give a finite answer! Good luck!
I am using this kinda method and technique in many of my apps for many years now. Occassionally, every half a year, I get a mail from google admob about a little thing which they dislike. I usually wait for this to happen and then take action because they dont just ban you, they'll ask you nicely first. So just respond to that.
Anyway, regarding your matter: Always LOAD the ad on app load and show the ad in a manner, that no "accidental" clicks are produced. This is what google hates the most, so this is where you will get auto detected and receive a mail to change it. It really depens on your app. If you see the ad loading just fine without anyone accidentally clicking on them everthing is fine. So your code is probably ok, but debugging will give a finite answer! Good luck!
answered Nov 8 at 11:30
innomotion media
324110
324110
add a comment |
add a comment |
up vote
1
down vote
I think it's alright. Until you don't take any accidental clicks from the user, you are good to go. We are loading ads onResume() and we didn't find any problem so far.
add a comment |
up vote
1
down vote
I think it's alright. Until you don't take any accidental clicks from the user, you are good to go. We are loading ads onResume() and we didn't find any problem so far.
add a comment |
up vote
1
down vote
up vote
1
down vote
I think it's alright. Until you don't take any accidental clicks from the user, you are good to go. We are loading ads onResume() and we didn't find any problem so far.
I think it's alright. Until you don't take any accidental clicks from the user, you are good to go. We are loading ads onResume() and we didn't find any problem so far.
answered Nov 8 at 12:28
Sifat Ullah Chowdhury
814
814
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206434%2fshowing-admob-interstitial-ads-on-activity-onresume%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown