I've just added location awareness to my app, based on the simple "get last known location" functionality described here, which uses the fused location provider.
I've been trying to keep my app as lightweight as possible, so it's disappointing that, in the process of adding simple location awareness, my apk size has gone from 185K to 2.1M. The actual code itself certainly hasn't increased by that amount, so I assume it's pulling in a big library from somewhere.
Any idea how I can reduce my apk size again?
Thanks.
Couple things can help:
Use ProGuard to strip out unused code - most folks leave this disabled for development builds, to avoid the extra build time, and enable for release builds.
Use the new granular dependency management introduced in Play Services 6.5. You can select which of the Play Services components you need and exclude the others. From the documentation:
In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit.
From version 6.5, you can instead selectively compile Google Play service APIs into your app.
A list of the individual APIs you can include may be found here.