Admob banner causes lag while playing Android Libgdx game

384 views
Skip to first unread message

fatihga...@gmail.com

unread,
Jun 10, 2016, 8:15:28 PM6/10/16
to Google Mobile Ads SDK Developers

I hide banner ads while playing and show on game over screen but while playing game lags. If I disable ads then there is no lag. Or if I connect to wi-fi, again no lag, but with mobile data it lags. Can I do network opertions on a seperate thread? I think Asynctask is only for loading ads but not for refreshing.


Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jun 13, 2016, 10:37:54 AM6/13/16
to Google Mobile Ads SDK Developers
Hi there,

It really is up to you but I would not recommend you to use an AsyncTask to request Ads in the background. Also, I notice that you have mentioned libgdx as your framework, which means that you might be using their wrapper framework to show ads. We do not support this but you can still use our Native C++ API to show ads, which might clear the banner lag issue for you. 

Thanks,
Veer Busani
Mobile Ads SDK Team

fatihga...@gmail.com

unread,
Jun 13, 2016, 3:34:24 PM6/13/16
to Google Mobile Ads SDK Developers
Thanks for reply,

Libgdx is also a java framework, not c++, so why do I use Native C++ API to show ads? And I think my code snippet to show ads is quite the same with yours.

13 Haziran 2016 Pazartesi 17:37:54 UTC+3 tarihinde Veer Arjun Busani(Mobile Ads SDK Team) yazdı:

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jun 13, 2016, 3:54:30 PM6/13/16
to Google Mobile Ads SDK Developers
Hi there,

That option is available if the framework has enabled C++. I'm not aware of the the libgdx framework, but if it does expose its C++ libraries in any form, then you would be able to use our C++ APIs. Other than that, we do not support libgdx.

Thanks,
Veer Busani
Mobile Ads SDK Team

fatihga...@gmail.com

unread,
Jun 20, 2016, 12:26:02 PM6/20/16
to Google Mobile Ads SDK Developers

Hi,

I have added this code snippet to my Activity’s onCreate method and it works perfect:


Thread[] tarray=new Thread[20];
Thread.enumerate(tarray);
for (byte i=0;i<20;i++){
   
if (tarray[i]!= null) {
        tarray[i].setPriority(Thread.
MAX_PRIORITY);
    }
}

 

But I am not sure if this causes any other problems.


13 Haziran 2016 Pazartesi 22:54:30 UTC+3 tarihinde Veer Arjun Busani(Mobile Ads SDK Team) yazdı:

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jun 20, 2016, 12:46:09 PM6/20/16
to Google Mobile Ads SDK Developers
Hi there,

Glad that you were able to solve your issue. Though, personally, I will not suggest you to do this as it could cause a lot of hiccups with performance. On a seperate note, this is a fantastic channel to learn more about app performance.

Thanks,
Veer Busani
Mobile Ads SDK Team

Fatih ÇAKIR

unread,
Jul 11, 2016, 2:10:16 PM7/11/16
to google-adm...@googlegroups.com
This works only for test ads but not for real ads.

--

---
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/yfbDpXNs40o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jul 11, 2016, 8:10:11 PM7/11/16
to Google Mobile Ads SDK Developers
Hi Faith,

Would you mind elaborating on your issue? Also, as I have mentioned, currently there is no official support for libgdx framework. 

Thanks,
Veer Busani
Mobile Ads SDK Team

On Monday, July 11, 2016 at 2:10:16 PM UTC-4, Fatih ÇAKIR wrote:
This works only for test ads but not for real ads.
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.
Reply all
Reply to author
Forward
0 new messages