Is it a good idea to use Google Guava library for Android development?

JavaAndroidGuava

Java Problem Overview


I am involved in the development of Android application which is a rather "thick" mobile client for a Web service. It heavily communicates with the server but also has a lot of inner logic too. So, I decided to use some features of Google Guava library to simplify development process. Here is a list of features I'm very interested in: immutable collections, base utils, collection extensions, functional programming sugar and idioms (common.collect and common.base), primitives utilities (common.primitives), hashing utilities (common.hash), concurrent utils (futures and AsyncFunction). Things I don't want to use in Android: common.cache (see question below), common.eventbus (we have better Android specific libs for this, such as Otto), common.io (we can use okio for Android now).

I read that using Guava for Android can significantly slow down compilation process and also decrease the whole runtime performance: https://stackoverflow.com/questions/9283070/bad-performance-with-guava-cache (in this case it is reasonable and there is no need to use Guava's cache for Android) and https://stackoverflow.com/questions/7548038/adding-google-guava-to-android-project-significantly-slows-down-the-build

So, is it efficient to use Guava library in Android project or this library is designed to be used only for the server-side development, and I should go with standard solutions? Any explanations will be very appreciated.

Java Solutions


Solution 1 - Java

(Too big for comment, so I post an answer.) Personally I use whole Guava library in every Java project and when I don't have significant and properly profiled performance problems. If you do have, for example, memory concerns like in Android environment, you can use ProGuard to get only these parts of Guava you really need.

Moreover, there are many Android apps using Guava - not only small ones, i.e. Google Search and Youtube, which directly come from Google.

(You should also see compatibility note.)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionOleksandr KaraberovView Question on Stackoverflow
Solution 1 - JavaXaerxessView Answer on Stackoverflow