Menu Close

Google I/O: Application size matters

Google I/O: Application size matters

The annual Google IO conference was packed again with interesting presentations about all things Google, with a heavy focus on Android. Google managers and engineers shared their insights to boost the knowledge and enthusiasm of 7000 developers in Mountain View and many more viewers following online.

"Lean and Fast: Putting Your App on a Diet" emphasized the importance of keeping the size of Android applications in check, to provide the best possible experience to all users who want to download, store, and run your applications. This is an interesting observation by itself: smartphones are orders of magnitude more powerful than the feature phones and even PCs of only a few years ago, but the user expectations have grown as well. With devices themselves shrinking (smartphones, watches, grains of sand...), the need to make applications smaller and more efficient is a given.

The Android team whole-heartedly recommended to use ProGuard, even if it may require some attention to set up. Luckily, the Android build system already applies default ProGuard configuration for the Android runtime and for your application. You may then still need to add some project-specific configuration, to account for any reflection in the application code. If you've used ProGuard before, you're probably familiar with the configuration options in the ProGuard configuration file. Few developers know that you can also add ProGuard annotations directly in your code. The Android team has now added the @Keep annotation to the support library, to make this even easier. Just add the annotation to any class, field or method that should remain available for reflection, and you're good to go.

For library developers, the engineers recommended to add consumer ProGuard rules to their libraries. Application developers who use your libraries then get a flying start when they apply ProGuard to their applications. The Android build system automatically adds the ProGuard rules, removing any guesswork and saving time and effort, thus providing value to developers and end users.

"What's new in Android development tools" also mentioned the @Keep annotation, greeted by enthusiastic response from the audience.

"What's new in Google Play for developers" stressed the importance of lean applications to keep the download size as small as possible, since it is the first cost for the users of your applications. They recommended to reduce the size of resources with WebP and SVG, and reduce the code size with ProGuard.

Eric Lafortune