android

Creating a fat AAR

Oct 2, 2018
java, gradle, android

I recently wrote a new library called NeuroSky Android SDK. It’s used for writing Android apps using signals of the brain waves received from the NeuroSky MindWave Mobile headsets. Probably I’ll write a separate article about it because it’s quite interesting topic. This library uses ThinkGear library, which is distributed by the NeuroSky as a *.jar file, so I couldn’t use it as a Gradle or Maven dependency in my project and I had to put this *. ...

Writing my first library in Kotlin

Aug 19, 2018
java, kotlin, android, gradle

Introduction # Recently, I decided to create a tiny Android library called RxBattery, which is monitoring battery state of the device with RxJava and RxKotlin. I created a few Java and Android libraries already and this time I decided to use Kotlin programming language instead of Java to learn something new and write something more complicated than “Hello World” app. Here are my observations. Build System # I used Gradle to build the project. ...

Solving problems with AVD and KVM on Linux

Aug 16, 2018
android, linux

I installed Android SDK and Android Studio on my new ThinkPad T470s with Ubuntu Linux 18.04.1 LTS. As usual, I wanted to create a new Android phone emulator called AVD (Android Virtual Device). I was able to create a new device, but unfortunately I encoutered problems. After opening AVD window, I saw the error message… /dev/kvm is not found # KVM (Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). ...

Releasing ReactiveNetwork v. 1.0.0 (paying the technical debt)

Jun 24, 2018
android, java, open-source

Today, I’ve released next version of my most popular open-source project - ReactiveNetwork. I’ve released version 0.12.4 for RxJava1.x and version 1.0.0 for RxJava2.x. Please note, RxJava1.x is no longer officially supported and I’m going to follow the same approach in my RxJava-based projects. It’s not the first release of this project, but I’m breaking the API and removing existing methods, so I decided to stick to proper versioning standard. I didn’t always do it properly in the past, but it’s never too late. ...

Debugging Google Pixel 2

Jun 20, 2018
android

I recently destroyed my good old Nexus 6 phone. It’s still working, but display screen is broken. Due to this fact, I’ve had an excuse to buy new Pixel 2 phone. It’s pretty expansive, but its quality is really good. As usual, I wanted to debug an app on this device and encountered problem related to device permissions. Once I connected the phone, to my laptop and typed adb devices, I’ve seen the following message: ...

Introducing ReactiveBus

Mar 11, 2018
java, rxjava, android

Today, I’ve released my another tiny project. It’s a very simple implementation of Event Bus with RxJava 2 under the hood. This library is compatible with Java 1.7 or higher. I didn’t use Java 1.8 or 1.9 because I wanted to make it compatible with Android apps. You can use it as follows: Bus bus = ReactiveBus.create(); Disposable observer = bus.receive().subscribe(new Consumer<Event>() { @Override public void accept(Event event) { // handle event here } }); Once, we created Event Bus object and our observer (or more precisely: disposable subscriber), we can start sending events: ...

DroidCon Poland 2017 - Is your app really connected?

Dec 2, 2017
android, java, rxjava, conferences, open-source

Yesterday, I gave a presentation about connectivity in the Android apps during the DroidCon Poland 2017 Conference in Kraków. Below, you can see slides from this presentation. View slides on SpeakerDeck There’s also tweet related to this presentation from DroidCon Kraków: Piotr Wittchen tells us about how we can we keep the track of network 🌎 or Internet connectivity changes in our app 📱🆘🙂 pic.twitter.com/7YGGzNJeb2 — droidcon Kraków (@droidconkr) December 2, 2017 I hope, you enjoyed it. ...

Simple reactive HTTP client and server with RxJava, Vert.x and Android

Nov 9, 2017
android, java, rxjava

During Hack Your Career event at the Silesian University of Technology, I’ve prepared a presentation titled Reactive Programming - Efficient Server Applications with a colleague from work. Arek told about theory of Reactive Programming, shown basic concepts, data types and a few examples in the code. During my part of the presentation, I’ve wrote a very simple server and client in Java (9 on the server, 7 on the client) with Vert. ...

Integrating ErrorProne and NullAway with an Android project

Sep 15, 2017
java, android

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: ...

Introducing ReactiveAirplaneMode

Aug 15, 2017
android, java, rxjava, open-source

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. ...