Wish Ability to compile only portions of Google Play Services

MrKim

Well-Known Member
Licensed User
Longtime User
My little 400k app goes to 7 MEGS with Google play services. All I want to use is FusedLocationProvider. I understand it is possible to only compile portions of Google Play Services. It would be nice to have that feature.

Thanks!
 

warwound

Expert
Licensed User
Longtime User
More info about selectively compiling Google Play Services into an app can be found here:
https://developers.google.com/android/guides/setup
Scroll down the page to 'Selectively compiling APIs into your executable'.

Currently only Android Studio users can selectively compile Google Play Services.

There's 2 problems implementing this wish in b4a:
  • Google don't make the various separate parts of Google Play Services available as normal downloads.
    Instead the maven build process retrieves the required parts when you compile your app.
  • The separate parts of the Google Play Services are in the newer .aar format, they're not traditional .jar libraries.
    So b4a would have to support .aar library files.
    I think .aar support in b4a has been requested before but am not sure...
 

MrKim

Well-Known Member
Licensed User
Longtime User
More info about selectively compiling Google Play Services into an app can be found here:
https://developers.google.com/android/guides/setup
Scroll down the page to 'Selectively compiling APIs into your executable'.

Currently only Android Studio users can selectively compile Google Play Services.

There's 2 problems implementing this wish in b4a:
  • Google don't make the various separate parts of Google Play Services available as normal downloads.
    Instead the maven build process retrieves the required parts when you compile your app.
  • The separate parts of the Google Play Services are in the newer .aar format, they're not traditional .jar libraries.
    So b4a would have to support .aar library files.
    I think .aar support in b4a has been requested before but am not sure...
Thanks, so do you know, does the ENTIRE 7 meg lib get loaded every time I run the FusedLocationProvider?
 

warwound

Expert
Licensed User
Longtime User
Thanks, so do you know, does the ENTIRE 7 meg lib get loaded every time I run the FusedLocationProvider?

If you use any feature of the Google Play Services then the entire Google Play Services library is compiled into your app.
Most of that 7MBs is probably unused code but it is all included in the compiled app.
So memory usage at runtime isn't the problem - the problem is the apk bloat.
 
Top