Wish Ability to compile only portions of Google Play Services

Discussion in 'Bugs & wishlist' started by MrKim, Sep 14, 2015.

  1. MrKim

    MrKim Active Member Licensed 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!
     
    b4auser1 likes this.
  2. warwound

    warwound Expert Licensed 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...
     
  3. MrKim

    MrKim Active Member Licensed User

    Thanks, so do you know, does the ENTIRE 7 meg lib get loaded every time I run the FusedLocationProvider?
     
  4. warwound

    warwound Expert Licensed User

    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice