Integrating ErrorProne and NullAway with an Android project

Recently, with the remote help of guys from Uber in California, I integrated NullAway and ErrorProne with the one of my open-source Android projects. What is NullAway? Basically, it’s a tool to help eliminate NullPointerExceptions (NPEs) in your Java code. It detects situations where NPE could occur at the compile time. Let’s have a look at the following code: static void log(Object x) { System.out.println(x.toString()); } static void foo() { log(null); } NullAway will find out that we’re passing null and we’ll get appropriate error message:...

September 15, 2017 · 2 min · 387 words · Piotr Wittchen

Building and running SAP Hybris Commerce Platform via Gradle

Introduction I really like Gradle build system for JVM apps. It has flexibility like Ant and great dependency management capabilities like Maven. It addition, it doesn’t use XML notation, but Groovy programming language, so builds configurations are simple, concise, easier to read and easier to create. In my opinion, Gradle is truly modern build system for JVM apps. Nevertheless, there are projects, which are pretty old and use older systems like Ant....

September 1, 2017 · 3 min · 553 words · Piotr Wittchen

Introducing ReactiveAirplaneMode

I’m continuing Rxfication of the Android. Recently I released brand new library called ReactiveAirplaneMode. As you may guess, it allows listening Airplane mode on Android device with RxJava observables. A usual I’ve hidden all implementation details, BroadcastReceivers and rest of the Android related stuff behind RxJava abstraction layer, so API is really simple. Just take a look on that: ReactiveAirplaneMode.create() .observe(context) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(isOn -> textView.setText(String.format("Airplane mode on: %s", isOn.toString()))); In the code above subscriber will be notified only when airplane mode changes....

August 15, 2017 · 1 min · 198 words · Piotr Wittchen

Using Tmux plugins with Tpm

Recently, I decided to organize my Unix dotfiles in a better way. I had a few custom scripts I used in my Tmux bottom bar. I kept these scripts in .scripts directory and during installation or upgrade of my personal configuration, install.sh script was copying them from .scripts directory to /usr/local/bin/ directory. I wanted to make this configuration more solid and consistent, so I decided to transform these scripts into tmux plugins managed by tpm....

August 7, 2017 · 2 min · 418 words · Piotr Wittchen

Releasing ReactiveNetwork v. 0.11.0

In the latest release of ReactiveNetwork library, I focused on Walled Garden AKA Great Firewall support during checking Internet connectivity. There are countries with limited Internet access like China and in such cases, pinging commonly known host like www.google.com may have different results than in other countries because it may be blocked. We may get false positive results because users will generally have an access to the Internet, but they don’t have access only to several websites....

August 6, 2017 · 2 min · 228 words · Piotr Wittchen