[Android] IMA for game

144 views
Skip to first unread message

Igor

unread,
May 24, 2021, 11:11:28 AM5/24/21
to Interactive Media Ads SDK
Hi,

  we are working on a game which supports AndroidTV. For some reason AdMob SDK does not support Android TV officially and AdMob team strongly suggests to use IMA instead for TV.

  Both samples have ads embedded into a video playback. It seems that exoplayer doesn't support standalone ad playback while advanced sample player does. Is there a simple way to play standalone ad without providing our own AdVidePlayer?

IMA SDK

unread,
May 24, 2021, 3:47:07 PM5/24/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi Igor,

Are you attempting to add video interstitials to your game? Are you sure that Mobile Ads don't work in a game on Android TV?
When you say "standalone ad playback" do you mean ads without content? If so, you can use as content a half second blank mp4 and have a preroll before it. Feel free to specify your use case.


Regards,

Google Logo
Aryeh Baker
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HDDVG:ref

Igor

unread,
May 25, 2021, 8:42:08 AM5/25/21
to Interactive Media Ads SDK
Hi Aryeh,

  thanks a lot for your reply.

  I've talked to AdMob support guys quite a few time. The official position is that AdMob is not supported for Android TV, so it seems they are not allowed to even say anything exept "not officially supported". However, Google don't ban apps for using it. SDK used to work unofficially for ages but it was updated, API was refactored, and the old one was deprecated and removed. For some reason rewarded ads API (non-interruptable instersitials) don't work anymore. The official AdMob position is "use IMA instead". They keep telling this to the developers quite a few years.

  So, what we need to do is to show an activity with ad only, no additional content is needed. We've got 2 use cases:
1. Interruptable insterstitial with the button "skip ad" which is suppported by your Advanced sample.
2. Noninterruptable interstitial.

We need to be able to show a navigatable close button at the end. We need to be able to detect if noninterruptable interstitial was interrupted or was the user watched the ad to the very end. Since you don't have an additional page after the ad (which is shown after AdMob video is finished) we also need to detect end_of_ad event to be able to close the activity automatically.

So, we need to implement the standard ad functionality for the game. May be some eye-candy such as a circle progress bar with the timer till the ad end, etc., but this is not that important. Frankly speaking having an empty half a second clip sound like a plan. We can make it even shorter I guess.

IMA SDK

unread,
May 25, 2021, 11:02:07 AM5/25/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi Igor,

The list of adevents are here - you can see how they're implemented in the Advanced Example herePause behavior  gives you background for clicking "Learn More" which pauses ad and opens a browser for landing page of ad. The example apps resume ad after coming back from landing page. A preroll that you don't call "resumeContent();" by CONTENT_RESUME_REQUESTED in the Advanced Example would make no content play. You can use the adEvents to fit your use case.

Igor

unread,
May 25, 2021, 11:10:02 AM5/25/21
to Interactive Media Ads SDK
Thanks Aryeh.

  just to make it crystal clear: I won't be able to save some development time and use basic sample. I'll need to use advanced sample for our use case.  However, I can save some time by reusing the existing code by simply providing short content which can be skipped using the event you've described. Is that correct?

IMA SDK

unread,
May 25, 2021, 2:57:21 PM5/25/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi Igor,

I don't know enough about your app implementation to help you decide between the basic example and the advanced example.

Regarding using ad events, it's possible you can program for different user actions and the result you want.  CONTENT_RESUME_REQUESTED gets called if ads fail to load or there's an ad error or VAST error too. It depends on how intrusive you want your controls to be, you can also make that if there's an error then game doesn't continue until you watch another ad.

Igor

unread,
May 26, 2021, 8:24:40 AM5/26/21
to Interactive Media Ads SDK
Thanks a lot.

  This is really helpful.

Igor

unread,
Jun 8, 2021, 7:54:47 AM6/8/21
to Interactive Media Ads SDK
Hi,

  we've decided to use the advanced sample and everything is good so far. We don't need actual video content and just pretend we have it to trick the SDK. However, we need to be able to preload the ad to make the user experience smooth and to  make sure that the ad is available. In order to do this we need to create AdsLoader instance which requires AdDisplayContainer which requires ViewGroup and VideoAdPlayer.

  We need to be able to create and pre-cache the ad when the ad display activity is not created, which means we don't have neither ViewGroup nor VideoAdPlayer at this point. We didn't found an official way to be able to create them before the activity is created. Do you think it is possible to do what we need at all?

IMA SDK

unread,
Jun 8, 2021, 12:55:24 PM6/8/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi Igor,

Thank you for reaching out to us. In looking over your response I would start by asking if you have looked over this section also, as it deals specifically with Android TV. But based on what you have stated, I would say that you could not preload without calling the activity and then getting the required views and groups.

Regards,
Google Logo
William Pescherine
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HDDVG:ref

Igor

unread,
Jun 11, 2021, 10:44:32 AM6/11/21
to Interactive Media Ads SDK
Thanks William.

  PopupWindow did the job for us with some limitations.

  However, now we experience a strange issue:
1. If WiFi is turned off when the application is launched, we never receive error callback when the ad is requested.
2. If WiFi is turned on when the application is launched and the ad was preloaded successfully, when we turn WiFi later and show the preloaded ad, we do get an error callback. A few ad requests after that also return error callbacks but after that error callbacks disappear again.

  We do assign both ads adsLoader and adsManager error callbacks. Any idea what could possibly go wrong? I can set up my own watchdog but this doesn't sound as the official solution. Any help is appreciated.

IMA SDK

unread,
Jun 11, 2021, 1:10:06 PM6/11/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi Igor,

This seems at first glance like an edge case. You can tell us how common this is and try to showcase this issue in our sample apps with step by step instructions.

Regards,

Google Logo
Aryeh Baker
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HDDVG:ref

Igor

unread,
Jun 14, 2021, 8:18:36 AM6/14/21
to Interactive Media Ads SDK
Hi Aryeh.

  Just do what I've described before for the sample:
1. Disable wi-fi. Press pre-roll linear not skippable. Press play. Enjoy empty log.
2. Enable wi-fi, start watching any ad in the advanced sample. Disable wi-fi. Press pre-roll linear not skippable. Press play. Enjoy the error messages.

Please, note that it was 100% reproducable on Friday in both our application and your Advanced sample. Today after my device was restarted the bug became not that stable in your sample while being 100% reproducible in our application.

IMA SDK

unread,
Jun 14, 2021, 5:30:05 PM6/14/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi Igor,

Thank you for the steps in the Advanced Example. Our error callbacks only send errors pertaining specifically to ads, any other error requires other listeners. Let me bring up your request for standard error logging to the rest of my team. You may monitor our release notes for an update.

Igor

unread,
Jun 16, 2021, 7:42:30 AM6/16/21
to Interactive Media Ads SDK
Thanks.

  Will keep an eye on your release notes. I'll use a watchdog meanwhile.

  Thanks again for your assistance.
Message has been deleted

IMA SDK

unread,
Jun 21, 2021, 12:01:02 AM6/21/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi there,

I've relayed your additional findings to the team. As an aside, they've commented back with the following verbatim:

"When testing in Advanced client-side example airplane mode with no wifi, I see the following error when I try to load ads:
I/ImaExample: Ad Error: There was a problem requesting ads from the server. Caused by: 6
The Advanced example is not set up with preloading, and the Basic Example does not log events, so there is not an easy test for preloading.
Can we confirm with the publisher if they are seeing the above error at all? Or if they would like a specific error for network issues."


Regards,
Google Logo
Teejay Wennie Pimentel
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HDDVG:ref

Igor Lobanchikov

unread,
Jun 21, 2021, 5:39:33 AM6/21/21
to IMA SDK, ima...@googlegroups.com
Hi.

  We did see this error and it is ok for us. But this error is not guaranteed. We see it in our application only if the ad has started playing with wifi on, then it is turned off. Then we get this error for a few tens of seconds when trying to load a new ad. Then we stop getting any errors.

  I've managed to reproduce this issue for the Advanced sample. However, sometimes we receive the error your team has mentioned. Specifically we don't see mentioned error code in your sample after running our application when in airplane mode.

Regards,
Igor.


--
You received this message because you are subscribed to a topic in the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ima-sdk/Vc1fbKUbANM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ima-sdk/9kFFx000000000000000000000000000000000000000000000QV19TM00dL1WfXfkSh6fZlqSwlKxaA%40sfdc.net.

IMA SDK

unread,
Jun 21, 2021, 2:43:21 PM6/21/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi Igor,

Thank you for the response back. I have passed along to our team the additional comments that you have said. At the same time our team is asking for very specific steps that are being taken so that we can walk through the samples ourselves so as to try and get the same error.

Regards,
Google Logo
William Pescherine
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HDDVG:ref

Igor Lobanchikov

unread,
Jun 22, 2021, 5:29:53 AM6/22/21
to IMA SDK, ima...@googlegroups.com
Hi.

  The bug itself is stable but I don't know how to trigger it for the first time on the fresh device. Will try to reproduce it modifying your sample then will get back to you with an archive. This will take some time thoug.

Regards,
Igor.


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

Igor

unread,
Jun 25, 2021, 6:16:58 AM6/25/21
to Interactive Media Ads SDK
Hi,

  could you, please, let me know which Advanced sample version is the latest so that I use it to reproduce the bug?

IMA SDK

unread,
Jun 25, 2021, 11:41:21 AM6/25/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi Igor,

You can send us whatever sample you have that shows the issue. And also if possible the exact timing of when you are turning on/off the wifi as we have been asked to get that information.

Igor

unread,
Jun 29, 2021, 8:05:14 AM6/29/21
to Interactive Media Ads SDK
Hi, William.

  this might sound strange, but in order to reproduce this bug in your sample one needs to run our game with IMA integration first. Once this is done, the bug is 100% reproducible in your sample, without that the sample works as expected. Can't tell for sure how long the effect lasts, but you'll have at lease a few minutes.

  If you are still interested in the bug reproduction, please, send a safe upload link to my e-mail. The build is confidential.

IMA SDK

unread,
Jun 29, 2021, 11:57:30 AM6/29/21
to ig...@wildspike.com, ima...@googlegroups.com
Hi Igor,

Thank you for the response back. If you are running our sample and see no issue. But only get this issue to happen when using your app and then doing our sample, we will definitely needed more detailed steps of what you are doing and seeing. So that we can look moire into all the things that are happening. As for where you can send it, imate...@gmail.com.

Igor

unread,
Jul 1, 2021, 8:40:18 AM7/1/21
to Interactive Media Ads SDK
I've sent the build. More information in the e-mail.

IMA SDK

unread,
Jul 2, 2021, 12:02:03 AM7/2/21
to ig...@wildspike.com, ima...@googlegroups.com

Hi Igor,

 

I work along with William.

 

I am confirming that we have the requested information on our e-mail. With that, I will share it to our team to further investigate on the issue. We will get back to you the soonest we have our findings.

Regards,

Google Logo
Michael Angelo Legaspi
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HDDVG:ref

IMA SDK

unread,
Dec 27, 2021, 5:27:15 AM12/27/21
to ig...@wildspike.com, ima...@googlegroups.com

Hello Igor,

 

Hope you are doing well.

 

I just want to get back on this as our team find this issue as an intended behavior. Since the issue cannot be reliably reproduced from our end and yours, it would seem that the cause of this is not within IMA SDK itself. Thus, right now, the error messaging 'Ad Error: There was a problem requesting ads from the server. Caused by: 6' sounds sufficient from IMA side.

 

Let us know should you have any other concern.

Regards,

Google Logo
Michael Angelo Legaspi
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HDDVG:ref

Igor Lobanchikov

unread,
Dec 27, 2021, 5:47:01 AM12/27/21
to IMA SDK, ima...@googlegroups.com
HI Michael.

  Since you can't reproduce the issue, I think it would be fair if you close it to keep your records clean. Watchdog as a workaround works well for me anyway.

  Please, note that it might be a good idea to add case AD_BREAK_FETCH_ERROR: handling to adsManager.addAdEventListener in your samples. It's a little bit counter-intuitive to have 3 different paths for the error processing, so this might save some time for the developers.

Regards,
Igor.

IMA SDK

unread,
Dec 28, 2021, 1:36:17 AM12/28/21
to ig...@wildspike.com, ima...@googlegroups.com

Hello Igor,

 

Thank you for responding back to us.

 

I will make sure to let our team know about your recommendation for it to be considered. However, it will not be guaranteed to be implemented any time soon as it will still go under extensive reviews and if it will be found as feasible and necessary. For the meantime, you may check our blog posts or release notes for possible future updates.

Regards,

Reply all
Reply to author
Forward
0 new messages