Over a million developers have joined DZone.

Google Play Services 5.0 is Here to Choke Your Apps

DZone's Guide to

Google Play Services 5.0 is Here to Choke Your Apps

· Java Zone ·
Free Resource

Java-based (JDBC) data connectivity to SaaS, NoSQL, and Big Data. Download Now.

Last week, Google Play Services 5.0 was released. There's been some talk recently that its swift growth may be beneficial when it comes to cleaning up fragmentation - if that's really a big deal, anyways - but there could be some drawbacks. According to Jake Wharton, in fact, there may be more drawback than benefit. He sums it up in the title of this recent post from his blog:

Play Services 5.0 Is A Monolith Abomination

According to Wharton, the new version of Play Services is really going to bloat your APK. He points to the dex limit as a major hurdle - 64,000 methods - because Play Services alone adds 20,000. That's a huge chunk taken up immediately, and it doesn't need to be that way. 

(20% of your dex limit, right here)

Wharton's not saying Play Services is useless, after all. In fact, he gives it a lot of credit:

A lot of really cool functionality is being put in Play Services. You’ll have a hard time making a compelling app that lives in the Google Play ecosystem without it. You should want to put it in your applications and not have to worry about the overhead it brings.

But it's not at all efficient:

Most of the library’s offerings are very disparate, having only the fact that they’re by Google as a common thread. This screams for small, modular artifacts which can be composed!

Just to illustrate the point, Wharton also provides a full breakdown of the packages added in Play Services 5.0 so you can get a feel for what, exactly, is clogging up your APK. On top of that, the packages are already configured such that partitioning would not be too much of a challenge - Wharton illustrates this, too.

You can find all the details in Wharton's full post, but the core idea is simple: Play Services is just getting too big. 

Connect any Java based application to your SaaS data.  Over 100+ Java-based data source connectors.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}