0

I have refactored my android project and replaced the standalone AdMob library with Google play service for use AD. ( com.google.android.gms.ads.*)

The Google says : The client library has a light footprint if you use ProGuard as part of your build process, so it won't have an adverse impact on your app's file size.

My apk size was 1.1 MB. My apk size now is 2.5 MB.

Is it normal behavior or not ? I think this is a little much size change.

I'm using Proguard and the exception config for Google play service with it. I'm using Eclipse & ADT.

  • Someday, when you move to Android Studio, you can perhaps switch to [the ads-specific subset of the Play Services SDK](http://android-developers.blogspot.com/2014/12/google-play-services-and-dex-method.html), which may reduce the footprint somewhat. – CommonsWare Dec 18 '14 at 20:02
  • I´m pretty sure that size is not caused by the use of Google play services that now contains AdMob classes. Im my case the size was decremented. – Jorgesys Dec 18 '14 at 20:04
  • Thank you the information for you Gents, I can make it by myself maybe with Eclipse. (unfortunatelly I like Eclipse :) ) otherwise I found this : https://groups.google.com/forum/#!topic/google-admob-ads-sdk/26OtVvBkY9I – user2694323 Dec 18 '14 at 20:10

1 Answers1

0

Is it normal behavior or not ? I think this is a little much size change.

It is.

to spin off @CommonsWare's comment (mark, i'm a big fan), since you are still on ANT builds but want to use the base version of the the google play services library

  1. locate aar file for th ebase version of the gps library, something like android-sdk-macosx/extras/google/m2repository/com/google/android/gms/play-services-base/6.5.87/play-services-base-6.5.87.aar
  2. copy it to another folder (dont do any of the following in the sdk folder as it might screw up the your local sdk)
  3. rename this copy with the .zip extension
  4. open the zip file and copy the classes.jar file you find
  5. take the copy and add to your google-play-services project's lib folder as play-services-base-6.5.870-classes.jar and remove the all in on version.

This answer helped me find this out recently.

Some notes :

  • The current all in one jar is about 3.5megs
  • The base version jar you can rip out of the aar file is about 792kb
  • you may run into an issue where the version.xml (in the google play-services project res/values folder) causes a problem for GCM. Just update the string to

<integer name="google_play_services_version">6587000</integer>

Community
  • 1
  • 1
petey
  • 16,914
  • 6
  • 65
  • 97