Android-State Library

SDK

Android-State Library

Posted by Ralf Wondratschek on 26 Jan 2017

Posted by Ralf Wondratschek on 26 Jan 2017

Comment

We at Evernote believe in open source. That’s why we frequently release and contribute to open source projects like Serge, our continuous localization solution, and Android-Job, an Android library to easily handle background jobs.

We’re not only giving back some of our work, but we’re also using a couple of open source projects in our own products. One we rely on heavily is Icepick from Frankie Sardo. Icepick is described as “an Android library that eliminates the boilerplate of saving and restoring instance state.” And it more than lives up to its promise.

Recently we integrated Kotlin into our Android client and noticed that Icepick misses some features important to us: it doesn’t support properties which is especially troublesome for Kotlin. Also, Icepick does not support private fields which may break encapsulation; a tool shouldn’t force you into this direction.

Icepick is implemented in Clojure, but we ultimately decided that it’s better for us to rewrite the annotation processor in Java. Unfortunately, that makes it hard to push our features into Icepick. That’s why we decided to fork the project and publish a new state-saving library called Android-State.

Upgrading to this library from Icepick is easy. The API is the same; only the packages and the class names have changed. It supports all Icepick features and solves pain points like missing property support and allowing for non-private fields. The project page on GitHub includes detailed setup instructions and code samples.

We’re excited to be a part of the open source community and receive your feedback on this new library. Happy coding!

View more stories in 'SDK'