Google Mobile Ads APIs in Google Play Services

6,218 views
Skip to first unread message

Eric Leichtenschlag

unread,
Oct 31, 2013, 3:39:05 PM10/31/13
to google-adm...@googlegroups.com
Hey guys,

We just launched Google Mobile Ads on Google Play services! Integrating with Google Play services allows your app to stay on the latest version of the Google Mobile Ads library without having to update your app, as updates will automatically get pushed to the device. Check out this post for the announcement of the new library, and our docs for how to get started. We also have a migration guide which showcases some implementation differences between the old Google Mobile Ads Android SDK and the new Google Mobile Ads library included as part of Google Play Services.

Thanks,
Eric

Android Developer

unread,
Oct 31, 2013, 6:05:22 PM10/31/13
to google-adm...@googlegroups.com
I always get this error message from the GooglePlayServiceUtil "Google Play services out of date.  Requires 4030500 but found 3266136"!

But there is no update in the PlayStore at the moment... maybe it takes some time


Tony Chan

unread,
Oct 31, 2013, 7:15:02 PM10/31/13
to google-adm...@googlegroups.com
Can you clarify some things:

1) Is it safe to continue to use the separate AdMob SDK? Or will it be deprecated at some point?

2) I ask because I want to continue to support devices that don't have Play Services (like the Kindles) or that won't be getting the new Play Services release (like older Android 2.2 devices). I use AdMob as mediation, so is my only course of action to stick with the separate AdMob SDK? I don't want to end up making several APKs of my app for each app store/device.

3) For the new Play Services' bundled AdMob SDK, is there a separate Mediation SDK? Because the mediation guide page seems to allude to that. See this pic from instructions for the Play version of Mediation guide:



4) If we do decide to migrate over to the Play Services' bundled AdMob SDK, does that mean the AdMob mediation adapters that we're currently using will be broken? Will 3rd party ad networks need to provide TWO different adapters for the TWO different AdMob SDKs now?

5) Which version of the adapters (Play Services versoin or separate Android) are currently linked in the Medaition Networks page?

6) How can we know if our app will be running on a device that contains the new Play Services release along with the bundled AdMob SDK?

Thanks for any clarification, it is greatly needed since I can't justify migrating over until I know the answers to these questions. I'm sure I'm not the only one that's using AdMob for mediation.

Eric Leichtenschlag

unread,
Nov 1, 2013, 8:53:28 PM11/1/13
to google-adm...@googlegroups.com
Hi Tony,

1) It is safe to continue to use the standalone Android AdMob SDK for now. No deprecation plans yet, but we plan to spend future development time on the Google Play services (GPS) version.

2) GPS still supports devices that don't have the Google Play store installed on it. The only difference is that devices without the Play Store (and the accompanied GPS apk) on it will not receive automatic updates, so you'll still want to grab new versions of the library provided in Android SDK manager and include them when releasing your app.

3) The AdMob APIs and mediation APIs are part of the same library. If you include the GPS library, you will have mediation. If you only include the standalone AdMob SDK, you also have mediation.

4) Good question. The GPS library currently works with existing ad network adapters. In a future iteration of the GPS library, we plan to revamp the mediation APIs for ad networks and we'll eventually ask them to support the new Google Play services version of the APIs. We fully understand that this won't happen overnight though, so the existing adapters that work for the standalone AdMob SDK will continue to be supported in Google Play services for the foreseeable future.

5) Since the current mediation adapters will work with GPS, there is only one version of the adapters. When adapters upgrade to use the new mediation APIs (which, mind you, haven't even been developed yet), the new version of the adapters will likely be presented in a new column on the mediation page.

6) You shouldn't need to worry about this, since the GPS AdMob library can still run on all devices, and AdMob will handle the case where the service isn't available. However, if you want to make this check yourself, you can consult GooglePlayServicesUtil.isGooglePlayServicesAvailable.

Cheers,
Eric

Eric Leichtenschlag

unread,
Nov 1, 2013, 9:01:11 PM11/1/13
to google-adm...@googlegroups.com
@Android Developer,

The rollout of the new service started yesterday, but isn't yet pushed to all devices yet. Even if you get that error message in the logs though, the Google Play services library should still run, since it'll fallback to the version you have in your app.

Thanks,
Eric

Tony Chan

unread,
Nov 1, 2013, 9:36:40 PM11/1/13
to google-adm...@googlegroups.com
Excellent clarification Eric, thank you!

Just wanted some further clarification on the GPS library's AdMob. So if I include the new GPS 4.0 library in my project as usual, I will get the new bundled AdMob APIs, which will then call through to the device's/user's GPS apk.

But if the device/user doesn't have GPS (or only has a GPS apk older than 4.0) then the new AdMob APIs that I'm calling will fallback to a bundled AdMob SDK that is included in the new GPS 4.0 jar?

Therefore I no longer ever (for the foreseeable future) need to include the standalone AdMob SDK?

If this is the case I think it would be helpful to note this fallback behavior in the AdMob guides somewhere. I didn't really glean this from looking them over, or maybe I just missed it. Thanks!

Fung LAM

unread,
Nov 2, 2013, 12:01:54 PM11/2/13
to google-adm...@googlegroups.com
I've migrated to GPS SDK, but found that if the Ad failed to load (e.g. no network), the AdView still take up the space which is different from the AdMob SDK.

Markus Wiederkehr

unread,
Nov 3, 2013, 6:17:17 AM11/3/13
to google-adm...@googlegroups.com
I am also curious, if the GPS apk is present and is recent enough then the GPS process would be loading the ad and passing it on to the client app, is this correct?

Would this mean that the app could show ads without having Internet permission? (As long as it's only AdMob ads, i.e. no mediation.)

Regards,
Markus

Thiam Hing Soh

unread,
Nov 3, 2013, 8:17:37 PM11/3/13
to google-adm...@googlegroups.com
I have this error as well, and I think it's affecting my IAB code. Using the latest Play Services SDK, IAB fails when app is tested on a device with Play Services SDK r12 (v3.0), but when testing on a device with Play Services v4.0, it runs as per normal.

Eric Leichtenschlag

unread,
Nov 4, 2013, 3:06:10 PM11/4/13
to google-adm...@googlegroups.com
Tony,

That's correct, if the device doesn't have GPS apk or a version that is too old, AdMob will fall back to the AdMob library present in the GPS 4.0 jar your app bundles in. We can probably make this clearer somewhere in the docs.

Thanks,
Eric

Eric Leichtenschlag

unread,
Nov 4, 2013, 3:10:28 PM11/4/13
to google-adm...@googlegroups.com
Markus,

GPS does do the ad loading when it can, but the underlying WebView will run in client process and internet permission is still required for JavaScript to run. But even if that weren't the case, you'd still need the internet permissions anyways for mediation, or to serve ads to devices that didn't have a recent enough GPS installed on their device.

Thanks,
Eric

Eric Leichtenschlag

unread,
Nov 4, 2013, 3:20:22 PM11/4/13
to google-adm...@googlegroups.com
Hi Fung,

Yes, this is new intentional behavior. It is more consistent with the rest of native Android views that don't change size automatically on you. The recommended practices here are to reserve some space for the ad (and optionally include a logo behind that ad space for when the ad doesn't show), or to load the ad off screen and animate it in. The GPS library aims to prevent the entire UI from suddently changing as a result of an ad fill.

Thanks,
Eric

Rajnish Mishra

unread,
Nov 6, 2013, 3:43:26 PM11/6/13
to google-adm...@googlegroups.com
 Thanks for the info,

I have a Question -
I have tried using Admob library with GPS but while dex compiler finds two instances of admob claases in eclipse and build fails with multiple instances of admob classes , As GPS does not works on 2.2 so what can be the solution should I use that ad space on 2.2 for some other ads or is there is any solution for that.

Eric Leichtenschlag

unread,
Nov 6, 2013, 8:35:39 PM11/6/13
to google-adm...@googlegroups.com
Hi Rajnish,

If you want to support Android 2.2, you'll have to use the old AdMob SDK. And in this case won't be able to use the latest GPS anyways since it just dropped support for Android 2.2. So you shouldn't have any issues with multiple instances of the same class.

Thanks,
Eric

Fung LAM

unread,
Nov 10, 2013, 11:05:26 AM11/10/13
to google-adm...@googlegroups.com
Understood. I've added AdListener to make the view invisible and
visible on failure or successfully load. (more code than AdMob SDK
@@|)
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Google AdMob Ads Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> google-admob-ads...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
http://profiles.google.com/seventhmoon

Udayan

unread,
Nov 18, 2013, 6:29:59 AM11/18/13
to google-adm...@googlegroups.com
Hi Eric,

Is there any way that I can include both AdMob SDK and GPS in my app? 
We only need GPS to fetch the Advertising ID. But ad serving should be done from AdMob SDK. (As we need to support android 2.2).

On a similar note.. Is it possible to fetch Advertising ID without using GPS?

--
Thanks,
UD

Eric Leichtenschlag

unread,
Nov 19, 2013, 6:27:38 PM11/19/13
to google-adm...@googlegroups.com
Hello UD,

The advertising ID is only available via GPS, and the latest GPS version requires 2.3 minimum anyways. The AdMob 2.3 minimum requirement is governed by the GPS requirement. So since you'll need to be on 2.3 minimum to use Advertising ID, the recommendation is to upgrade to use GPS AdMob API.

Thanks,
Eric

Udayan

unread,
Nov 20, 2013, 3:05:43 AM11/20/13
to google-adm...@googlegroups.com
Thanks Eric!

So basically if I want to use Advertising ID in my app, I must update to GPS and change minimum SDK version to 2.3.

BTW, any tentative dates/idea when the support DoubleClick For Publishers (DFP), Ad Exchange, or Search Ads for Apps will be included in GPS?

--
Thanks,
UD

Tony Chan

unread,
Nov 20, 2013, 3:09:25 PM11/20/13
to google-adm...@googlegroups.com
So if we're still supporting Android 2.2, there's no reason right now to migrate to the new AdMob API bundled in the new GPS? As described here.

Eric Leichtenschlag

unread,
Nov 21, 2013, 6:13:05 PM11/21/13
to google-adm...@googlegroups.com
DFP, Ad Exchange, and Search Ads for Apps available in the next GPS release.

Thanks,
Eric

Eric Leichtenschlag

unread,
Nov 21, 2013, 6:15:00 PM11/21/13
to google-adm...@googlegroups.com
If you need to still support older versions, sticking with the standalone SDK is still an option. However, AdMob plans to only work on the Google Play services version going forward.

Thanks,
Eric

Dirk Wunderlich

unread,
Nov 27, 2013, 4:41:50 AM11/27/13
to google-adm...@googlegroups.com
I updated to the latest GPS version, but now I'm not able to use both, GPS (for the +1 button) and AdMob with DFP. 
AdMob via GPS does not support DFP, so I need to download the AdMob SDK (6.4.1). But that creates a conflict like this:
"Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;" 

Any suggestions?

Thanks,
Dirk

deepak k.k

unread,
Jan 24, 2014, 7:34:48 AM1/24/14
to google-adm...@googlegroups.com
Hi,
 i  integrated google ads with play services, presently i am using banner ad.My problem is in some devise ad is loading in some device its not loading . I am getting error like this 
"
01-23 16:42:09.009: I/Ads(8029): Trying mediation network: 5450213213286189855
01-23 16:42:09.009: I/Ads(8029): Instantiating mediation adapter: com.google.ads.mediation.admob.AdMobAdapter
01-23 16:42:14.009: I/Ads(8029): Timed out waiting for adapter.
01-23 16:42:14.009: I/Ads(8029): No fill from any mediation ad networks.
01-23 16:42:14.009: I/Ads(8029): Scheduling ad refresh 60000 milliseconds from now.
01-23 16:42:14.019: W/Ads(8029): Failed to load ad: 3
01-23 16:43:00.349: I/Ads(8029): Ad is not visible. Not refreshing ad.
01-23 16:43:00.349: I/Ads(8029): Scheduling ad refresh 60000 milliseconds from now.
01-23 16:43:14.019: I/Ads(8029): Starting ad request. "
What is the reason?

Eddie Lee

unread,
Jan 24, 2014, 12:17:18 PM1/24/14
to google-adm...@googlegroups.com
This problem have been exists for over one week and I am so strange that until now google still haven't fix the issue, we are losing money day by day because of the fault from google!

and for deepak the reason why you get the timeout is because the user's google play service got update while the google play service library you used to built is still the old one, I would suggest you to build a new version of your apps with the new google play library asap, this cannot help your user with the old version to get the ad, but at least you can minimize your lose on this issue.

Here is a summary.
Old library + old google play in client device= ad ok
new library + new google play in client device=ad ok
old library + new google play in client device= ad not shown
old library + no google play in client device(which is common in china)= ad ok

Thanks,
Eddie


2014/1/24 deepak k.k <dkk...@gmail.com>

--
 
---
You received this message because you are subscribed to the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.

Eric Leichtenschlag

unread,
Jan 24, 2014, 7:16:05 PM1/24/14
to google-adm...@googlegroups.com
Hey guys,

The short term solution for this is to pull in and use the 4.1 library from the Android SDK manager. For the longer term solution, it turns out this issue can be fixed in the service. So the next service push will be compatible with the 4.0 library for those users who don't update their apps.

Thanks,
Eric


2014/1/24 deepak k.k <dkk...@gmail.com>
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

deepak k.k

unread,
Jan 28, 2014, 11:32:06 PM1/28/14
to google-adm...@googlegroups.com
Hello ,
  Now i am facing next issue with admob + gps(Google play service). I integrated google ad through gps.  Since I integrated the AdMob view on my app, the CPU usage of the app grose to 12% all the time. If i disable ads, then cpu usage become 0. Presently i integrated ads integrated through xml.



2014/1/24 deepak k.k <dkk...@gmail.com>
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

hengpec...@gmail.com

unread,
Feb 4, 2014, 4:18:34 AM2/4/14
to google-adm...@googlegroups.com
Who can help me i have problem withe my admob error ? please help me

Eric Leichtenschlag

unread,
Feb 4, 2014, 3:24:01 PM2/4/14
to google-adm...@googlegroups.com
What is your error?

deepak k.k

unread,
Feb 5, 2014, 9:34:42 AM2/5/14
to google-adm...@googlegroups.com
Hello Eric,
 Since I integrated the AdMob view on my app, the CPU usage of the app grose to 12% all the time. If i disable ads, then cpu usage become 0. I integrated admob through google play service . In four places(Activity) i am showing ad.

Regards
Deepak. K K






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

Eric Leichtenschlag

unread,
Feb 5, 2014, 9:26:05 PM2/5/14
to google-adm...@googlegroups.com
Hi Deepak,

I'm not aware of anything the SDK could be doing that is so CPU intensive. I think that's just the nature of the ad and the WebView on Android.

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

deepak k.k

unread,
Feb 6, 2014, 6:45:05 AM2/6/14
to google-adm...@googlegroups.com
Hello Eric ,
 
   If app is in foreground the cpu usage is fine, but in background its not fair. It will cause the battery drainage. Is there any way i can  stopping web view thread in android. ?

Regards
Deepak K K


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

Eric Leichtenschlag

unread,
Feb 6, 2014, 4:32:04 PM2/6/14
to google-adm...@googlegroups.com
Google Play services has an AdView.pause() method, which we recommend that you invoke in your activity's onPause() method. This method forwards the call to webView.onPause() so any javascript or extra processing shouldn't be happening in the background. Similarly, there is an AdView.resume() method to be called in onResume to resume the WebView once the user returns to the app.

Thanks,
Eric


On Thursday, February 6, 2014 3:45:05 AM UTC-8, deepak k.k wrote:
Hello Eric ,
 
   If app is in foreground the cpu usage is fine, but in background its not fair. It will cause the battery drainage. Is there any way i can  stopping web view thread in android. ?

Regards
Deepak K K
On Thu, Feb 6, 2014 at 7:56 AM, Eric Leichtenschlag <eleich...@google.com> wrote:
Hi Deepak,

I'm not aware of anything the SDK could be doing that is so CPU intensive. I think that's just the nature of the ad and the WebView on Android.

Thanks,
Eric


On Wednesday, February 5, 2014 6:34:42 AM UTC-8, deepak k.k wrote:
Hello Eric,
 Since I integrated the AdMob view on my app, the CPU usage of the app grose to 12% all the time. If i disable ads, then cpu usage become 0. I integrated admob through google play service . In four places(Activity) i am showing ad.

Regards
Deepak. K K




On Wed, Feb 5, 2014 at 1:54 AM, Eric Leichtenschlag <eleich...@google.com> wrote:
What is your error?


On Tuesday, February 4, 2014 1:18:34 AM UTC-8, hengpec...@gmail.com wrote:
Who can help me i have problem withe my admob error ? please help me

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

For more options, visit https://groups.google.com/groups/opt_out.

deepak k.k

unread,
Feb 7, 2014, 12:38:05 AM2/7/14
to google-adm...@googlegroups.com
Hello Eric,

This is the my current implementation.

XML :

<com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        ads:adSize="SMART_BANNER"
        ads:adUnitId="1234567890" />



JAVA :

package com.rs.googleadd;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

public class MainActivity extends Activity {

private AdView mAdvView;
public static final String TAG = MainActivity.class.getSimpleName();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initAd();
}

private void initAd() {
mAdvView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdvView.loadAd(adRequest);

}

@Override
protected void onResume() {
super.onResume();
if (mAdvView != null)
mAdvView.resume();
}

@Override
protected void onPause() {
if (mAdvView != null)
mAdvView.pause();
super.onPause();
}

@Override
protected void onDestroy() {

if (mAdvView != null)
mAdvView.destroy();
super.onDestroy();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}


This adb top command result  :
Application in foreground :

5307  16% S    15 141636K  33520K  fg app_62   com.rs.googleadd
 5307  27% S    15 141636K  33528K  fg app_62   com.rs.googleadd
 5307  14% S    15 141636K  33532K  fg app_62   com.rs.googleadd
 5307   9% S    15 141636K  33536K  fg app_62   com.rs.googleadd
 5307   9% S    15 141636K  33540K  fg app_62   com.rs.googleadd
 5307  23% S    15 141636K  33540K  fg app_62   com.rs.googleadd
 5307  17% S    15 141636K  33548K  fg app_62   com.rs.googleadd
 5307   8% S    15 141636K  33548K  fg app_62   com.rs.googleadd
 5307   6% S    15 141636K  33548K  fg app_62   com.rs.googleadd
 5307   7% S    15 141636K  33548K  fg app_62   com.rs.googleadd
 5307  26% S    15 141636K  33552K  fg app_62   com.rs.googleadd
 5307  10% S    15 141636K  33556K  fg app_62   com.rs.googleadd
 5307  12% S    15 141636K  33560K  fg app_62   com.rs.googleadd
 5307  10% S    15 141636K  33560K  fg app_62   com.rs.googleadd
 5307  10% S    15 141636K  33564K  fg app_62   com.rs.googleadd
 5307  28% S    15 141636K  33576K  fg app_62   com.rs.googleadd
 5307  11% S    15 141636K  33580K  fg app_62   com.rs.googleadd
 5307  10% S    15 141636K  33580K  fg app_62   com.rs.googleadd
 5307   8% S    15 141636K  33584K  fg app_62   com.rs.googleadd




Application in background:

 5307   7% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   5% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   7% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307  12% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   8% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307  10% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   9% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   9% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307  14% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   8% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   7% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   7% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307  16% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   6% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   7% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   6% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   7% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307  14% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   7% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   9% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   9% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   8% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307  16% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   8% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   8% S    15 125248K  33512K  bg app_62   com.rs.googleadd
 5307   8% S    15 125248K  33512K  bg app_62   com.rs.googleadd

After quitting application :

 5307   9% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   9% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307  10% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307  14% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   9% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   7% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   8% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307  15% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   6% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   7% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   7% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   6% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307  15% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   8% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307  10% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   9% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   8% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307  16% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   9% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   9% S    15 126664K  35572K  bg app_62   com.rs.googleadd
 5307   8% S    15 126664K  35572K  bg app_62   com.rs.googleadd







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

Pedro Da Ros

unread,
Feb 9, 2014, 7:46:42 PM2/9/14
to google-adm...@googlegroups.com
How does Google Play Service integrates with non-Google app stores (such as Amazon and Samsung app stores)? Do I have to make a different binary for them?

I'm hesitant to migrate due to my apps being available on those stores.

Thanks.

Eric Leichtenschlag

unread,
Feb 10, 2014, 12:04:59 PM2/10/14
to google-adm...@googlegroups.com
@Deepak, that implementation looks good to me. Do you get the same results if you create a new WebView, set JavaScript enabled on the WebView, and load a web url into it?

@Pedro, when you build your app with Google Play services, you reference the library project and so all of those class files (which you don't proguard out) are part of your app. At runtime, the mobile ads library classes that you integrated check to see if Google Play services is available on the device. If Play services is available, it'll dynamically load the sdk class files from the service and use those instead of the ones compiled into your app. If Play services is not available, the mobile ads library can function with the classes built into your app. You won't get automatic updates though.

Note that other components in Google Play services (example: google maps or google plus) do require the service to be present on the device. I believe at this time only the Mobile Ads component can function without the service.

Thanks,
Eric

deepak k.k

unread,
Feb 11, 2014, 12:00:41 AM2/11/14
to google-adm...@googlegroups.com
Hello Eric,

  Inside in the adview , there is one web view, that web continuously fetching data from admob server. That is the root cause of this issue. How can i stop that web view thread. If i stop that thread how can i start that thread again.?



--

deepak k.k

unread,
Feb 11, 2014, 12:47:54 AM2/11/14
to google-adm...@googlegroups.com
Hello Eric,
When app in background , why google ads is running?. This is the common behavior of google ads?.  What about internet usage?. Its continuously fetching data from admob server. This will cause the high data(Internet) usage also. 

Regards
Deepak K K

Cadrick Loh

unread,
Feb 11, 2014, 6:11:20 AM2/11/14
to google-adm...@googlegroups.com
Hi, after updated to the latest GPS, I'm able to solve AdMob timeout issues but then I realise some of my codes didn't work as before.

For example:

I'll call this

mAdView.setVisibility(View.VISIBLE); // show banner

mAdView.setVisibility(View.GONE); // hide banner


To set my ad banner visible, but I realise sometimes the whole screen will turn into white color and the ad banner will appear at the top instead of bottom.

The major issue is the whole screen turn into white colour and totally covered my default screen.


Any idea how can I fix it?

Eric Leichtenschlag

unread,
Feb 11, 2014, 12:18:09 PM2/11/14
to google-adm...@googlegroups.com
@deepak,

When the app is in the background, AdMob will won't refresh. And if you call adView.pause(), it should also pause the JavaScript on the current ad. I tried running top -m 10 in the Android shell with a sample running on Google Play services. I got similar levels of 25-30% cpu when the app was running, but when I put it into the background, I see 3% for about 10 seconds and then down to 0%. Even if I didn't call adView.pause(), I still never saw more than 5-6% CPU usage in the background. Are you running these tests on a small sample app with just AdMob?

@Cadrick, this sounds like a layout issue. Could you post your activity's layout?

Thanks,
Eric

Cadrick Loh

unread,
Feb 11, 2014, 8:14:20 PM2/11/14
to google-adm...@googlegroups.com

LinearLayout.LayoutParams adParams = new LinearLayout.LayoutParams(width, height+height-mAdView.getAdSize().getHeightInPixels(getContext()));

       

// Adding full screen container

addContentView(mAdView, adParams);

deepak k.k

unread,
Feb 12, 2014, 8:03:18 AM2/12/14
to google-adm...@googlegroups.com
Hello Eric,

 In my app , google ad is showing in 4 pane. Whenever opening the ad pages  are continuously, that time app consuming very high cpu. Even app move into background time also. In my log i can see  

"I/Ads     ( 8174): Ad is not visible. Not refreshing ad.
I/Ads     ( 8174): Scheduling ad refresh 60000 milliseconds from now." 

 This means adview fetching data from server, and trying fill the data into corresponding view. Why its fetching data from server when its background.?

Regards
Deepak K K



--

Eric Leichtenschlag

unread,
Feb 12, 2014, 9:18:20 PM2/12/14
to google-adm...@googlegroups.com
Cadrick,

I'm not sure what width and height are here but you're specifying a height in pixels without accounting for density, so it'll look smaller on higher density devices. It's recommended to do WRAP_CONTENT on the height of the banner, and WRAP_CONTENT or MATCH_PARENT for your width, to let the ad give itself enough space.

Thanks,
Eric

Eric Leichtenschlag

unread,
Feb 12, 2014, 9:22:48 PM2/12/14
to google-adm...@googlegroups.com
Hi Deepak K K,

The SDK does have a 60s refresh timer here that still activates when the app is in the background, but before doing any ad loading it makes a check to see if the ad is visible. When it isn't, the SDK logs that message and waits another 60 seconds. So no request is made to the server in that case. So overall it's very little overhead.

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

deepak k.k

unread,
Feb 12, 2014, 11:24:40 PM2/12/14
to google-adm...@googlegroups.com
Hi Eric,

How can i stop adrequest , when app in background?. I tried adview.pause and adview.destroy. But it does't  work.

Regards
Deepak K K


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

Eric Leichtenschlag

unread,
Feb 13, 2014, 11:06:52 AM2/13/14
to google-adm...@googlegroups.com
There isn't a way right now to stop that behavior, unless you just remove the AdView from the view hierarchy altogether.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
Message has been deleted

Elie.R.

unread,
Feb 13, 2014, 12:26:13 PM2/13/14
to google-adm...@googlegroups.com
Hello Eric,

I have been following the thread since yesterday, and I have switched from stand alone SDK to GPS (main reason it to reduce CPU usage), and I can confirm that the pause and resume are not helping with the CPU usage in the background or even when setting the adview to Invisible or Gone.

Can you please consider increasing the priority of this enhancement? so that we could reduce the CPU usage, especially when developing games and supporting low end single core devices, the admob view is killing the smooth FPS?

( Maybe a humble suggestion would be to consider throwing in a blank image (when the adview is invisible/or in the background ) inside the view instead of the scrolling text, since the cpu issue appears when having a scrolling/flipping text and disappears when the ad shown is a view. And on resume bring back the scrolling/flipping text.

Thank you
Elie

Eric Leichtenschlag

unread,
Feb 13, 2014, 4:05:23 PM2/13/14
to google-adm...@googlegroups.com
Hi Elle,

Have you been getting similar CPU numbers to Deepak in the background? I couldn't reproduce those numbers with our banner sample. pause() and resume() on the AdView do call WebView.onPause() and WebView.onResume(), something that the standalone SDK didn't do at all. So I'm not concerned with the actual text ad that's showing.

Thanks,
Eric

Elie.R.

unread,
Feb 13, 2014, 5:26:23 PM2/13/14
to google-adm...@googlegroups.com
Hello Eric

Please see attached picture.

I ran the tests on the BannerAdsSample example, and linked it to my GPSs library, I ran and checked the CPU usage and still got high CPU usage while in the background.

Attached picture shows the result on a real test device GIO with 2.3.6, (also I run the same test on Gnex 4.3 and got the same result)
In the attached picture you see :
- at the top the app running and the CPU usage in 24%
- in the middle the app is sent into the background with CPU usage 21%
- at the bottom a snapshot of the task manager showing the CPU usage of the example
Please do let me know if the pic is not clear.

1. If the example also shows the same thing as our apps, could it be somehow due do the GPS not being udpated somehow, although I have updated everything from the SDK manager. And the GPS version is "4.1.32 (978161-30)" ?

2. Although I don't think it is related but does the target SDK of GPS or the example has anything to do with it  <uses-sdk android:minSdkVersion="8" /> ?

Thank you for your follow-up

Elie
testBannerExampleCPU.jpg

Eric Leichtenschlag

unread,
Feb 18, 2014, 10:55:17 AM2/18/14
to google-adm...@googlegroups.com
Hi Elle,

Those pictures are pretty clear. I couldn't reproduce on a Galaxy Nexus 4.2.1, but did reproduce on a Galaxy S2 on 4.0.3. I'll file a bug against the SDK dev team with these findings and have them investigate.

Google Play services technically requires a minSdkVersion of 9, but both of your test devices were running 9 or higher.

Thanks,
Eric

Elie.R.

unread,
Feb 18, 2014, 11:00:53 AM2/18/14
to google-adm...@googlegroups.com
Great : ) Thanks a lot for your time and your follow up on the issue.
Will be waiting for the results.

Many Thanks,
Elie

Eric Leichtenschlag

unread,
Feb 18, 2014, 11:05:20 AM2/18/14
to google-adm...@googlegroups.com
Hmm, I also just checked with v6.4.1 of the SDK and got the same results with high CPU in the background on the S2 but not the Nexus 5. That doesn't necessarily mean it isn't an issue, but I'm starting to think that it's a combination of this being around for a while and the S2 just not having as much processing power as the newer devices.

Elie.R.

unread,
Feb 18, 2014, 11:22:18 AM2/18/14
to google-adm...@googlegroups.com
Yes I agree with the analysis, (same as the 6.4.1) and the need for every free processing resource (in the context of game dev) is the reason why I asked for the issue.

More description on why we need the fix : )
-On standard application the issues is not of a high priority even on low devices.
-But when it comes to game development, and since there are a vast majority of casual gamers running on devices with single and dual core ( relatively slow CPU), we need the processing power completely for the game. And during game play even when we hide the admob view it is consuming around 10%-20% of CPU usage reducing the frame rate from  60FPS to around 40FPS. We upgraded from 6.4.1 to GPS to use the resume() and pause() and unfortunately this didn't solve the issue

deepak k.k

unread,
Feb 24, 2014, 12:02:00 AM2/24/14
to google-adm...@googlegroups.com
Hello Eric ,

 Is there any solution for adview cpu usage....?

Regards
Deepak K K


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

Eric Leichtenschlag

unread,
Feb 24, 2014, 6:30:35 PM2/24/14
to google-adm...@googlegroups.com
Hi Deepak,

I provided some more information in this thread. Calling new WebView(this).pauseTimers(); in onPause() and new WebView(this).resumeTimers() on onResume is a workaround. It affects all WebViews in your application though. We're investigating a fix to make adView.pause() work as you would expect it to.

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

deepak k.k

unread,
Feb 24, 2014, 11:43:18 PM2/24/14
to google-adm...@googlegroups.com
Hi Eric,
 
 Inside the adview, one web is there, that web view i extracted and applied this logic. But till it consuming near 1-4 % cpu.

// Implementation.
public void resume() {
try {
mAdView.resume();
resumeWebView((ViewGroup) mAdView);
} catch (Exception e) {
Log.d(TAG, "Exception:" + e);
}
}

public void pause() {
try {
mAdView.pause();
pauseWebView((ViewGroup) mAdView);

} catch (Exception e) {

}
}

public void destroy() {
try {
mAdView.destroy();
destroyWebView((ViewGroup)mAdView);
mAdView = null;
System.gc();
} catch (Exception e) {
Log.d(TAG, "Exception:" + e);
}

}

private void pauseWebView(ViewGroup v) {
try {
for (int i = 0; i < v.getChildCount(); i++) {
View child = v.getChildAt(i);
if (child instanceof WebView) {
((WebView) child).pauseTimers();
} else if (child instanceof ViewGroup) {
pauseWebView((ViewGroup) child);
}
}
} catch (Exception e) {
Log.d(TAG, "Exception:" + e);
}

}

private void resumeWebView(ViewGroup v) {
try {
for (int i = 0; i < v.getChildCount(); i++) {
View child = v.getChildAt(i);
if (child instanceof WebView) {
((WebView) child).resumeTimers();
} else if (child instanceof ViewGroup) {
resumeWebView((ViewGroup) child);
}
}
} catch (Exception e) {
Log.d(TAG, "Exception:" + e);
}

}

private void destroyWebView(ViewGroup v) {
try {
for (int i = 0; i < v.getChildCount(); i++) {
View child = v.getChildAt(i);
if (child instanceof WebView) {
v.removeView(child);
((WebView) child).destroy();;
} else if (child instanceof ViewGroup) {
resumeWebView((ViewGroup) child);
}
}
} catch (Exception e) {
Log.d(TAG, "Exception:" + e);
}

}


Regards
Deepak K K



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

Eric Leichtenschlag

unread,
Feb 26, 2014, 3:39:39 PM2/26/14
to google-adm...@googlegroups.com
Hi Deepak,

I'm not sure about the last 1-4%, but to me it seems pretty minimal, and could be dependent on the app too.

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

For more options, visit https://groups.google.com/groups/opt_out.

deepak k.k

unread,
Feb 27, 2014, 4:57:15 AM2/27/14
to google-adm...@googlegroups.com
Hi Eric,

Admob eating very high cpu(15 - 25 %) in Samsung Galaxy Core GT-I8262 device. I tried my app and sample admob app. Both are eating very high cpu.

Regards
Deepak KK




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

Eric Leichtenschlag

unread,
Feb 27, 2014, 11:38:39 AM2/27/14
to google-adm...@googlegroups.com
Is this with or without the WebView.pauseTimers() call in onPause?

The pauseTimers call will stop the WebView from doing any work when the app is in the background. Because that one change affects the vast majority of that CPU usage, I'm guessing that 15-25% is just the cost of using a WebView with JS for ads on older devices without as much cpu power, and there's not much we can do about it.

deepak k.k

unread,
Feb 27, 2014, 11:06:35 PM2/27/14
to google-adm...@googlegroups.com
Hi Eric,

 I am calling that function(WebView.pauseTImers()) in onPause. my gps version is 4242030.

Regards
Deepak KK 


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

Eric Leichtenschlag

unread,
Feb 28, 2014, 4:22:11 PM2/28/14
to google-adm...@googlegroups.com
You're calling pauseTimers() in onPause and you're still seeing high CPU in the background? if you don't call resumeTimers() in onResume, do you see text ads animating (they shouldn't in this case)?

Thanks,
Eric

deepak k.k

unread,
Mar 4, 2014, 6:04:33 AM3/4/14
to google-adm...@googlegroups.com
Hello Eric,
 
 The pauseTImers() : Pauses all layout, parsing, and JavaScript timers for all WebViews. So it will affect my app web view also, right?

Regards
Deepak K K 


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

Eric Leichtenschlag

unread,
Mar 5, 2014, 1:24:15 PM3/5/14
to google-adm...@googlegroups.com
Hi Deepak,

Yes, that is the case. So if you have a WebView it would pause JavaScript in your WebView also while in the background.

I'm curious that this variation of Simone's code didn't work. This should theoretically pause every WebView that's a child of the AdView, but during my testing I'm still seeing high CPU in background. Anybody know if the pauseTimers() pauses more things than just onPause() on a particular WebView?

  @Override
  public void onResume() {
    super.onResume();
    if (adView != null) {
      resumeWebView(adView);
    }
  }

  @Override
  public void onPause() {
    if (adView != null) {
      pauseWebView(adView);
    }
    super.onPause();
  }
  
  void pauseWebView(ViewGroup v) {
    for (int i = 0; i < v.getChildCount(); i++) {
      View child = v.getChildAt(i);
      if (child instanceof WebView) {
        ((WebView)child).onPause();
      }
      else if (child instanceof ViewGroup) {
        pauseWebView((ViewGroup) child);
      }
    }
  }
   
  void resumeWebView(ViewGroup v) {
    for (int i = 0; i < v.getChildCount(); i++) {
      View child = v.getChildAt(i);
      if (child instanceof WebView) {
        ((WebView)child).onResume();
      }
      else if (child instanceof ViewGroup) {
        resumeWebView((ViewGroup)child);
      }
    }
  }


Pedro Da Ros

unread,
Mar 5, 2014, 3:47:40 PM3/5/14
to google-adm...@googlegroups.com

I’m not following this particular discussion, but regarding the code below, let me add my 2 cents, hope it helps somehow:

 

- WebView is inherited from ViewGroup, so theoretically you should onPause() and also call pauseWebView() on it since it could have children (ie, drop the “else”)

 

- the adView “root” member is not getting a onPause() call, but that may be on purpose.

 

Best

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

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

Eric Leichtenschlag

unread,
Mar 5, 2014, 4:18:36 PM3/5/14
to google-adm...@googlegroups.com
Thanks for the suggestions Pedro. But even this updated code didn't do the trick.

  @Override
  public void onResume() {
    super.onResume();
    if (adView != null) {
      adView.resume();
      resumeWebView(adView);
    }
  }

  @Override
  public void onPause() {
    if (adView != null) {
      adView.pause();
      pauseWebView(adView);
    }
    super.onPause();
  }
  
  void pauseWebView(ViewGroup v) {
    for (int i = 0; i < v.getChildCount(); i++) {
      View child = v.getChildAt(i);
      if (child instanceof WebView) {
        ((WebView) child).onPause();
      }
      pauseWebView((ViewGroup) child);
    }
  }
   
  void resumeWebView(ViewGroup v) {
    for (int i = 0; i < v.getChildCount(); i++) {
      View child = v.getChildAt(i);
      if (child instanceof WebView) {
        ((WebView) child).onResume();
      }
      resumeWebView((ViewGroup) child);
    }
  }

I guess for now pauseTimers() and resumeTimers() is still the best workaround as long as you aren't worried about your own or other WebViews doing background work.

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

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

Pedro Da Ros

unread,
Mar 19, 2014, 9:31:03 AM3/19/14
to google-adm...@googlegroups.com
Eric, I was fiddling with Google Play services, and when I tried to
load my game on a Kindle Fire I got this popup message upon starting
it: "Google Play services, which some of your applications rely on, is
not supported by your device.".

On this specific case I was testing other parts of Google Play
services. But I believe Mobile Ads would work normally, as you said
that Mobile Ads can function without the service, right? But anyway,
the question is: would this crazy popup appear every time the user
opens my game on an unsupported device (such as an original Kindle
Fire)?

Thanks


On Mon, Feb 10, 2014 at 12:04 PM, Eric Leichtenschlag
<eleich...@google.com> wrote:
> @Deepak, that implementation looks good to me. Do you get the same results
> if you create a new WebView, set JavaScript enabled on the WebView, and load
> a web url into it?
>
> @Pedro, when you build your app with Google Play services, you reference the
> library project and so all of those class files (which you don't proguard
> out) are part of your app. At runtime, the mobile ads library classes that
> you integrated check to see if Google Play services is available on the
> device. If Play services is available, it'll dynamically load the sdk class
> files from the service and use those instead of the ones compiled into your
> app. If Play services is not available, the mobile ads library can function
> with the classes built into your app. You won't get automatic updates
> though.
>
> Note that other components in Google Play services (example: google maps or
> google plus) do require the service to be present on the device. I believe
> at this time only the Mobile Ads component can function without the service.
>
> Thanks,
> Eric
>
>
> On Sunday, February 9, 2014 4:46:42 PM UTC-8, Pedro Da Ros wrote:
>>
>> How does Google Play Service integrates with non-Google app stores (such
>> as Amazon and Samsung app stores)? Do I have to make a different binary for
>> them?
>>
>> I'm hesitant to migrate due to my apps being available on those stores.
>>
>> Thanks.
>>
>> On Thursday, October 31, 2013 5:39:05 PM UTC-2, Eric Leichtenschlag wrote:
>>>
>>> Hey guys,
>>>
>>> We just launched Google Mobile Ads on Google Play services! Integrating
>>> with Google Play services allows your app to stay on the latest version of
>>> the Google Mobile Ads library without having to update your app, as updates
>>> will automatically get pushed to the device. Check out this post for the
>>> announcement of the new library, and our docs for how to get started. We
>>> also have a migration guide which showcases some implementation differences
>>> between the old Google Mobile Ads Android SDK and the new Google Mobile Ads
>>> library included as part of Google Play Services.
>>>
>>> Thanks,
>>> Eric
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Google AdMob Ads Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> google-admob-ads...@googlegroups.com.

Eric Leichtenschlag

unread,
Mar 20, 2014, 12:46:14 PM3/20/14
to google-adm...@googlegroups.com
Hi Pedro,

I can't say for sure how the other services react when you try to use them on a non-Google Play device. But the Google Mobile Ads service should still serve ads and not pop up that dialog, since it can still run without the service.

Thanks,
Eric

Pedro Da Ros

unread,
Mar 20, 2014, 12:56:08 PM3/20/14
to google-adm...@googlegroups.com

Oh, great. I thought the popup would show regardless of what methods/modules you use.

 

I can’t test yet with the Ads as I haven’t ported the code from the old standalone SDK to the GPservices version, but I will in a few days and will post back the results.

 

But anyway, I know this isn’t fault of mobile ads, but I don’t like this bundling of many services into a single library. I was much happier when I had more control on what I want to put on my app, which version, etc.

 

Best

 

From: google-adm...@googlegroups.com [mailto:google-adm...@googlegroups.com] On Behalf Of Eric Leichtenschlag
Sent: Thursday, March 20, 2014 12:46 PM
To: google-adm...@googlegroups.com
Subject: Re: Google Mobile Ads APIs in Google Play Services

 

Hi Pedro,

> For more options, visit https://groups.google.com/groups/opt_out.

--


---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

Eric Leichtenschlag

unread,
Mar 20, 2014, 1:01:20 PM3/20/14
to google-adm...@googlegroups.com
Hi Pedro,

Google Play services is a bigger library with many other APIs as you mentioned. But if you're using proguard it can strip out the classes you aren't using.

Thanks,
Eric

> For more options, visit https://groups.google.com/groups/opt_out.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/obflEHgq_og/unsubscribe.

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

Tim O'Brien

unread,
Mar 24, 2014, 3:00:47 PM3/24/14
to google-adm...@googlegroups.com
I'm getting a similar issue but only after my activity pauses and resumes. On initial load, the ad displays just fine.  However, I also integrate with the Google Game API and after calling up the leaderboards, I return to a blank screen.  The game is still active and behind that black screen because I see a flicker of the image and if I call bringtofront on my gameview after adview.resume I see the game but the Adview is completely messed up from that point forward.

My Layout:
   layout = new RelativeLayout(this);
   layout.setBackgroundColor(0xFF000000);
   layout.setGravity(Gravity.CENTER);
    gameview.setKeepScreenOn(true);
    layout.addView(gameView());

RelativeLayout.LayoutParams rlp2 = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
rlp2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
rlp2.addRule(RelativeLayout.CENTER_IN_PARENT);
            layout.addView(adView, rlp2);
            layout.bringChildToFront(adView);

   LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
   getWindow().setContentView(layout, params);

Show Ad Code
     The Adview has an initial state of GONE and I call the following to make visible, and it loads just finish until an activity pause\resume occurs.
  adView.setVisibility(View.VISIBLE);
  adView.startLayoutAnimation();

I make the adView GONE before a call to adView.pause and that will allow the game view to be seen on resume, but if I try to call the above code to show the Ad after resume, the entire screen goes black.

Eric Leichtenschlag

unread,
Mar 24, 2014, 6:42:38 PM3/24/14
to google-adm...@googlegroups.com
Instead of laying the AdView on top of your game, can you set your GameView to LAYOUT_ABOVE the AdView?

I'm also not familiar what "startLayoutAnimation" is doing on the AdView. I don't see that on the view class. Maybe starting that animation is causing something funky to happen?

Thanks,
Eric

Tim O'Brien

unread,
Mar 25, 2014, 7:55:21 AM3/25/14
to google-adm...@googlegroups.com
Hi Eric,

I have found the cause of the issue and I'm now using reversion 15 of Game Play Service (Games API, Plus API, Ads) without any issues.  I'm using the PlayN framework for my game and had a LifecycleListener performing some actions (quadShader, trisShader) when Pause and Resume was occurs.  With the latest version of the framework 1.8.5, I no longer need this listener and AdView works fine with the above Layout.

Thanks,
Tim

bugswitch

unread,
Mar 26, 2014, 5:17:57 AM3/26/14
to google-adm...@googlegroups.com
Hi Everyone,
After upgrading to Google Play SDK i realize that admob sdk Cpu usage increased, even after exiting the app, in the process list (top -n 1 ) app would be using around 30% Cpu, log cat this message will carry on printing out
01-23 16:43:00.349: I/Ads(8029): Ad is not visible. Not refreshing ad.
01-23 16:43:00.349: I/Ads(8029): Scheduling ad refresh 60000 milliseconds from now.
My testing is done with Nexus 5 latest Android SDK 4.4.2
After trying all the solutions recommended in this page, I have come up with a bit of unorthodox solution maybe but my aim was to stop the cpu usage after exiting the app. This solution would do the job if you app does not have service required to run in the background, otherwise you might also destroy your required running services. Basically in the following code you just restart your package onDestroy() . activityManager.restartPackage is deprecated long time ago  but still does the job.Also do not forget to add this permission in your AndroidManifedt.xml <uses-permission android:name="android.permission.RESTART_PACKAGES"></uses-permission>

    @Override
    public void onDestroy()
    {
        super.onDestroy();
       
        Log.i("ACTIVITY-ON-DESTROY","==========");
       
        ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        List<RunningAppProcessInfo> list = am.getRunningAppProcesses();
        for (RunningAppProcessInfo ti : list)
        {
            if(ti.processName.startsWith("com.example.myappname"))
            {
                Log.i("ACTIVITY-ON-DESTROY-kill-pack","==========");
                am.restartPackage(ti.processName);
               
            }
       }
    }


On Friday, January 24, 2014 5:17:18 PM UTC, Eddie Lee wrote:
This problem have been exists for over one week and I am so strange that until now google still haven't fix the issue, we are losing money day by day because of the fault from google!

and for deepak the reason why you get the timeout is because the user's google play service got update while the google play service library you used to built is still the old one, I would suggest you to build a new version of your apps with the new google play library asap, this cannot help your user with the old version to get the ad, but at least you can minimize your lose on this issue.

Here is a summary.
Old library + old google play in client device= ad ok
new library + new google play in client device=ad ok
old library + new google play in client device= ad not shown
old library + no google play in client device(which is common in china)= ad ok

Thanks,
Eddie


2014/1/24 deepak k.k <dkk...@gmail.com>
Hi,
 i  integrated google ads with play services, presently i am using banner ad.My problem is in some devise ad is loading in some device its not loading . I am getting error like this 
"
01-23 16:42:09.009: I/Ads(8029): Trying mediation network: 5450213213286189855
01-23 16:42:09.009: I/Ads(8029): Instantiating mediation adapter: com.google.ads.mediation.admob.AdMobAdapter
01-23 16:42:14.009: I/Ads(8029): Timed out waiting for adapter.
01-23 16:42:14.009: I/Ads(8029): No fill from any mediation ad networks.
01-23 16:42:14.009: I/Ads(8029): Scheduling ad refresh 60000 milliseconds from now.
01-23 16:42:14.019: W/Ads(8029): Failed to load ad: 3
01-23 16:43:00.349: I/Ads(8029): Ad is not visible. Not refreshing ad.
01-23 16:43:00.349: I/Ads(8029): Scheduling ad refresh 60000 milliseconds from now.
01-23 16:43:14.019: I/Ads(8029): Starting ad request. "
What is the reason?


On Friday, November 1, 2013 1:09:05 AM UTC+5:30, Eric Leichtenschlag wrote:
Hey guys,

We just launched Google Mobile Ads on Google Play services! Integrating with Google Play services allows your app to stay on the latest version of the Google Mobile Ads library without having to update your app, as updates will automatically get pushed to the device. Check out this post for the announcement of the new library, and our docs for how to get started. We also have a migration guide which showcases some implementation differences between the old Google Mobile Ads Android SDK and the new Google Mobile Ads library included as part of Google Play Services.

Thanks,
Eric

--
 
---
You received this message because you are subscribed to the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

Eric Leichtenschlag

unread,
Mar 26, 2014, 5:31:19 PM3/26/14
to google-adm...@googlegroups.com
Even though you're seeing those logcat messages, there is a simple check whether the ad is visible, and the refresh stops immediately before ever making a request. I filed a bug to pause the timer in adView.pause() and resume the timer in adView.resume(), but I don't think it's the cause. This is still under investigation.

I've also heard that WebView().pauseTimers() changed it's behavior in 4.4, which may be why pauseTimers() didn't work for you.

Also, as an FYI, I'm going to go ahead and lock this thread since it contains several different issues and isn't useful to search over or read anymore. For further discussion on any of these issues, please create a new topic.

Thanks,
Eric
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages