Ad Interstitials with splash screens

1,286 views
Skip to first unread message

Alex Casha

unread,
Apr 13, 2017, 9:20:54 AM4/13/17
to Google Mobile Ads SDK Developers
I have applied Ad Interstitials in the main activity using splash screen and it works fine but when the game has finished and it restarts again the ad does not show again. Can anyone help please? Also I would like to put the ad at the end after the result page and not in the beginning as it is not nice for the user. I have several classes so I would like to use it in the score class(result page). I do not know how to use it when I do not have the method onCreate.

Deepika Uragayala- MobileAds SDK team

unread,
Apr 13, 2017, 1:50:49 PM4/13/17
to Google Mobile Ads SDK Developers
Hi Alex,
 
I'm not sure if it's within the policy to show Interstitial ads using Splash screen and I would suggest you to go through our interstitial best practices to learn more. As for implementing this somewhere else, I would suggest you to go through our sample apps to start and then let us know if you are still facing issues.

Regards,
Deepika Uragayala
Mobile Ads SDK Team

Alex Casha

unread,
Apr 13, 2017, 3:30:42 PM4/13/17
to google-adm...@googlegroups.com
Hi Deepika Uragayala,

I might have explained my needs in the wrong way.

I have created a game which I wish to put Interstitial ads at the end of the game as described by your links. I need online help to implement it.
Do you provide chat with technical support so I can know where and how to implement the code? I saw several clips on youtube but I still cannot make it. It took me a very long time to do it and I will not publish it without ads. 

Best regards,

Alex

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Deepika Uragayala- MobileAds SDK team

unread,
Apr 14, 2017, 11:06:26 AM4/14/17
to Google Mobile Ads SDK Developers
Hi Alex,

We would not be able to provide support via chat but you can still send us screenshots and code snippets of your implementation or a sample project. This would really help us to debug the issue further. 

Regards,
Deepika Uragayala
Mobile Ads SDK Team


On Thursday, April 13, 2017 at 3:30:42 PM UTC-4, Alex Casha wrote:
Hi Deepika Uragayala,

I might have explained my needs in the wrong way.

I have created a game which I wish to put Interstitial ads at the end of the game as described by your links. I need online help to implement it.
Do you provide chat with technical support so I can know where and how to implement the code? I saw several clips on youtube but I still cannot make it. It took me a very long time to do it and I will not publish it without ads. 

Best regards,

Alex

Alex Casha

unread,
Apr 14, 2017, 12:37:33 PM4/14/17
to google-adm...@googlegroups.com
Hi Deepika Uragayala,

The following is the main activity.

package com.gamingtechnology.parrots;

import com.gamingtechnology.parrots.Core.ControlCenter;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.InterstitialAd;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.graphics.PixelFormat;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;


public class ParrotsActivity extends Activity {

ParrotsGameView mGLSurfaceView;
private MediaPlayer mp;
InterstitialAd mInterstitialAd;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFormat(PixelFormat.TRANSLUCENT);

AdRequest adRequest = new AdRequest.Builder().build();

// Prepare the Interstitial Ad
mInterstitialAd = new InterstitialAd(ParrotsActivity.this);
// Insert the Ad Unit ID
mInterstitialAd.setAdUnitId(getString(R.string.admob_interstitial_id));

mInterstitialAd.loadAd(adRequest);
// Prepare an Interstitial Ad Listener
mInterstitialAd.setAdListener(new AdListener() {
public void onAdLoaded() {
// Call displayInterstitial() function
displayInterstitial();
onPause();

}
public void onAdClosed(){
onResume();
}
});
mGLSurfaceView = new ParrotsGameView(this);
setContentView(mGLSurfaceView);
mGLSurfaceView.requestFocus();
mGLSurfaceView.setFocusableInTouchMode(true);
}

@Override
protected void onStart() {
// TODO Auto-generated method stub
super.onStart();
if(mp==null){
// R.raw.mmp
mp = MediaPlayer.create(this, R.raw.s_background);
mp.setLooping(true);
mp.start();
}
}

@Override
protected void onStop() {
// TODO Auto-generated method stub
ControlCenter.mTimer.pause();
super.onStop();
}

@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
mGLSurfaceView.onResume();
ControlCenter.mTimer.resume();
//displayInterstitial();
}

@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
mGLSurfaceView.onPause();
mp.pause();
ControlCenter.mTimer.pause();
mp = MediaPlayer.create(this, R.raw.s_background);
mp.setLooping(true);
mp.start();
}

@Override
public void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
mp.stop();
//displayInterstitial();
}
public void displayInterstitial() {
// If Ads are loaded, show Interstitial else show nothing.
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
}
}
}

After the end of the game it displays the result,
so after I need that the ad Interstitial code is in this method or so and not in the main activity(ParrotsActivity).
The following is another class using the function to direct the user to the start of the game after that has pressed on the result screen. 
void raiseTouchResultViewEvent()
{
ControlCenter.mScene = E_SCENARIO.MENU;
}
Thanks
Alex

To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Deepika Uragayala- MobileAds SDK team

unread,
Apr 14, 2017, 3:29:38 PM4/14/17
to Google Mobile Ads SDK Developers
Hi Alex,

The snippet itself looks fine to me but just so I understand, the ParrotActivity is the results screen and you want to show the Interstitial when this is shown to the user? If so, this should work but can you make sure not to call onPause() directly when the Interstitial is loaded? You can provide a sample app for any more specific queries with regards to this.


Regards,
Deepika Uragayala
Mobile Ads SDK Team

On Friday, April 14, 2017 at 12:37:33 PM UTC-4, Alex Casha wrote:
Hi Deepika Uragayala,

To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Casha

unread,
Apr 15, 2017, 2:53:44 AM4/15/17
to google-adm...@googlegroups.com
Hi Deepika Uragayala,

No the ParrotActivity is the main activity. Every time I load the game the ad is shown before the user starts playing which make no sense. I want it in the class ScreenTouch where there is the following function, 
void raiseTouchResultViewEvent()
{
ControlCenter.mScene = E_SCENARIO.MENU;
}
so the ad will pop up at the end of the game. The ScreenTouch is a class and not an empty activity with an xml so there is no the onCreate function.
Alex

To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Deepika Uragayala- MobileAds SDK team

unread,
Apr 17, 2017, 1:33:59 PM4/17/17
to Google Mobile Ads SDK Developers
Hi Alex,

Ok, but I don't understand how this is done without looking at an actual sample app. Can you provide me one for us to proceed? The code snippets that I have seen do not suggest any wrong implementation.

Regards,
Deepika Uragayala
Mobile Ads SDK Team


On Saturday, April 15, 2017 at 2:53:44 AM UTC-4, Alex Casha wrote:
Hi Deepika Uragayala,

No the ParrotActivity is the main activity. Every time I load the game the ad is shown before the user starts playing which make no sense. I want it in the class ScreenTouch where there is the following function, 
void raiseTouchResultViewEvent()
{
ControlCenter.mScene = E_SCENARIO.MENU;
}
so the ad will pop up at the end of the game. The ScreenTouch is a class and not an empty activity with an xml so there is no the onCreate function.
Alex
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Casha

unread,
Apr 17, 2017, 3:00:45 PM4/17/17
to google-adm...@googlegroups.com
Hi Deepika,

I have tried another method but still the same. The method showInterstitial() is ghost. Kindly find attached a snap shot of my code.

Best Regards,

Alex 

To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ControlCenter1.png
GameOver.png

Deepika Uragayala- MobileAds SDK team

unread,
Apr 17, 2017, 5:14:15 PM4/17/17
to Google Mobile Ads SDK Developers
Hi Alex,

Why are you calling showInterstitial() by appending it as if it were being declared via an Interface? You must simply call showInterstitial() and not private void showInterstitial() from your GAME_OVER_END case.

Let me know if you still continue to have issues.

Regards,
Deepika Uragayala
Mobile ADs SDK Team

On Monday, April 17, 2017 at 3:00:45 PM UTC-4, Alex Casha wrote:
Hi Deepika,

I have tried another method but still the same. The method showInterstitial() is ghost. Kindly find attached a snap shot of my code.

Best Regards,

Alex 
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Casha

unread,
Apr 18, 2017, 2:03:37 AM4/18/17
to google-adm...@googlegroups.com
Hi Deepika,

I still got an error. Kindly find enclose a copy of the error.

Best regards,
Alex

To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
showInterstitial.png

Alex Casha

unread,
Apr 18, 2017, 6:39:19 AM4/18/17
to google-adm...@googlegroups.com
On Tue, Apr 18, 2017 at 8:03 AM, Alex Casha <roulettec...@gmail.com> wrote:
Hi Deepika,

I still got an error. Kindly find enclose a copy of the error.

Best regards,
Alex
non-static.png

Deepika Uragayala- MobileAds SDK team

unread,
Apr 18, 2017, 2:05:11 PM4/18/17
to Google Mobile Ads SDK Developers
Hi Alex,

Are you trying to call a static method directly or without first creating an instance of it? This is a Java coding issue and you must create an instance of your object and then call that method. For any further assistance on any Java related queries, I would suggest that you use StackOverflow.

Regards,
Deepika Uragayala
Mobile Ads SDK Team


To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

Alex Casha

unread,
Apr 19, 2017, 1:10:31 AM4/19/17
to google-adm...@googlegroups.com
Thanks. I am using StackOverflow but still no one has fixed my issue..

To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/qCYjK1tTCV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages