Releasing prefser v. 1.0.5

I am happy to announce that I released version 1.0.5 of Prefser Android library. Prefser is a wrapper for Android SharedPreferences with object serialization and RxJava Observables. What has been done in this version: Removed final keyword from Prefser class in order to allow class mocking thanks to @plackemacher Removed unused imports from Prefser class Added test coverage report generation Increased test coverage to 100% Added abstraction for JsonConverter and default GsonConverter Added getAndObserve(....

June 18, 2015 · 1 min · 171 words · Piotr Wittchen

Test coverage report for Android application

Update: see newer article about Unit test coverage report with Travis CI for Robolectric on Android. For a long time, I wasn’t able to find the right way to generate test coverage reports for Android instrumentation unit tests created with AndroidJUnit4 runner. In the past I’ve found many solutions, but none of them was working or they were compatible only with Robolectric, which I currently don’t use. Other developers also stopped using it for the new projects....

June 3, 2015 · 3 min · 498 words · Piotr Wittchen

Static code analysis in Android project

Overview I’ve recently read great article telling how to improve quality and syntax of your Android code by Vincent Brison. It presents how to use tools like Checkstyle, Findbugs, PMD, and Android Lint for Static Code Analysis in Android project. Static Code Analysis allows us to keep consistency of the source code style and helps us to find errors, warnings, possible bugs, bottlenecks and ways to improve the projects. I highly recommend to use tools like those mentioned....

March 26, 2015 · 3 min · 563 words · Piotr Wittchen

Mockito on Android

Overview When we write unit tests for an Android application, sometimes there’s a necessity to mock some classes or interfaces. Instead of writing implementations dedicated for unit tests by hand, we can use Mockito library. We can read article about Mockito on Android on Square’s blog. Mockito can make our tests cleaner and better. It can be used both in classic Java projects and Android projects. It’s one of the most popular mocking framework in Java and if you’re a Java developer who writes unit tests and tries to apply TDD approach, you should be familiar with it....

March 15, 2015 · 2 min · 291 words · Piotr Wittchen

Introducing prefser

I’ve recently released Prefser, which is a wrapper for Android SharedPreferences with object serialization and RxJava Observables. Prefser wraps SharedPreferences and thanks to Java Generics provides you simpler API than classic SharedPreferences with only two methods: void put(String key, Object value); <T> T get(String key, Class classOfT, T defaultValue); Classic SharedPreferences allows you to store only primitive data types and set of strings. Thanks to Gson serialization, Prefser allows you to store:...

February 22, 2015 · 1 min · 197 words · Piotr Wittchen